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

CASSGO-48 Bump actions/upload-artifact and actions/cache versions to v4 #1861

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

worryg0d
Copy link
Contributor

@worryg0d worryg0d commented Jan 23, 2025

Bumped due to cancelation of running CI workflows with the deprecated version of actions/upload-artifact@v3 and in order to prevent future interruptions with deprecation of actions/cache@v2.

Patch by Bohdan Siryk; Reviewed by João Reis, Stanislav Bychkov for CASSGO-48

@worryg0d
Copy link
Contributor Author

I bumped the version of actions/upload-artifact@v3 to v4 to unblock running workflows on other PRs.

@joao-r-reis Could you please look at this one? Also, I noticed warnings about deprecation of actions/cache@v2. Should I bump its version to v4 in this PR as well?

@worryg0d worryg0d changed the title Bumped actions/upload-artifact version to v4 CASSGO-48 Bumped actions/upload-artifact version to v4 Jan 24, 2025
Comment on lines 114 to 119
- name: 'Save ccm logs'
if: 'failure()'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ccm-cluster
path: /home/runner/.ccm/test

Choose a reason for hiding this comment

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

There are breaking changes in version 4.
The actions/upload-artifact documentation states that artifacts are immutable, and you can no longer upload to the same artifact name multiple times. It should be either upload to multiple artifacts with different names or upload everything at once. Otherwise, you will encounter an error.

Since this job uses a matrix, and judging by the documentation and current implementation, it could lead to errors if multiple matrix jobs fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see the issue here. I tested it on my fork forcing the workflow to fail and it really doesn't upload the artifacts...

Run actions/upload-artifact@v4
With the provided path, there will be 922 files uploaded
Artifact name is valid!
Root directory input is valid!
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

I'm going to work on a fix for this. Thanks a lot!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by constructing the name of the artifact using variables from the matrix:

ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}

I was about to add matrix.compressor as well, but we have only snappy in the matrix and #1567 is not merged yet.
If anybody has concerns about this, please feel free to discuss it 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'm fine with not adding matrix.compressor here but we have to remember to do it in #1567

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, I'm sorry, I misread the issue. I meant #1842 which is CASSGO-32

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I was thinking of #1842 too my bad

@ribaraka
Copy link

I noticed warnings about deprecation of actions/cache@v2

It should be safe to bump from actions/cache@v2 to actions/cache@v4, and doing so is recommended to stay current with the latest improvements and avoid issues like the one experienced by @worryg0d. I ran the job using the current code (which still uses deprecated action versions) and did not encounter any CI cancellations. However, there are ongoing discussions about sunsetting older versions, as highlighted in this GitHub discussion and this deprecation notice.

@worryg0d
Copy link
Contributor Author

I ran the job using the current code (which still uses deprecated action versions) and did not encounter any CI cancellations.

By the current code do you mean the code from this PR? If so, I didn't encounter any issues with actions/cache@v2 too. The only thing I notice that in my workflow runs details a warning annotation appears:

Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@v2. 
Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. 
Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-downShow

However, as you said, it will be sunsetted soon

@joao-r-reis
Copy link
Contributor

If bumping actions/cache is simple then I'd say we should do it in this PR as well to avoid interruptions when it does get deprecated

@worryg0d
Copy link
Contributor Author

In the discussion highlited:

The new changes to the actions/cache should be seamless and fully backward compatible. 
You are not expected to change anything in your workflows to use the new service beyond upgrading to the latest releases.

So it looks like there are no problems with bumping it too

@joao-r-reis
Copy link
Contributor

In the discussion highlited:

The new changes to the actions/cache should be seamless and fully backward compatible. 
You are not expected to change anything in your workflows to use the new service beyond upgrading to the latest releases.

So it looks like there are no problems with bumping it too

Nice, feel free to go for it and update the JIRA, PR title and commit message and then I'll merge this

@worryg0d worryg0d changed the title CASSGO-48 Bumped actions/upload-artifact version to v4 CASSGO-48 Bump actions/upload-artifact and actions/cache versions to v4 Jan 24, 2025
@worryg0d
Copy link
Contributor Author

Bumped actions/cache to v4 as well. @joao-r-reis could you please approve the workflow run? Thanks!

Bumped due to cancelation of running CI workflows with the deprecated version of
actions/upload-artifact@v3 and in order to prevent future interruptions with
deprecation of actions/cache@v2.

Patch by Bohdan Siryk; Reviewed by João Reis, Stanislav Bychkov for CASSGO-48
@worryg0d worryg0d requested a review from joao-r-reis January 27, 2025 09:10
@joao-r-reis joao-r-reis merged commit 3e21781 into apache:trunk Jan 29, 2025
16 checks passed
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