GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use the `checkout_path` for getting the commit oid by aeisenberg · Pull Request #956 · github/codeql-action

Conversation

@aeisenberg

@aeisenberg aeisenberg commented Feb 28, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Ensure that repos checked out in a non-standard location can still be uploaded.

Here is a sample PR in a different repo that uses the checkout_path: https://github.com/aeisenberg/actions-test2/pull/4/checks

I created an integration test that validates that checkout_path is doing what it should. Looking at the logs, I can see that the test is doing the right thing, but I'm not able to get the test to fail when checkout_path is not set. So, this still needs a bit of work. Ideally, we would upload the sarif file and verify that the commit_oid is correct, but our tests cannot actually upload any sarif, so that makes checking a little bit harder.

EDIT: I think I have it. See the new integration test.

When running in test mode, payloads will not be uploaded. Instead, they
will be saved to disk so that they can be inspected later.

This change will also require a documentation fix.

I'm not entirely happy with this since to get this working, the init action requires a source-path input and the analyze action requires a checkout_path. But we can specify this in the doc changes.

Fixes #952

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch 5 times, most recently from d4d4a0a to 471d7af Compare February 28, 2022 21:22
@aeisenberg
aeisenberg marked this pull request as ready for review February 28, 2022 22:41
@aeisenberg
aeisenberg requested a review from a team as a code owner February 28, 2022 22:41
@aeisenberg
aeisenberg marked this pull request as draft February 28, 2022 22:42
@aeisenberg

aeisenberg commented Feb 28, 2022

Copy link
Copy Markdown
Contributor Author

Still trying to figure out how to verify that the integration test is passing (other than by visually inspecting the log). We need to validate that the commitOid of the payload that would have been invoked is the same as that of the second checkout. One possibility is that I can change the determineMergeBaseCommitOid and getCommitOid methods to write a file to disk with the payload parameters if the action is in debug mode. And the test can validate these parameters after the upload step.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch 2 times, most recently from b8a2c1e to 9acab1b Compare March 1, 2022 06:15
@aeisenberg
aeisenberg marked this pull request as ready for review March 1, 2022 06:15
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch from 9acab1b to d7473a8 Compare March 1, 2022 16:07
@aeisenberg
Use the checkout_path for getting the commit oid
a92e877
This commit also adds a new integration check to verify this.

When running in test mode, payloads will not be uploaded. Instead, they
will be saved to disk so that they can be inspected later.
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch from d7473a8 to a92e877 Compare March 1, 2022 20:41
@aeisenberg
Merge branch 'main' into aeisenberg/checkout-path-commitoid
5c2600e
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch 6 times, most recently from 72d4e07 to 98e84df Compare March 2, 2022 17:22
cklin
cklin reviewed Mar 4, 2022
View reviewed changes
Comment thread pr-checks/checks/with-checkout-path.yml Outdated
source-path: x/y/z/some-path/tests/multi-language-repo
debug: true
- name: Build code (non-windows)
shell:

@cklin cklin Mar 4, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? Similarly for Build code (windows).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aeisenberg aeisenberg Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm...it should be bash. Here and below.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/checks/with-checkout-path.yml Outdated
debug: true
- name: Build code (non-windows)
shell:
if: ${{ !startsWith(matrix.os, 'windows-') }}

@cklin cklin Mar 4, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is to check runner.os.
https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aeisenberg aeisenberg Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true. It's cleaner to use runner.os. I'll make the change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aeisenberg
aeisenberg commented Mar 4, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/checks/with-checkout-path.yml Outdated
source-path: x/y/z/some-path/tests/multi-language-repo
debug: true
- name: Build code (non-windows)
shell:

@aeisenberg aeisenberg Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm...it should be bash. Here and below.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/checks/with-checkout-path.yml Outdated
debug: true
- name: Build code (non-windows)
shell:
if: ${{ !startsWith(matrix.os, 'windows-') }}

@aeisenberg aeisenberg Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true. It's cleaner to use runner.os. I'll make the change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch from 98e84df to 6591114 Compare March 4, 2022 20:12
cklin
cklin approved these changes Mar 4, 2022
View reviewed changes
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch 4 times, most recently from a4e7f9e to 852be69 Compare March 10, 2022 22:35
@aeisenberg

aeisenberg commented Mar 11, 2022

Copy link
Copy Markdown
Contributor Author

Fixes #944

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
Fix failing tests
d068f53
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch from 852be69 to 5d444c1 Compare March 25, 2022 17:01
@aeisenberg
Merge branch 'main' into aeisenberg/checkout-path-commitoid
88db5e7
@aeisenberg
aeisenberg force-pushed the aeisenberg/checkout-path-commitoid branch from 5d444c1 to 88db5e7 Compare March 25, 2022 17:32
@aeisenberg

aeisenberg commented Mar 25, 2022

Copy link
Copy Markdown
Contributor Author

@criemen I fixed the hang we were seeing by changing from java to csharp for with-checkout-path.yml. Not happy with that, and maybe we should take a deeper look into this.

criemen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Mar 25, 2022

Copy link
Copy Markdown
Contributor Author

Merging this PR since the previously hanging integration tests are unrelated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
aeisenberg merged commit 6d1f0a0 into main Mar 25, 2022
@aeisenberg
aeisenberg deleted the aeisenberg/checkout-path-commitoid branch March 25, 2022 18:03
This was referenced Mar 30, 2022
Merge main into v2 #1004
Merged
Merge v2 into v1 #1006
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Mar 6, 2025
[pull] main from github:main StemmlerSisters/codeql-action#1
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cklin cklin cklin approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

upload-sarif action seems to always use GITHUB_WORKSPACE Git information to compute commit_oid

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@aeisenberg @cklin
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.