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

Enable overwrite on upload artifact #9383

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

Maosaic
Copy link
Contributor

@Maosaic Maosaic commented Feb 13, 2025

Description

Enable overwrite on upload artifact

Issues Resolved

when upgrade actions/upload-artifact from v3 to v4, by default it disabled overwrite on upload artifact, which can break our CI action.

Run actions/upload-artifact@v4
/usr/bin/docker exec  67b6fe2ab6755c4ac4d8f3ce17062864e8c76474287aff42e172161441b98545 sh -c "cat /etc/*release | grep ^ID"
With the provided path, there will be 6 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

Ref: https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#overwriting-an-artifact

Screenshot

Testing the changes

Changelog

  • skip

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.73%. Comparing base (8284b2d) to head (cbfb678).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9383      +/-   ##
==========================================
+ Coverage   61.71%   61.73%   +0.01%     
==========================================
  Files        3817     3817              
  Lines       91860    91860              
  Branches    14551    14551              
==========================================
+ Hits        56695    56707      +12     
+ Misses      31508    31496      -12     
  Partials     3657     3657              
Flag Coverage Δ
Linux_1 29.00% <ø> (ø)
Linux_2 56.46% <ø> (ø)
Linux_3 ?
Linux_4 28.90% <ø> (ø)
Windows_1 29.03% <ø> (+0.01%) ⬆️
Windows_2 56.41% <ø> (ø)
Windows_3 39.20% <ø> (ø)
Windows_4 28.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

abbyhu2000
abbyhu2000 previously approved these changes Feb 14, 2025
@wanglam
Copy link
Contributor

wanglam commented Feb 17, 2025

Hi @Maosaic, the error message says "an artifact with this name already exists on the workflow run." Do we need to update the conflicting artifact name? With the overwrite option enabled, the old artifact will be overwritten with the new artifact. We won't be able to view the old artifact anymore.

@Maosaic
Copy link
Contributor Author

Maosaic commented Feb 17, 2025

Hi @Maosaic, the error message says "an artifact with this name already exists on the workflow run." Do we need to update the conflicting artifact name? With the overwrite option enabled, the old artifact will be overwritten with the new artifact. We won't be able to view the old artifact anymore.

Yes, this was the exact behaviour we had before updating actions/upload-artifact from v3 to v4, this PR is intended to unblock CI test by revert it back to the old state. I have discussed the overwritten issue with @kavilla , if we are preserve all test video, it's going to significantly increase our storage cost on Github.

@abbyhu2000 abbyhu2000 merged commit 126c144 into opensearch-project:main Feb 18, 2025
10 of 11 checks passed
@Maosaic Maosaic deleted the workflow branch February 18, 2025 01:03
sumukhswamy pushed a commit to sumukhswamy/OpenSearch-Dashboards that referenced this pull request Feb 18, 2025
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-9383-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 126c1444506f87280e4ba3ac879f174d6d1d4de0
# Push it to GitHub
git push --set-upstream origin backport/backport-9383-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-9383-to-2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x failed backport repeat-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants