-
Notifications
You must be signed in to change notification settings - Fork 66
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
chore: add CRDs file to release assets #1099
Conversation
WalkthroughThe pull request introduces enhancements to the EMQX Operator's release workflow and CRD generation script. The Changes
Poem
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: 0
🧹 Nitpick comments (2)
.github/workflows/release.yml (2)
41-44
: Add validation for the generated CRDs file.While the CRDs generation step is correctly implemented, consider adding validation to ensure the generated file is not empty and contains valid YAML.
- name: Generate CRDs file run: | make kustomize ./bin/kustomize build ./config/crd > crds.yaml + # Validate the generated file + if [ ! -s crds.yaml ]; then + echo "Error: Generated crds.yaml is empty" + exit 1 + fi + # Verify YAML validity + yq eval 'true' crds.yaml > /dev/null
89-89
: Consider adding explicit step dependency for the release step.While the changes are correct, consider adding an
id
to the CRDs generation step and making the release step depend on it usingneeds
to ensure proper sequencing.- name: Generate CRDs file + id: generate_crds run: | make kustomize ./bin/kustomize build ./config/crd > crds.yaml # ... other steps ... - uses: softprops/action-gh-release@v2 + needs: generate_crds with: tag_name: ${{ env.GIT_TAG }}Also applies to: 103-104
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/release.yml
(3 hunks)deploy/charts/emqx-operator/Chart.yaml
(1 hunks)scripts/gen-helm-crds.sh
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- scripts/gen-helm-crds.sh
- deploy/charts/emqx-operator/Chart.yaml
⏰ Context from checks skipped due to timeout of 90000ms (30)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, false)
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, false)
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml...
- GitHub Check: upgrade (EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml)
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml...
- GitHub Check: upgrade (EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml)
- GitHub Check: upgrade (EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml)
- GitHub Check: unit-test
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml...
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml...
- GitHub Check: upgrade (EmqxBroker, emqx, config/samples/emqx/v1beta3/emqxbroker-slim.yaml)
- GitHub Check: lint
🔇 Additional comments (1)
.github/workflows/release.yml (1)
85-85
: LGTM! Proper update to GitHub Actions output syntax.The change correctly implements the new recommended approach for setting outputs in GitHub Actions, replacing the deprecated
::set-output
syntax with$GITHUB_OUTPUT
.Also applies to: 87-87
Signed-off-by: Rory Z <16801068+Rory-Z@users.noreply.github.com>
3d2e8f2
to
4e91eb5
Compare
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
🧹 Nitpick comments (2)
.github/workflows/release.yml (2)
41-44
: Add error handling and validation for CRDs generation.The CRDs generation step could be more robust with:
- Error handling for the
make kustomize
command- Validation of the generated CRDs file
Consider updating the step with this implementation:
- name: Generate CRDs file run: | + set -e make kustomize + if [ ! -f "./bin/kustomize" ]; then + echo "Error: kustomize binary not found" + exit 1 + fi ./bin/kustomize build ./config/crd > crds.yaml + if [ ! -s crds.yaml ]; then + echo "Error: Generated CRDs file is empty" + exit 1 + fi + # Basic YAML validation + cat crds.yaml | grep -q "kind: CustomResourceDefinition" || (echo "Error: Invalid CRDs file"; exit 1)
89-89
: Consider adding cleanup step for generated files.Good update to the latest release action version and proper addition of the CRDs file to release assets. However, consider adding a cleanup step for the generated
crds.yaml
file.Add this step after the release:
- name: Cleanup if: always() run: rm -f crds.yamlAlso applies to: 103-104
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release.yml
(3 hunks)scripts/gen-helm-crds.sh
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- scripts/gen-helm-crds.sh
⏰ Context from checks skipped due to timeout of 90000ms (34)
- GitHub Check: e2e-test (e2e/v2beta1/e2e_rebalance_test.go)
- GitHub Check: e2e-test (e2e/v2beta1/e2e_test.go)
- GitHub Check: e2e-test (e2e/v1beta4/e2e_base_test.go)
- GitHub Check: e2e-test (e2e/v1beta4/e2e_upgrade_test.go)
- GitHub Check: e2e-test (e2e/v1beta4/e2e_blure_green_upgrade_test.go)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, false)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, true)
- GitHub Check: deployment (helm, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, false)
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (helm, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml, ...
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2beta1/emqx-full.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2beta1/emqx-slim.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml, false)
- GitHub Check: deployment (static, EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml, false)
- GitHub Check: upgrade (EMQX, emqx, config/samples/emqx/v2alpha1/emqx-full.yaml)
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-full.yaml...
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta4/emqxenterprise-slim.yaml...
- GitHub Check: unit-test
- GitHub Check: upgrade (EMQX, emqx, config/samples/emqx/v2alpha1/emqx-slim.yaml)
- GitHub Check: upgrade (EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml)
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-full.yaml...
- GitHub Check: deployment (static, EmqxEnterprise, emqx-ee, config/samples/emqx/v1beta3/emqxenterprise-slim.yaml...
- GitHub Check: upgrade (EmqxBroker, emqx, config/samples/emqx/v1beta3/emqxbroker-slim.yaml)
🔇 Additional comments (1)
.github/workflows/release.yml (1)
85-87
: LGTM! Good migration to the new output syntax.The change correctly implements the new GitHub Actions output syntax using
$GITHUB_OUTPUT
environment file, replacing the deprecated::set-output
command.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1099 +/- ##
==========================================
- Coverage 76.32% 76.24% -0.09%
==========================================
Files 69 69
Lines 6246 6246
==========================================
- Hits 4767 4762 -5
- Misses 1242 1246 +4
- Partials 237 238 +1 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
crds.yaml
as a release assetChores
softprops/action-gh-release@v2
$GITHUB_OUTPUT