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

upgrade upload-artifact and download-artifact actions to v4 #4518

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

findtopher
Copy link
Member

@findtopher findtopher commented Jun 20, 2024

What changes are proposed in this pull request?

Bumps actions/download-artifact from 3 to 4.

Bumps actions-upload-artifact from 3 to 4.

the release notes identify that upload and download need to be the same [major] version.

Also, looks like we're running the upload twice when matrix.platform == 'sdist' which is a v4 no-no


updated-dependencies:

  • dependency-name: actions/download-artifact
  • dependency-name: actions/upload-artifact

How is this patch tested? If it is not, please explain why.

PR tests below

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions download-artifact version from v3 to v4 across multiple workflow files.
    • Added a condition for the upload action in the build-db workflow.

dependabot bot and others added 2 commits June 17, 2024 04:41
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ...

PR tests below
Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Walkthrough

The recent updates primarily focus on enhancing the GitHub Actions workflows by upgrading the actions/download-artifact from version v3 to v4 across multiple workflow files. Additionally, a conditional check (if: ${{ matrix.platform == 'sdist' }}) was added to the upload action in the build-db.yml workflow.

Changes

Files Change Summary
.github/workflows/build-db.yml Updated actions/download-artifact from v3 to v4 in three places. Added condition for upload action.
.github/workflows/build-desktop.yml Updated actions/download-artifact from v3 to v4.
.github/workflows/build-docs.yml Updated actions/download-artifact from v3 to v4.
.github/workflows/build-graphql.yml Updated actions/download-artifact from v3 to v4.
.github/workflows/build.yml Updated actions/upload-artifact from v3 to v4.
.github/workflows/e2e.yml Updated actions/upload-artifact from v3 to v4.
.github/workflows/publish.yml Updated actions/download-artifact from v3 to v4 in two places.

Poem

A Hare's Upgrade Song

In files where artifacts we store,
We've given a boost, firm and more. 🚀
From v3 to v4 on this bright day,
Our workflows now sway in a vibrant new way.
Conditionals added, platforms swirl,
A rabbit's delight in the CI world! 🌐🛠️


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d095b22 and af309e2.

Files selected for processing (5)
  • .github/workflows/build-db.yml (2 hunks)
  • .github/workflows/build-desktop.yml (1 hunks)
  • .github/workflows/build-docs.yml (1 hunks)
  • .github/workflows/build-graphql.yml (1 hunks)
  • .github/workflows/publish.yml (2 hunks)
Files skipped from review due to trivial changes (5)
  • .github/workflows/build-db.yml
  • .github/workflows/build-desktop.yml
  • .github/workflows/build-docs.yml
  • .github/workflows/build-graphql.yml
  • .github/workflows/publish.yml

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between af309e2 and 8e12167.

Files selected for processing (7)
  • .github/workflows/build-db.yml (3 hunks)
  • .github/workflows/build-desktop.yml (2 hunks)
  • .github/workflows/build-docs.yml (2 hunks)
  • .github/workflows/build-graphql.yml (2 hunks)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/e2e.yml (1 hunks)
  • .github/workflows/publish.yml (2 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/build.yml
  • .github/workflows/e2e.yml
Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/build-db.yml
  • .github/workflows/build-desktop.yml
  • .github/workflows/build-docs.yml
  • .github/workflows/build-graphql.yml
  • .github/workflows/publish.yml

@findtopher
Copy link
Member Author

This change isn't going to work, the source files aren't included in the distribution - this is likely to require a bigger refactor to get the upgrades to work...

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8e12167 and 67d7d20.

Files selected for processing (1)
  • .github/workflows/build-db.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build-db.yml

@findtopher findtopher force-pushed the topher/actions/download-artifact-4 branch from 67d7d20 to 036533f Compare June 20, 2024 19:58
@@ -44,37 +44,35 @@ jobs:
run: |
cd package/db
FODB_MACHINE=arm64 FODB_SYSTEM=Darwin python -Im build
python -Im build --sdist
Copy link
Member Author

Choose a reason for hiding this comment

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

Look, I don't like this answer either, but with the new v4 'immutable artifacts' rule I don't have any other choices to create an artifact that contains the wheel and the source file...

I will happily entertain other options if you have them!

Copy link
Member Author

Choose a reason for hiding this comment

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

My assumption that the artifacts need to contain the source tar.gz and the whl are based on the artifacts in this workflow - if my assumption is wrong, that'd be swell, but 🤷

This doesn't slow down the overall tests at all, the build-db.yml workflow still finishes under 2 minutes (with comparable times from 1m42s to 2m1s) and this isn't the long pole in the tent

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 67d7d20 and 036533f.

Files selected for processing (1)
  • .github/workflows/build-db.yml (3 hunks)
Additional comments not posted (3)
.github/workflows/build-db.yml (3)

107-107: Confirm that the actions/download-artifact@v4 correctly downloads all required artifacts for the publish job without any missing or duplicate files.


72-72: Ensure that the actions/upload-artifact@v4 is compatible with all platforms specified in the matrix.

Verification successful

The verification process did not yield any specific compatibility issues with the actions/upload-artifact@v4 action across different platforms. The only relevant information found was that upload-artifact@v4 is not currently supported on GitHub Enterprise Server (GHES). Given that the workflow file specifies ubuntu-latest and ubuntu-20.04 as the matrix platforms, and no specific compatibility issues were identified for these platforms, it appears that the action should work as expected in the specified environment.

  • Matrix platforms specified in build-db.yml are ubuntu-latest and ubuntu-20.04.
  • No platform-specific compatibility issues were found in the action's documentation or source code for these platforms.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify compatibility of `actions/upload-artifact@v4` with all matrix platforms.

# Test: Search for compatibility notes in the official GitHub action documentation.
curl -s https://github.com/actions/upload-artifact/tree/v4 | grep -i "compatibility"

Length of output: 84



Script:

#!/bin/bash
# Description: Verify compatibility of `actions/upload-artifact@v4` with all matrix platforms.

# Check the official documentation for compatibility details.
curl -s https://github.com/actions/upload-artifact | grep -i "compatibility"

# Review the release notes for platform compatibility information.
curl -s https://github.com/actions/upload-artifact/releases | grep -i "compatibility"

# Check issues or discussions in the GitHub repository for any known compatibility concerns.
curl -s https://github.com/actions/upload-artifact/issues | grep -i "compatibility"

Length of output: 246



Script:

#!/bin/bash
# Description: Verify compatibility of `actions/upload-artifact@v4` with all matrix platforms.

# Step 1: Examine the build-db.yml file to understand the matrix platforms specified.
echo "Matrix platforms specified in build-db.yml:"
grep -E 'matrix:|os:|runs-on:' .github/workflows/build-db.yml

# Step 2: Search for any compatibility mentions within the action's repository using more specific queries.
echo "Searching for compatibility mentions in the action's repository:"
curl -s https://github.com/actions/upload-artifact | grep -iE "compatibility|platform|support"

# Step 3: Check for any usage examples or documentation within the repository that might indicate platform compatibility.
echo "Checking for usage examples or documentation:"
curl -s https://github.com/actions/upload-artifact/tree/v4 | grep -i "example"

# Step 4: Review the action's source code to look for any platform-specific code or comments.
echo "Reviewing the action's source code for platform-specific code or comments:"
curl -s https://raw.githubusercontent.com/actions/upload-artifact/v4/action.yml | grep -iE "platform|os|windows|linux|macos"

Length of output: 182985


86-86: Verify that the actions/download-artifact@v4 correctly handles the artifacts for the sdist platform, especially since the upload is run twice when matrix.platform == 'sdist'.

Verification successful

The build-db.yml workflow file includes steps to handle artifacts for the sdist platform using actions/download-artifact@v4. The sdist platform is built and uploaded as an artifact, and this artifact is downloaded in both the test and publish jobs. The artifact handling appears to be configured correctly.

  • The build job has a step to upload artifacts with the name dist-${{ matrix.platform }}.
  • The test job downloads the dist-sdist artifact for testing.
  • The publish job downloads all artifacts for publishing.

No issues were found with the artifact handling for the sdist platform.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify handling of artifacts for `sdist` platform with `actions/download-artifact@v4`.

# Test: Check for special conditions or configurations needed for `sdist` in the action's documentation.
curl -s https://github.com/actions/download-artifact/tree/v4 | grep -i "sdist"

Length of output: 78



Script:

#!/bin/bash
# Description: Check the `build-db.yml` workflow for any `sdist` related configurations or conditions.

# Search for `sdist` in the `build-db.yml` file to identify relevant configurations.
fd build-db.yml | xargs grep -i 'sdist'

Length of output: 39



Script:

#!/bin/bash
# Description: Output the contents of the `build-db.yml` file to understand the context and usage of `actions/download-artifact@v4`.

# Display the contents of the `build-db.yml` file.
fd build-db.yml | xargs cat

Length of output: 29



Script:

#!/bin/bash
# Description: List all files in the repository to confirm the existence and path of the `build-db.yml` file.

# List all files in the repository.
fd

Length of output: 131414



Script:

#!/bin/bash
# Description: List all `.yml` files in the `.github/workflows/` directory to confirm the absence of `build-db.yml` and identify any other relevant workflow files.

# List all `.yml` files in the `.github/workflows/` directory.
fd .yml .github/workflows/

Length of output: 366



Script:

#!/bin/bash
# Description: Output the contents of the `build-db.yml` file to understand the context and usage of `actions/download-artifact@v4`.

# Display the contents of the `build-db.yml` file.
cat .github/workflows/build-db.yml

Length of output: 3669

@findtopher
Copy link
Member Author

I will have to manually merge this into teams; I'd like to get a squash commit before I do that to make the cherry-pick easier.

On the teams side I'll git mv the conflicting build-graphql.yml (which doesn't seem to have run in the fiftyone repo for the past 9 months) into the disabled_workflows folder so future changes merge in nicer.

@findtopher
Copy link
Member Author

The only failed test here is the PR-creation, which I have done manually here to get around a bone-headed move I made last September.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 036533f and 34edc6f.

Files selected for processing (1)
  • .github/workflows/build-db.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build-db.yml

@findtopher findtopher changed the title Topher/actions/download artifact 4 upgrade upload-artifact and download-artifact to v4 Jun 20, 2024
@findtopher findtopher changed the title upgrade upload-artifact and download-artifact to v4 upgrade upload-artifact and download-artifact actions to v4 Jun 20, 2024
Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

LGTM! 🙇

@findtopher findtopher merged commit b46983b into develop Jun 21, 2024
24 of 25 checks passed
@findtopher findtopher deleted the topher/actions/download-artifact-4 branch June 21, 2024 14:03
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