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 — Replace checkoutPath variable with sourceRoot/workspacePath variables by aibaars · Pull Request #610 · github/codeql-action

Conversation

@aibaars

@aibaars aibaars commented Jul 1, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

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.

A discussion on #607 made me realise that the variable name checkoutPath is used for two purposes:

  • resolving relative file paths (config file and queries)
  • the CodeQL source root for making relative paths in the SARIF output

This pull request changes the variable name checkoutPath to be workspacePath when used for resolving paths, and sourceRoot whenever it is used as a CodeQL source-root.

There is a third use of the checkoutPath. It is passed to codeql as --search-path when running a custom query in the repository being analysed. I think this make little sense because it is very unlikely that the root folder of the repository we're analysing (or the workspace path) contains a query pack.

@adityasharad The discussion on #607 also made it clear that there is a slight inconsistency between the way the Action and the Runner handle the resolution of relative paths. The Runner resolves them with respect to the --checkout-path flag and the Action resolves them against ${GITHUB_WORKSPACE} (aka the working directory).

To make the Action and the Runner align better, I suggest we deprecate the --checkout-path flag and replace it with --source-root and --working-directory (both optional like --checkout-path and defaulting to .) . This should match the codeql cli terminology and in addition makes the Action and the Runner behave more similar.

Sorry, something went wrong.

Uh oh!

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

All reactions
@aibaars
aibaars force-pushed the aibaars/refactor-checkout-path branch from 9fb45ac to 685dfac Compare July 1, 2021 13:36
@adityasharad

adityasharad commented Jul 1, 2021

Copy link
Copy Markdown
Contributor

Looks like a sensible renaming, thanks! That --search-path use should probably be --additional-packs, and could probably be more specifically scoped to the path of the custom query within the repo, but for now I agree with preserving it for simplicity.

As we discussed internally, let's hold off on deprecating the Runner's checkout-path flag for now, since it's widely used, in favour of giving users a path towards using the CLI instead.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aibaars
Rename checkoutPath to either workspacePath or sourceRoot
f94f1ed
@aibaars
aibaars force-pushed the aibaars/refactor-checkout-path branch from 685dfac to f94f1ed Compare July 14, 2021 11:39
@aibaars
aibaars marked this pull request as ready for review July 14, 2021 11:40
@aibaars
aibaars requested a review from a team as a code owner July 14, 2021 11:40
@aibaars

aibaars commented Jul 14, 2021

Copy link
Copy Markdown
Contributor Author

@adityasharad shall we merge this PR?

All reactions

Sorry, something went wrong.

Uh oh!

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

adityasharad
adityasharad approved these changes Jul 14, 2021
View reviewed changes
@adityasharad
Merge branch 'main' into aibaars/refactor-checkout-path
d7dcff9
@adityasharad
adityasharad enabled auto-merge July 14, 2021 14:58
@adityasharad
adityasharad merged commit 14deaf6 into main Jul 14, 2021
@adityasharad
adityasharad deleted the aibaars/refactor-checkout-path branch July 14, 2021 15:14
@github-actions github-actions Bot mentioned this pull request Jul 19, 2021
Merge main into v1 #621
Merged
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityasharad adityasharad adityasharad 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.

Uh oh!

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

2 participants

@aibaars @adityasharad
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.