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

Small workflow updates #5

Merged
merged 5 commits into from
Sep 17, 2024
Merged

Small workflow updates #5

merged 5 commits into from
Sep 17, 2024

Conversation

ausias-armesto
Copy link
Contributor

@ausias-armesto ausias-armesto commented Sep 17, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a publish job to enhance the CI/CD pipeline.
  • Improvements

    • Enhanced flexibility in Node.js version management and Docker image tagging using variables.
    • Updated team reviewer assignments for code reviews.
  • Bug Fixes

    • Improved reliability and performance in retrieving pull request versions.

@ausias-armesto ausias-armesto self-assigned this Sep 17, 2024
Copy link

coderabbitai bot commented Sep 17, 2024

Warning

Rate limit exceeded

@ausias-armesto has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 16 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 7bd2bfc and 615f64b.

Walkthrough

Walkthrough

The changes in this pull request enhance the CI/CD workflows by introducing a structured approach that separates the build and publish processes. The workflows now utilize variables for configuration, allowing for greater flexibility in managing Node.js versions and Docker image tagging. The build job employs a matrix strategy for testing across multiple Node.js versions, while the publish job integrates steps for GCP credentials and Docker Buildx setup. Additionally, team reviewer assignments have been updated to reflect current responsibilities.

Changes

File Path Change Summary
.github/workflows/build.yaml - Added publish job.
- Modified build job to use a matrix strategy for node-version.
- Updated Docker image tagging to use variables.
.github/workflows/merge.yaml - Modified node-version to use a variable.
- Updated Docker image tags to use variables instead of hardcoded values.
.github/workflows/release.yaml - Modified node-version to use a variable.
- Updated Docker image tags to use variables.
- Changed team reviewer assignment.
- Updated notification message to reflect variable usage.

Possibly related PRs

  • Fix release pipeline #4: The changes in the .github/workflows/release.yaml file involve modifications to the Node.js version setup and Docker image tagging, which are also addressed in the main PR, indicating a related focus on improving the CI/CD workflow.

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>, please review it.
    -- 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 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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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

@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: 1

Outside diff range and nitpick comments (1)
.github/workflows/build.yaml (1)

44-58: The steps for checking out the repository, setting up GCP credentials, and configuring Docker Buildx are essential for the publishing process.

The use of the self-hosted-hoprnet-small label suggests that a custom self-hosted runner is being used. To suppress the false positive from the static analysis tool, consider adding the custom label to the actionlint.yaml config file.

To suppress the false positive from the static analysis tool, add the custom label to the actionlint.yaml config file:

# actionlint.yaml
labels:
  - self-hosted-hoprnet-small
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 470726e and 3b4f4a4.

Files selected for processing (3)
  • .github/workflows/build.yaml (2 hunks)
  • .github/workflows/merge.yaml (2 hunks)
  • .github/workflows/release.yaml (5 hunks)
Additional context used
actionlint
.github/workflows/build.yaml

14-14: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


41-41: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


61-61: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting

(shellcheck)

Additional comments not posted (12)
.github/workflows/merge.yaml (3)

27-27: LGTM!

Using a variable for the Node.js version is a great way to improve the configurability and maintainability of the workflow. This allows for easier updates to the Node.js version without modifying the workflow file directly.


39-39: Verify the Kubernetes driver setup.

Setting the driver to kubernetes for the Docker Buildx setup seems to be specific to the self-hosted runner environment. Please ensure that the Kubernetes driver is properly configured and functional in the runner environment.


44-45: LGTM!

Setting push to true ensures that the built Docker image is pushed to the registry, which is essential for the workflow's purpose.

Using variables for the Docker image registry and name is an excellent way to improve the flexibility and maintainability of the workflow. This allows for dynamic configuration and promotes better practices for managing environment-specific settings.

.github/workflows/build.yaml (4)

12-17: Great job introducing a matrix strategy for testing across multiple Node.js versions!

The matrix strategy is a best practice for ensuring compatibility and catching potential issues across different Node.js versions. The selected versions (20.x, 21.x, and 22.x) cover a reasonable range of recent releases.

Tools
actionlint

14-14: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


25-25: Excellent use of the matrix node-version for the Setup Node.js step!

By dynamically using the node-version from the matrix, you ensure that each build job runs with the correct Node.js version. This change aligns perfectly with the matrix strategy introduced earlier.


39-42: Excellent separation of the publish job from the build job!

Splitting the publish process into a separate job that depends on the build job is a great practice for modularity and separation of concerns. The needs: build configuration ensures that the publish job only runs if the build job succeeds, preventing the publishing of broken builds.

Tools
actionlint

41-41: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


68-69: Excellent use of variables for the Docker image registry and name!

Using ${{ vars.DOCKER_IMAGE_REGISTRY }} and ${{ vars.DOCKER_IMAGE_NAME }} for the Docker image tagging makes the configuration more flexible and maintainable. This allows for easy customization of the Docker image tagging without modifying the workflow file.

.github/workflows/release.yaml (5)

32-32: LGTM!

Using a variable for the Node.js version is a good practice. It allows for easier management of the version without modifying the workflow file.


44-44: Please verify if setting the driver to kubernetes is intentional.

The change to set the driver for Docker Buildx setup to kubernetes is not mentioned in the list of alterations or the summary. Please confirm if this change is intended and if it has any impact on the workflow.


73-74: LGTM!

Using variables for the Docker image registry and name is a good practice. It allows for easier management of the image configuration without modifying the workflow file.


95-95: LGTM!

Updating the team-reviewers to @hoprnet/hopr-products-team reflects the current team responsible for code reviews.


107-107: LGTM!

Using the variable ${{ vars.DOCKER_IMAGE_NAME }} in the notification message is a good practice. It ensures that the message reflects the current Docker image name.

.github/workflows/build.yaml Show resolved Hide resolved
Copy link
Member

@esterlus esterlus left a comment

Choose a reason for hiding this comment

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

Can you add some info about Deployment to the README?

.github/workflows/build.yaml Outdated Show resolved Hide resolved
Copy link
Member

@esterlus esterlus 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

@ausias-armesto ausias-armesto merged commit a8a894f into main Sep 17, 2024
4 checks passed
@ausias-armesto ausias-armesto deleted the ausias/node-matrix branch September 18, 2024 07:09
@coderabbitai coderabbitai bot mentioned this pull request Sep 18, 2024
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