FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Ensure artifacts are only uploaded in safe situations by aeisenberg · Pull Request #2726 · github/codeql-action · GitHub

Ensure artifacts are only uploaded in safe situations - #2726

Merged
aeisenberg merged 7 commits into
mainfrom
aeisenberg/reenable-artifact-upload
Jan 27, 2025
Merged

aeisenberg merged 7 commits into
mainfrom
aeisenberg/reenable-artifact-upload

Conversation

aeisenberg commented Jan 25, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Turns on uploading of artifacts again but only if CLI version is >= 2.20.3. I implemented the check using our feature flag functionality. I was on the fence about this since it makes the PR more complex. However, it does give us more flexibility when controlling artifact uploads.

I've changed the PR so that it checks versions directly.

Also, I renamed the two workflows that were previously disabled. This way we will not accidentally enable the old workflows for previous versions of the action.

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.

This commit:

Turns on uploading of artifacts again but only if CLI version is
>= 2.20.3. I implemented the check using our feature flag functionality.
I was on the fence about this since it makes the PR more complex.
However, it does give us more flexibility when controlling artifact
uploads.

Also, I renamed the two workflows that were previously disabled. This
way we will not accidentally enable the old workflows for previous
versions of the action.
Copilot AI review requested due to automatic review settings January 25, 2025 23:32
aeisenberg requested a review from a team as a code owner January 25, 2025 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/debug-artifacts.ts:300

  • No test confirms the 'upload-successful' scenario. Adding a test that verifies successful artifact uploads would provide more complete coverage.
    return "upload-successful";

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

Using the feature flag mechanism for checking if uploads are enabled was
too clunky. I'm moving the change to checking versions directly.
aeisenberg force-pushed the aeisenberg/reenable-artifact-upload branch from 7201315 to f71067b Compare January 26, 2025 21:42
Not sure why we need this now, but didn't before.
Comment on lines +22 to +29
strategy:
fail-fast: false
matrix:
version:
- stable-v2.20.3
- default
- linked
- nightly-latest

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We are now matrixing the build because we want to be sure it is working in the versions we know about.

angelapwen previously approved these changes Jan 27, 2025

angelapwen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good — just some non-blocking comments about giving the tests a bit more clarity!

Comment thread src/debug-artifacts.test.ts Outdated
t.is(
uploaded,
"upload-not-supported",
"Expect failure to upload artifacts since root dir does not exist",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this test failure should be because the CodeQL version is old and not supported here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this comment is still valid on this test — the failure should be because the upload is not supported on this version of the CLI, right?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oops. Yes. You're right about this one. I'll change it.

Comment thread src/debug-artifacts.test.ts Outdated

Copy link
Copy Markdown
Contributor Author

@angelapwen, do these comments clarify things?

Copy link
Copy Markdown
Contributor

@angelapwen, do these comments clarify things?

Yes! I think one comment is still valid, posted above!

angelapwen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good!!

aeisenberg enabled auto-merge January 27, 2025 18:57
aeisenberg merged commit b494190 into main Jan 27, 2025
aeisenberg deleted the aeisenberg/reenable-artifact-upload branch January 27, 2025 19:10
github-actions Bot mentioned this pull request Jan 27, 2025
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL