-
Notifications
You must be signed in to change notification settings - Fork 7
ci: skip helm repo priming if no chart deps exist #67
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
ci: skip helm repo priming if no chart deps exist #67
Conversation
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TylerGillson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughIntroduced a pre-check in the GitHub Actions workflow step handling Helm repositories to detect zero dependencies in Chart.yaml using yq. When no dependencies are found, the step exits successfully and skips Helm repo operations; otherwise, it proceeds with the existing dependency parsing and update logic. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 1
🧹 Nitpick comments (3)
.github/workflows/test.yml (3)
114-119: Make yq null‑safe and numeric‑safeGuard against missing
.dependencies(yq can emit null) and ensure numeric comparison won’t error on empty/non‑numeric values.Apply this diff:
- dependency_count=$(yq eval '.dependencies | length' ${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml) - if [[ "$dependency_count" -lt 1 ]]; then + dependency_count=$(yq eval '.dependencies // [] | length' "${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml") + if [[ ${dependency_count:-0} -eq 0 ]]; then echo "No dependencies found in Chart.yaml. Skipping helm repo operations." exit 0 fi
113-113: Harden the shell: fail the pipeline on pipe errorsAdd pipefail so failures in the yq/while pipeline don’t get masked.
Apply this diff:
- + set -o pipefail
120-127: Minor robustness: safe read and quoting
- Use
IFS= read -rto avoid trimming/escape issues.- Quote path arguments for safety.
Apply this diff:
- yq eval '.dependencies[] | .name + " " + .repository' ${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml | while read -r repo_name repo_url; do + yq eval '.dependencies[] | .name + " " + .repository' "${{ inputs.repo }}/charts/${{ inputs.repo }}/Chart.yaml" | while IFS= read -r repo_name repo_url; do
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/test.yml(1 hunks)
🔇 Additional comments (1)
.github/workflows/test.yml (1)
108-131: Change intent LGTM; avoids unnecessary Helm opsEarly‑exit when no deps is a good CI speedup and reduces flakiness.
Please confirm that all charts under
charts/follow the${{ inputs.repo }}subdir convention; otherwise this step won’t prime repos for other chart names.
|
/lgtm |
379bb9d
into
open-cluster-management-io:main
Summary by CodeRabbit