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

Update to upload-artifact@v4 in CI workflows #6857

Closed
wants to merge 2 commits into from

Conversation

justinclift
Copy link
Member

@justinclift justinclift commented Apr 7, 2024

What type of PR is this?

  • Other

Description

This PR updates our CI workflows from actions/upload-artifact@v3 to actions/upload-artifact@v4. This is due to several of the workflows showing this warning during their runs:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js
20: actions/upload-artifact@v3.

For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

How is this tested?

  • E2E Tests (Cypress)

It's passing our CI tests, so looks safe. 😄

Copy link
Member

@lucydodo lucydodo left a comment

Choose a reason for hiding this comment

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

https://github.com/actions/upload-artifact#breaking-changes
Uploading to the same named Artifact multiple times.

Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. Otherwise you will encounter an error.

Starting with v4, artifact names cannot be duplicated. So we need to rename the artifact for each step.

@justinclift
Copy link
Member Author

Interesting. That doesn't seem clear as to whether the unique artifact name is "per workflow" (eg backend-unit-tests, frontend-e2e-tests, etc), or per .yml file, or maybe something else. 🙄

That says it'll error out if there's a problem, and the CI run didn't seem to throw errors, so I wonder if we're ok?

@justinclift
Copy link
Member Author

justinclift commented Apr 8, 2024

Seems to be more details here:

https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#multiple-uploads-to-the-same-named-artifact

The examples there shows what seems to be different jobs having the same artifact name (as we do), but in their examples it's throwing an error.

We're probably best off to play it safe and do the rename thing.

In that case, we'll probably need to update whatever is looking for the uploaded artifacts so it finds the new ones.

@lucydodo
Copy link
Member

lucydodo commented Apr 8, 2024

Based on my previous experience doing the same thing in other repo, it seems to be determined by a single action 'run'.
It other words, if the workflow are different but both are exeuted in one action 'run', they are considered duplicate.

https://github.com/getredash/redash/actions/runs/8592014265/job/23541482569?pr=6857
Store Test Results
Run actions/upload-artifact@v3

Additionally, the current CI for this PR is using the 'v3' version, so it doesn't seem to be throwing any errors.

@lucydodo
Copy link
Member

lucydodo commented Apr 8, 2024

In that case, we'll probably need to update whatever is looking for the uploaded artifacts so it finds the new ones.

Yes, I'd take a look, but I don't think I have access to 'Codecov' :(
Additionally, I resolved it last time simply by adding a suffix. ex) build-artifact to build-artifact-macos

@justinclift
Copy link
Member Author

Yes, I'd take a look, but I don't think I have access to 'Codecov' :(

Oh. I think that should be fixable. 😄

I'd not personally tried it out before, apart from looking at the "Code Coverage" report things it generates as part of our standard CI workflow.

However, clicking on one of the existing Redash code coverage "Details" links (like this one) worked.

That took me to a page to create a codecov.io (using my GitHub login), then automatically figured out the project I was coming from.

Additionally, it seems to have a way of adding extra organisations too:

image

That's the "Add GitHub Organization" link in the drop down above.

Maybe try that and see if it works? 😄

@lucydodo
Copy link
Member

lucydodo commented Apr 8, 2024

I tried, but it still says I don't have permission. :(

@justinclift
Copy link
Member Author

Try again now, I've just bumped up your permissions to admin level for this repo. Lets see if recognises that or not. 😄

@lucydodo
Copy link
Member

lucydodo commented Apr 8, 2024

That's weird, it still says it's not accessible.

@justinclift
Copy link
Member Author

Ugh. That sounds like it's only going to recognise people who've been added via the main getredash organisation "team members" interface thing, and isn't recognising people who've been added as collaborators to specific repos. 😦

I'll email @arikfr directly to get that done (there's a queue already though). Pinging him via discord isn't working, but maybe email will. 😄

@lucydodo
Copy link
Member

lucydodo commented Apr 8, 2024

Okay, I'll be waiting :)

@justinclift
Copy link
Member Author

Email sent. 😄

@justinclift
Copy link
Member Author

Received a response from @arikfr via email. He said he's travelling at the moment, so will take care of this stuff in a few days.

@lucydodo
Copy link
Member

No worries, this PR is not urgent at all. :)

@justinclift
Copy link
Member Author

This PR isn't needed any more, as the update to upload-artifact@v4 was included in PR #6674 which has just been merged. 😄

@justinclift justinclift deleted the ci_upload_artifact4_v1 branch April 10, 2024 10:02
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