Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure artifacts are only uploaded in safe situations #2726

Merged
merged 7 commits into from
Jan 27, 2025

Conversation

aeisenberg
Copy link
Contributor

@aeisenberg aeisenberg commented Jan 25, 2025

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 Copilot bot review requested due to automatic review settings January 25, 2025 23:32
@aeisenberg aeisenberg requested a review from a team as a code owner January 25, 2025 23:32

Choose a reason for hiding this comment

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

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 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
Contributor Author

Choose a reason for hiding this comment

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

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

angelapwen
angelapwen previously approved these changes Jan 27, 2025
Copy link
Contributor

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

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

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

src/debug-artifacts.test.ts Show resolved Hide resolved
t.is(
uploaded,
"upload-not-supported",
"Expect failure to upload artifacts since root dir does not exist",
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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
Contributor Author

Choose a reason for hiding this comment

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

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

src/debug-artifacts.test.ts Outdated Show resolved Hide resolved
@aeisenberg
Copy link
Contributor Author

@angelapwen, do these comments clarify things?

@angelapwen
Copy link
Contributor

@angelapwen, do these comments clarify things?

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

Copy link
Contributor

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

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

Looks good!!

@aeisenberg aeisenberg enabled auto-merge January 27, 2025 18:57
@aeisenberg aeisenberg merged commit b494190 into main Jan 27, 2025
266 checks passed
@aeisenberg aeisenberg deleted the aeisenberg/reenable-artifact-upload branch January 27, 2025 19:10
@github-actions github-actions bot mentioned this pull request Jan 27, 2025
8 tasks
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.

2 participants