Skip to content

CI: make all jobs that fetch a CodeQL CLI use the fetch-codeql action#9938

Merged
aibaars merged 5 commits into
github:mainfrom
aibaars:gh-codeql-ci
Aug 1, 2022
Merged

CI: make all jobs that fetch a CodeQL CLI use the fetch-codeql action#9938
aibaars merged 5 commits into
github:mainfrom
aibaars:gh-codeql-ci

Conversation

@aibaars
Copy link
Copy Markdown
Contributor

@aibaars aibaars commented Aug 1, 2022

Many of the CI jobs download a copy of the CodeQL CLI. However, they were using different ways of doing that:

  • through the fetch-codeql action
  • using gh codeql
  • dowloading and unzipping release artifacts from the codeql-cli-binaries repo

This PR refactors the workflows to all use the fetch-codeql Action. The fetch-codeql action itself is re-implemented using gh codeql

The workflows affected by this change are:

.github/workflows/check-qldoc.yml
.github/workflows/csv-coverage-metrics.yml
.github/workflows/js-ml-tests.yml
.github/workflows/mad_modelDiff.yml
.github/workflows/mad_regenerate-models.yml
.github/workflows/qhelp-pr-preview.yml
.github/workflows/query-list.yml
.github/workflows/ruby-dataset-measure.yml
.github/workflows/ruby-qltest.yml
.github/workflows/swift-codegen.yml
.github/workflows/swift-integration-tests.yml
.github/workflows/swift-qltest.yml
.github/workflows/validate-change-notes.yml

@aibaars aibaars marked this pull request as ready for review August 1, 2022 14:41
@aibaars aibaars requested review from a team as code owners August 1, 2022 14:41
@aibaars aibaars requested a review from a team August 1, 2022 14:41
@aibaars aibaars requested review from a team as code owners August 1, 2022 14:41
Copy link
Copy Markdown
Contributor

@edoardopirovano edoardopirovano left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, and it's nice we can now switch to a nightly version by just changing one word if we decide that's what we want to do.

Copy link
Copy Markdown
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Nice! Several locations where we previously used codeql-cli/codeql that I think can be cleaned up. Otherwise looks good.

- name: Generate CSV files on merge commit of the PR
run: |
echo "Running generator on merge"
PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This path needs to change I think; or we drop it since codeql should already be on GITHUB_PATH.

Copy link
Copy Markdown
Contributor Author

@aibaars aibaars Aug 1, 2022

Choose a reason for hiding this comment

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

well spotted; codeql is already on the GITHUB_PATH. I'll clean this up in a follow-up PR. The go tests take ridiculously long on each commit so I'd rather get this merged and make a quick fix-up PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See: #9943

- name: Generate CSV files on base commit of the PR
run: |
echo "Running generator on base"
PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above.

Comment on lines +28 to +30
CLI=$(realpath "codeql-cli/codeql")
echo $CLI
PATH="$PATH:$CLI" python script/misc/scripts/library-coverage/generate-timeseries.py codeqlModels
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As above, the CLI is not in codeql-cli.

uses: ./.github/actions/fetch-codeql
- name: Generate coverage files
run: |
PATH="$PATH:codeql-cli/codeql" python ql/misc/scripts/library-coverage/generate-report.py ci ql ql
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As above.

uses: ./.github/actions/fetch-codeql
- name: Build modeled package list
run: |
PATH="$PATH:codeql-cli/codeql" python script/misc/scripts/library-coverage/generate-report.py ci codeqlModels script
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As above.

@aibaars aibaars merged commit a63c168 into github:main Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants