-
Notifications
You must be signed in to change notification settings - Fork 6
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
Unify workflows #661
Unify workflows #661
Conversation
WalkthroughWalkthroughThe changes involve the removal of a GitHub Action for building the RPCh monorepo and the introduction of multiple new workflows for building, merging, and deploying applications. A README file for workflows was added to document these processes. Additionally, several files were updated for better readability and to disable certain tests due to dependencies. The Changes
Possibly related PRs
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range and nitpick comments (6)
.github/workflows/deploy.yaml (2)
1-38
: LGTM!The GitHub Actions workflow for deploying to a staging environment follows best practices and automates the deployment process effectively. The use of
concurrency
andgoogle-credentials
secret is a good way to ensure that deployments are safe and consistent.Consider adding a comment to document the purpose and configuration of the
self-hosted-hoprnet-small
runner label, as it's a custom label that may not be immediately clear to other developers.Tools
actionlint
19-19: 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)
19-19
: Document the custom runner label in theactionlint.yaml
config file.The static analysis tool
actionlint
flagged theself-hosted-hoprnet-small
runner label as unknown. If it's a custom label for a self-hosted runner, you can suppress this warning by adding the label to the list of available labels in theactionlint.yaml
config file.Tools
actionlint
19-19: 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)
package.json (1)
21-21
: Tests disabled due to PostgreSQL dependencyI understand that the tests have been disabled due to their dependency on PostgreSQL. It's important to have a robust test suite to catch potential bugs and regressions.
Please consider creating a task or issue to track the progress of reimplementing the tests with proper mocking. This will ensure that the tests are reliable and not dependent on external factors.
If you need any assistance in reimplementing the tests with proper mocking, please let me know. I'd be happy to help!
.github/workflows/build.yaml (1)
42-43
: Address the TODO comment.The TODO comment indicates a pending task to update the
ethers
dependency to v6 in the RPCh SDK. This update seems necessary to remove theignore-path
option in thedepcheck
command.Do you want me to create a new issue to track this task, or would you like me to submit a separate PR with the necessary changes?
.github/workflows/release.yaml (2)
66-70
: Minor shellcheck issue flagged.Setting the release version based on the current
package.json
version is a good practice.However, shellcheck flagged a minor issue with the
jq
command. To prevent potential word splitting issues, double quote thejq
command:- PACKAGE_VERSION=$(jq -r '.version' apps/${{ inputs.project }}/package.json) + PACKAGE_VERSION=$(jq -r '.version' "apps/${{ inputs.project }}/package.json")Tools
actionlint
68-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
85-90
: Minor shellcheck issue flagged.Bumping the version based on the
release_type
input is a good practice for incrementing the version after a release.However, shellcheck flagged a minor issue with the
npm version
command. To prevent potential word splitting issues, double quote the command:- npm version ${{ inputs.release_type }} -w apps/${{ inputs.project }} --no-git-tag-version + npm version "${{ inputs.release_type }}" -w "apps/${{ inputs.project }}" --no-git-tag-versionTools
actionlint
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- .github/actions/build-rpch/action.yml (0 hunks)
- .github/workflows/README.md (1 hunks)
- .github/workflows/build.yaml (1 hunks)
- .github/workflows/deploy.yaml (1 hunks)
- .github/workflows/merge.yaml (1 hunks)
- .github/workflows/release.yaml (1 hunks)
- .gitignore (1 hunks)
- .prettierignore (1 hunks)
- README.md (1 hunks)
- examples/ethers/src/index.ts (1 hunks)
- package.json (1 hunks)
- packages/sdk/src/index.ts (1 hunks)
Files not reviewed due to no reviewable changes (1)
- .github/actions/build-rpch/action.yml
Files skipped from review due to trivial changes (1)
- packages/sdk/src/index.ts
Additional context used
actionlint
.github/workflows/build.yaml
19-19: 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)
53-53: 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)
80-80: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
100-100: reusable workflow call ".github/workflows/deploy.yaml" at "uses" is not following the format "owner/repo/path/to/workflow.yml@ref" nor "./path/to/workflow.yml". see https://docs.github.com/en/actions/learn-github-actions/reusing-workflows for more details
(workflow-call)
.github/workflows/deploy.yaml
19-19: 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)
.github/workflows/merge.yaml
17-17: 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)
54-54: reusable workflow call ".github/workflows/deploy.yaml" at "uses" is not following the format "owner/repo/path/to/workflow.yml@ref" nor "./path/to/workflow.yml". see https://docs.github.com/en/actions/learn-github-actions/reusing-workflows for more details
(workflow-call)
.github/workflows/release.yaml
31-31: 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-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
LanguageTool
README.md
[uncategorized] ~65-~65: Possible missing comma found.
Context: ...ployment process To contribute to this repository you will need to create a pull request....(AI_HYDRA_LEO_MISSING_COMMA)
Additional comments not posted (19)
.prettierignore (2)
1-1
: LGTM!The comment provides useful context about the origin of the file.
2-2
: LGTM!The pattern correctly excludes GitHub Actions credential files from formatting by Prettier. This is a good practice to avoid accidentally formatting and modifying sensitive files.
.gitignore (1)
54-56
: LGTM!The new entry in the
.gitignore
file is a good addition to prevent sensitive credential files from being accidentally committed to the repository. The pattern is specific enough to only match the intended files..github/workflows/README.md (1)
1-26
: LGTM!The README file provides clear and concise documentation for the GitHub workflows used in the project. The content is well-structured and easy to understand.
Great job on adding this documentation!
.github/workflows/merge.yaml (4)
3-13
: LGTM!The workflow trigger and concurrency settings are correctly configured to run the workflow when a PR is merged to main and prevent multiple merge workflows from running simultaneously.
27-41
: LGTM!The checkout and setup steps are correctly configured:
- The repository is checked out using actions/checkout@v4.
- GCP is set up using the custom action hoprnet/hopr-workflows/actions/setup-gcp@master with the required credentials secret.
- Docker Buildx is set up using docker/setup-buildx-action@v3 with the Kubernetes driver.
42-50
: LGTM!The build and push step is correctly configured:
- It uses docker/build-push-action@v6 to build and push Docker images.
- The images are pushed to the registry defined in the DOCKER_IMAGE_REGISTRY variable, allowing flexibility in the registry choice.
- The images are tagged with the project name and "staging" and "latest" tags, following common practices.
15-25
: Verify the self-hosted runner label.The merge job and matrix strategy look good. However, please ensure that the runner label "self-hosted-hoprnet-small" is correctly set up for the self-hosted runner.
To verify the runner label, run the following script:
If the script returns the runner details, the label is set up correctly. If it returns an empty result, please set up the label in the repository's Actions settings or update the workflow to use an existing label.
Verification successful
The "self-hosted-hoprnet-small" runner label is verified and approved.
The "self-hosted-hoprnet-small" runner label is consistently used across multiple workflow files in the repository, including build, deploy, merge, and release workflows. This consistent usage indicates that the label is intentional and likely set up correctly for your self-hosted runner.
- Found in build.yaml, deploy.yaml, merge.yaml, and release.yaml
- Used alongside other runner labels like "self-hosted" and "ubuntu-latest"
The original concern about the unknown runner label can be considered resolved. The widespread use of this label across different workflows suggests it's a valid and functioning runner configuration for your repository.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the runner label "self-hosted-hoprnet-small" is set up correctly. # Test: Search for the runner label in the repository's Actions settings. gh api repos/${{ github.repository }}/actions/runners -q '.runners[] | select(.labels[] | contains("self-hosted-hoprnet-small"))'Length of output: 112
Script:
#!/bin/bash # Search for the "self-hosted-hoprnet-small" label in all workflow files echo "Searching for 'self-hosted-hoprnet-small' in workflow files:" grep -r "self-hosted-hoprnet-small" .github/workflows/ echo "\nListing all unique 'runs-on' values in workflow files:" grep -hr "runs-on:" .github/workflows/ | sort | uniqLength of output: 899
Tools
actionlint
17-17: 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)
examples/ethers/src/index.ts (1)
11-14
: LGTM!The constructor parameters have been reformatted for improved readability. This change enhances the clarity of the constructor's signature without altering the functionality or logic of the class.
.github/workflows/build.yaml (2)
19-19
: Verify the custom self-hosted runner label.The
self-hosted-hoprnet-small
label is not a standard label for GitHub-hosted runners. If it is a custom label for a self-hosted runner, ensure that it is properly configured and added to theactionlint.yaml
config file to avoid therunner-label
warning from the actionlint static analysis tool.Also applies to: 53-53
Tools
actionlint
19-19: 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)
48-49
: Consider enabling the E2E tests.The E2E tests are currently commented out. If they are disabled due to some issues or missing dependencies, consider fixing those and re-enabling the tests to ensure the end-to-end functionality of the applications.
.github/workflows/release.yaml (5)
3-23
: LGTM!The manual trigger with
release_type
andproject
inputs provides the necessary flexibility to close releases. The input options cover the required release types and projects.
28-53
: LGTM!The job configuration looks good. Using a self-hosted runner and custom actions for setup is a great way to control the execution environment and promote reuse.
The unknown runner label flagged by actionlint is likely a false positive as
self-hosted-hoprnet-small
is probably a custom label for the self-hosted runner.Tools
actionlint
31-31: 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)
54-64
: LGTM!Running
build
,lint
,format
, andtest
ensures the code is in a good state before creating a release.
72-83
: Clarify the need for creating a GitHub release.The Docker image build and push step looks good.
However, the step to create a GitHub release is commented out. Is creating a GitHub release not needed for this workflow, or is it something you plan to add later? Please clarify the intended behavior.
100-110
: Clarify the need for Zulip notification.Committing the version bump changes to a new branch using
EndBug/add-and-commit
action is a good way to keep the main branch clean.However, the step to notify about the new release on Zulip is commented out. Is sending a Zulip notification not needed for this workflow, or is it something you plan to add later? Please clarify the intended behavior.
README.md (3)
63-63
: LGTM!The change in the section header from "Deployment" to "Deployment process" is appropriate, as it indicates a more detailed explanation of the deployment process.
65-65
: LGTM!The change streamlines the contribution process by directing contributors to create a pull request. The reference to the separate README file for automated workflows is helpful for providing more detailed information.
The static analysis hint suggesting a possible missing comma is a false positive. The sentence structure is correct and does not require a comma.
Tools
LanguageTool
[uncategorized] ~65-~65: Possible missing comma found.
Context: ...ployment process To contribute to this repository you will need to create a pull request....(AI_HYDRA_LEO_MISSING_COMMA)
69-69
: LGTM!The simplification of the staging deployment instructions makes the process more straightforward for contributors. Tagging the pull request with
deploy_staging
is a clear and concise instruction for triggering the staging deployment.
There was a problem hiding this 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
Outside diff range and nitpick comments (3)
.github/workflows/build.yaml (3)
48-50
: Consider enabling the E2E tests.The E2E tests are currently commented out. Consider enabling them to improve the coverage and reliability of the workflow.
19-19
: Configure actionlint to include the custom runner label.The static analysis hint indicates that the runner label "self-hosted-hoprnet-small" is unknown to actionlint. To avoid this false positive, consider configuring the actionlint configuration file to include the custom runner label.
Tools
actionlint
19-19: 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)
1-103
: Comprehensive and well-structured CI/CD workflow.The workflow defines a comprehensive CI/CD pipeline for building, publishing, and deploying applications. It follows a logical structure and separates concerns into distinct jobs. The use of self-hosted runners, matrix strategies, and reusable workflows allows for customization, efficiency, and maintainability.
However, there are a few areas for improvement:
- Address the TODO comment and consider enabling the E2E tests.
- Fix the shellcheck issue in the script that gets the PR version.
- Update the reusable workflow call format to follow the supported syntax.
Prioritizing these improvements will further enhance the reliability and effectiveness of the workflow.
Tools
actionlint
19-19: 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)
53-53: 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)
80-80: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/build.yaml (1 hunks)
- .github/workflows/merge.yaml (1 hunks)
Additional context used
actionlint
.github/workflows/build.yaml
19-19: 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)
53-53: 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)
80-80: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/merge.yaml
17-17: 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)
Additional comments not posted (9)
.github/workflows/merge.yaml (2)
17-17
: Verify the usage of the self-hosted runner.The job is using the
self-hosted-hoprnet-small
runner label which is not a standard GitHub-hosted runner. While self-hosted runners provide more flexibility, they also require additional maintenance and security considerations.Please ensure that the self-hosted runner is properly set up and maintained to avoid any potential issues or security risks.
Tools
actionlint
17-17: 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)
51-57
: LGTM!The
deploy
job is correctly calling a reusable workflow and passing the required input and secrets. This is a good practice for code reuse and maintainability..github/workflows/build.yaml (7)
17-47
: Appropriate use of self-hosted runner and matrix strategy.The use of a self-hosted runner for the build job allows for customization and control over the build environment. The matrix strategy ensures that the project is built and tested with multiple Node.js versions, improving compatibility and catching potential issues.
Tools
actionlint
19-19: 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-43
: Address the TODO comment.Please ensure that the TODO comment regarding updating ethers to v6 in RPCh SDK is addressed and the
ignore-path
is removed accordingly.
51-94
: Effective use of self-hosted runner and matrix strategy for publishing.The use of a self-hosted runner for the publish job allows for customization and control over the publishing environment. The matrix strategy enables efficient publishing of multiple projects.
Tools
actionlint
53-53: 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)
80-80: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
91-94
: Effective use of conditional staging tagging.The staging tagging step allows for conditional deployment to a staging environment based on the presence of a specific label. This is an effective way to control when and how the images are promoted to staging.
80-80
: Fix the shellcheck issue.The shellcheck static analysis tool reported an issue in line 80:
SC2086:info:2:36: Double quote to prevent globbing and word splitting
To fix this, wrap the
${{ matrix.project }}
variable in double quotes:- PR_VERSION=$(jq -r '.version' apps/${{ matrix.project }}/package.json)-pr."${{ github.event.pull_request.number }}" + PR_VERSION=$(jq -r '.version' apps/"${{ matrix.project }}"/package.json)-pr."${{ github.event.pull_request.number }}"Tools
actionlint
80-80: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
96-103
: Effective use of conditional triggering and reusable workflow.The conditional triggering of the deploy job based on the presence of a specific label allows for controlled deployment to the staging environment. The use of a reusable workflow promotes code reuse and maintainability. Passing the pull request branch as an input to the reusable workflow allows for dynamic configuration based on the PR context.
100-100
: Fix the reusable workflow call format.The actionlint static analysis tool reported an issue in line 100:
reusable workflow call ".github/workflows/deploy.yaml" at "uses" is not following the format "owner/repo/path/to/workflow.yml@ref" nor "./path/to/workflow.yml". see https://docs.github.com/en/actions/learn-github-actions/reusing-workflows for more details
To fix this, update the
uses
attribute to follow one of the supported formats:
owner/repo/path/to/workflow.yml@ref
for calling a workflow from a different repository./path/to/workflow.yml
for calling a workflow from the same repositoryFor example, if the
deploy.yaml
workflow is in the same repository:- uses: .github/workflows/deploy.yaml + uses: ./.github/workflows/deploy.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Outside diff range and nitpick comments (2)
.github/workflows/deploy.yaml (2)
11-13
: LGTM: Concurrency settings are appropriate.The concurrency configuration effectively prevents multiple deployments from running simultaneously and ensures only the latest deployment proceeds. This is a good practice for avoiding conflicts and resource waste.
Consider adding a more specific group name, such as
${{ github.workflow }}-${{ github.ref }}
, to allow concurrent deployments for different branches if needed in the future:concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
38-38
: Add a newline at the end of the file.While not critical, it's a common convention to end files with a newline. This can help prevent issues with certain tools and improve compatibility.
Add a newline at the end of the file.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/deploy.yaml (1 hunks)
- .github/workflows/release.yaml (1 hunks)
Additional context used
actionlint
.github/workflows/deploy.yaml
19-19: 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)
.github/workflows/release.yaml
31-31: 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-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
Additional comments not posted (6)
.github/workflows/deploy.yaml (2)
1-9
: LGTM: Workflow name and trigger are well-defined.The workflow name "Deploy" is clear and descriptive. The
workflow_call
trigger with a requiredbranch
input allows for flexible reuse of this workflow, ensuring the correct branch is always specified for deployment.
17-19
: Verify the self-hosted runner label.The job configuration is clear and well-named. However, the runner label "self-hosted-hoprnet-small" needs verification.
Please confirm that the self-hosted runner label "self-hosted-hoprnet-small" is correctly configured in your GitHub Actions environment. If it's a custom label, ensure it's properly set up and documented.
Verification successful
Self-hosted runner label "self-hosted-hoprnet-small" is consistently used across all workflows.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the self-hosted runner label. # Test: Check for any workflow files using the same runner label rg --type yaml 'runs-on:\s*self-hosted-hoprnet-small' .github/workflowsLength of output: 434
Tools
actionlint
19-19: 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)
.github/workflows/release.yaml (4)
1-22
: LGTM: Well-structured workflow triggerThe workflow name is clear, and the manual trigger with input options for release type and project selection is well-implemented. This provides flexibility and control over the release process.
24-26
: LGTM: Appropriate concurrency settingsThe concurrency settings are well-configured to prevent multiple releases from running simultaneously while ensuring that in-progress releases are not interrupted. This helps maintain consistency in the release process.
1-110
: Overall assessment: Well-structured release workflow with room for minor improvementsThis GitHub Actions workflow for releasing projects is comprehensive and well-structured. It covers all essential steps including building, testing, creating a release, pushing a Docker image, and version management. The use of manual triggers with input options provides flexibility and control over the release process.
Key strengths:
- Clear workflow structure and naming
- Comprehensive build and test process
- Proper use of secrets and environment variables
- Effective release and Docker image management
- Good commit and notification practices
Suggested improvements:
- Verify the self-hosted runner configuration
- Add dependency caching to improve workflow execution time
- Address minor shell scripting issues with proper quoting
- Consider implementing a pull request step for version bumps instead of direct commits to main
By implementing these suggestions, you can further enhance the security, efficiency, and robustness of your release process.
Tools
actionlint
31-31: 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-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
28-31
: Verify self-hosted runner configurationThe job is set to run on a self-hosted runner with the label
self-hosted-hoprnet-small
. Ensure that this runner is properly configured and available in your GitHub Actions environment.To verify the runner configuration, you can run the following command:
Replace
{owner}
and{repo}
with your GitHub username/organization and repository name, respectively. This command will return the configuration of the specified runner if it exists.Tools
actionlint
31-31: 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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will disable DP integration tests.
The previous setup was specifying a postgres service for the tests Please keep this setup or convert it to the new structure.
I added the postgres container and included the unit tests. The drawback is that we cannot use a self-hosted runner as it requires docker in docker setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (2)
.github/workflows/release.yaml (2)
1-26
: LGTM: Well-structured workflow trigger and inputsThe workflow trigger and inputs are well-defined, allowing for flexible and controlled release management. The concurrency settings prevent overlapping releases, which is crucial for maintaining consistency.
Consider renaming the workflow from "Close release" to "Create and Close Release" or "Release Workflow" to more accurately reflect its full scope of creating a release, pushing a Docker image, and bumping the version.
54-64
: LGTM: Comprehensive build and test processThe inclusion of building, linting, formatting, and testing steps ensures code quality and consistency.
Consider adding a step to cache dependencies to improve workflow execution time. You can use the
actions/cache
action for this purpose. Here's an example:- name: Cache dependencies uses: actions/cache@v3 with: path: ~/.npm key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.OS }}-node-Add this step after the "Setup Node.js" step and before the "Building" step.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- .github/workflows/build.yaml (1 hunks)
- .github/workflows/release.yaml (1 hunks)
- .github/workflows/review.yml (0 hunks)
Files not reviewed due to no reviewable changes (1)
- .github/workflows/review.yml
Additional context used
Learnings (1)
.github/workflows/release.yaml (1)
Learnt from: ausias-armesto PR: hoprnet/RPCh#661 File: .github/workflows/release.yaml:92-110 Timestamp: 2024-09-23T10:29:50.212Z Learning: Version bumps should be committed directly into the main branch, avoiding unnecessary pull requests for version changes.
actionlint
.github/workflows/build.yaml
73-73: 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)
100-100: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/release.yaml
31-31: 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-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
Additional comments not posted (8)
.github/workflows/release.yaml (3)
100-110
: LGTM: Effective release notification processThe notification step using Zulip is a great addition to keep the team informed about new releases. The use of secrets for the API key and email ensures secure communication.
85-99
:⚠️ Potential issueLGTM: Effective version bump and commit process
The version bump and commit steps are well-implemented and align with the project's preference for directly committing version changes to the main branch.
The static analysis tool flagged a potential issue with quoting in the npm version command. To address this, please update line 88 as follows:
- npm version ${{ inputs.release_type }} -w "apps/${{ inputs.project }}" --no-git-tag-version + npm version "${{ inputs.release_type }}" -w "apps/${{ inputs.project }}" --no-git-tag-versionThis change ensures proper quoting and prevents potential issues with word splitting and globbing.
As per the retrieved learning, the direct commit to the main branch for version bumps is intentional and aligns with the project's workflow preferences. This approach avoids unnecessary pull requests for version changes, which is the desired behavior.
Tools
actionlint
87-87: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
28-53
: LGTM: Comprehensive job setup with a note on runner labelThe job setup and initial steps are well-structured, using custom actions and secure practices for handling credentials.
The static analysis tool flagged an unknown runner label "self-hosted-hoprnet-small". While this may be a custom label for your self-hosted runner, it's worth verifying its existence and configuration. If it's intentional, consider documenting it in your project's README or in a comment within the workflow file for clarity.
To verify the available runners, you can run the following command in your repository:
Replace {owner} and {repo} with your GitHub username and repository name, respectively.
Tools
actionlint
31-31: 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)
.github/workflows/build.yaml (5)
21-22
: LGTM: Comprehensive Node.js version testing.The matrix strategy for Node.js versions (18.x, 20.x, 22.x) ensures compatibility across multiple versions, which is a good practice.
68-69
: Verify the status of E2E tests.The E2E tests are currently commented out. Is this intentional, or should they be enabled?
If these tests should be enabled, consider uncommenting these lines. If they're intentionally disabled, it might be helpful to add a comment explaining why.
73-73
: Verify the self-hosted runner configuration.The job is set to run on a self-hosted runner (
self-hosted-hoprnet-small
). Ensure that this runner is properly configured and available.If this is a custom label for a self-hosted runner, consider adding it to the
actionlint.yaml
config file to avoid linting warnings.Tools
actionlint
73-73: 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)
1-123
: Overall, the workflow is well-structured but has room for improvement.The workflow covers the essential steps for building, publishing, and deploying the project. However, there are a few areas that need attention:
- Verify the status of E2E tests and decide whether they should be enabled.
- Ensure the self-hosted runner is properly configured.
- Improve the PR version extraction for better security.
- Fix the reusable workflow call format.
Addressing these points will enhance the robustness and security of the workflow.
Tools
actionlint
73-73: 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)
100-100: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
120-123
:⚠️ Potential issueFix the reusable workflow call format.
The current format for calling the reusable workflow is incorrect.
Update the
uses
attribute to follow the correct format for calling a workflow from the same repository:- uses: ./.github/workflows/deploy.yaml + uses: ./.github/workflows/deploy.yamlThis change ensures that the workflow call follows the correct syntax for reusable workflows within the same repository.
- name: Setup environment variables | ||
id: environment | ||
run: | | ||
PACKAGE_VERSION=$(jq -r '.version' "apps/${{ inputs.project }}/package.json") | ||
echo "release_version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: '${{ inputs.project }} - v${{ steps.environment.outputs.release_version }}' | ||
tag_name: v${{ steps.environment.outputs.release_version }} | ||
|
||
- name: Build and push docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
file: "./apps/${{ inputs.project }}/Dockerfile" | ||
tags: ${{ vars.DOCKER_IMAGE_REGISTRY }}/${{ inputs.project }}:${{ steps.environment.outputs.release_version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: Well-implemented release creation and Docker image push
The steps for creating a GitHub release and pushing a Docker image are well-structured and use appropriate actions.
The static analysis tool flagged a potential issue with quoting in the jq command. To address this, please update line 69 as follows:
- PACKAGE_VERSION=$(jq -r '.version' "apps/${{ inputs.project }}/package.json")
+ PACKAGE_VERSION=$(jq -r '.version' "apps/${{ inputs.project }}/package.json")
This change ensures proper quoting and prevents potential issues with word splitting and globbing.
Committable suggestion was skipped due to low confidence.
Tools
actionlint
68-68: shellcheck reported issue in this script: SC2086:info:2:46: Double quote to prevent globbing and word splitting
(shellcheck)
id: variables | ||
run: | | ||
PR_VERSION=$(jq -r '.version' apps/"${{ matrix.project }}"/package.json)-pr."${{ github.event.pull_request.number }}" | ||
echo "PR_VERSION=${PR_VERSION}" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve PR version extraction for better security.
The current method of extracting the PR version could be improved to prevent potential command injection.
Consider using jq
with the --raw-output
(-r
) option and proper quoting:
- PR_VERSION=$(jq -r '.version' apps/"${{ matrix.project }}"/package.json)-pr."${{ github.event.pull_request.number }}"
+ PR_VERSION="$(jq --raw-output '.version' "apps/${{ matrix.project }}/package.json")-pr.${{ github.event.pull_request.number }}"
This change ensures proper quoting and uses the full --raw-output
option for clarity.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
id: variables | |
run: | | |
PR_VERSION=$(jq -r '.version' apps/"${{ matrix.project }}"/package.json)-pr."${{ github.event.pull_request.number }}" | |
echo "PR_VERSION=${PR_VERSION}" >> $GITHUB_OUTPUT | |
id: variables | |
run: | | |
PR_VERSION="$(jq --raw-output '.version' "apps/${{ matrix.project }}/package.json")-pr.${{ github.event.pull_request.number }}" | |
echo "PR_VERSION=${PR_VERSION}" >> $GITHUB_OUTPUT |
Tools
actionlint
100-100: shellcheck reported issue in this script: SC2086:info:2:36: Double quote to prevent globbing and word splitting
(shellcheck)
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
README.md
for clearer deployment instructions and streamlined processes.Chores
.gitignore
and.prettierignore
to exclude specific JSON files related to GitHub Actions credentials.