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 — Fix assumption that all CodeQL bundle URLs contain the tag name of the bundle by henrymercer · Pull Request #1517 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Feb 3, 2023

Copy link
Copy Markdown
Contributor

While implementing controlled switchover, we inadvertently introduced an assumption that all CodeQL bundle URLs contain the tag name of the bundle, for example codeql-bundle-2020230120. This is in fact not the case on GHES, where the bundle URL may be https://example.githubenterprise.com/api/v3/repos/github/codeql-action/releases/assets/1 when the CodeQL sync tool has been used to sync the CodeQL bundle to the GHES instance.

This PR adds a regression test and fixes that assumption.

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
henrymercer added 2 commits February 3, 2023 19:13
@henrymercer
Add regression test for a bundle URL without a tag
e0fc1c9
@henrymercer
Refactor setting up CodeQL to handle bundle URLs without tags
f140af5
@henrymercer
henrymercer requested a review from a team as a code owner February 3, 2023 19:16
aeisenberg
aeisenberg reviewed Feb 3, 2023
View reviewed changes
Comment thread src/setup-codeql.ts Resolved

Uh oh!

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

Comment thread src/setup-codeql.ts Resolved

Uh oh!

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

Comment thread src/setup-codeql.ts Resolved

Uh oh!

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

henrymercer added 2 commits February 6, 2023 11:57
@henrymercer
Rename forceLatest to forceShippedTools
d49282c
@henrymercer
Warn when multiple bundles for a single CLI are found in the toolcache
d3f2b2e
@henrymercer
henrymercer requested a review from aeisenberg February 6, 2023 12:57
@aibaars aibaars mentioned this pull request Feb 6, 2023
Error on GHES: Malformed tools url: Error: Malformed tools url: https://mycompany.com/api/v3/repos/github/codeql-action/releases/assets/21. Bundle version could not be inferred. Bundle version could not be inferred #1522
Closed
@henrymercer
Add changelog note
c6ff11c
@aeisenberg

aeisenberg commented Feb 6, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

I tried to download an untagged dev CLI instance: https://github.com/dsp-testing/aeisenberg-sarif-upload/actions/runs/4106366120/jobs/7084499130 The job failed. Here is the commit sha I am working with (private repository). dsp-testing/aeisenberg-sarif-upload@0576bc5

Note that the failure reason is a 404 during download, which is strange since the URL https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/untagged-9b0f002edc6e08260e8f/codeql-bundle-linux64.tar.gz works for me when I access it from the browser.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aeisenberg

aeisenberg commented Feb 6, 2023

Copy link
Copy Markdown
Contributor

OK, So I tried again, but this time with a publicly available CLI version that has a non-standard tag. The download worked, but it looks like the tool wasn't cached in the toolcache. I don't think that's a problem.

All reactions

Sorry, something went wrong.

Uh oh!

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

aeisenberg
aeisenberg approved these changes Feb 6, 2023
View reviewed changes

@aeisenberg aeisenberg left a comment

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.

Looks good. I've convinced myself that this fix will correctly download codeqls from arbitrary github releases.

Sorry, something went wrong.

Uh oh!

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

All reactions
@henrymercer

henrymercer commented Feb 6, 2023

Copy link
Copy Markdown
Contributor Author

👍, to summarize:

  • Draft releases are not publicly accessible, so the Actions GitHub token did not have access to the bundle from the draft release
  • Passing a PAT as the token input to init causes problems since the status API only accepts an Actions PAT
  • Working around by publishing the release to make it publicly accessible allows us to download tools from another release.
  • If there is no codeql-bundle-* tag in the URL, the bundle does not get cached. We think this is acceptable since (a) we don't yet have reason to recommend this, and (b) we have an internal issue for the more general issue of how we version the CodeQL Bundle that will also fix this.
malantin reacted with thumbs up emoji angelapwen reacted with eyes emoji
All reactions
  • 👍 1 reaction
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@henrymercer
henrymercer merged commit d396227 into main Feb 6, 2023
@henrymercer
henrymercer deleted the henrymercer/fix/not-all-bundle-urls-contain-tag branch February 6, 2023 18:20
@github-actions github-actions Bot mentioned this pull request Feb 6, 2023
Merge main into releases/v2 #1525
Merged
4 of 6 tasks
@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

@aeisenberg aeisenberg aeisenberg 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

@henrymercer @aeisenberg
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.