-
Notifications
You must be signed in to change notification settings - Fork 3
Fix the Helm version fetcher with the corrected paths to the chart #159
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
Conversation
📝 WalkthroughWalkthroughThis pull request adds comprehensive test coverage for the Helm version fetching functionality, updates the Chart.yaml file path in the implementation from Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
✅ Deploy Preview for docs-extensions-and-macros ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
__tests__/extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.test.js(1 hunks)extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js(1 hunks)package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Redirect rules - docs-extensions-and-macros
- GitHub Check: Header rules - docs-extensions-and-macros
- GitHub Check: Pages changed - docs-extensions-and-macros
- GitHub Check: test-property-extractor (3.11)
- GitHub Check: test-property-extractor (3.9)
🔇 Additional comments (10)
package.json (1)
3-3: LGTM! Appropriate version bump for bug fix.The patch version increment from 4.12.5 to 4.12.6 correctly follows semantic versioning for a bug fix.
__tests__/extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.test.js (9)
6-12: LGTM! Clean mock setup.The mock GitHub client is properly structured and reset before each test.
14-45: LGTM! Comprehensive test for stable release fetching.The test properly validates:
- Chart version extraction from YAML
- Branch name construction (v25.1.3 → release/v25.1.x)
- API call parameters including the corrected path
- Null handling for beta when not provided
47-79: LGTM! Excellent coverage of parallel fetching.The test correctly validates:
- Parallel fetching of stable and beta versions using
Promise.all- Multiple API responses with
mockResolvedValueOnce- Both versions are extracted and returned correctly
- Appropriate call count verification
81-107: LGTM! Good coverage of version format compatibility.The test ensures backward compatibility with older version formats (v2.x.x), verifying the branch name is correctly constructed as release/v2.4.x.
109-121: LGTM! Proper input validation testing.The test correctly validates that invalid tag formats are rejected early without making unnecessary API calls, which is good for performance and error handling.
123-138: LGTM! Robust error handling test.The test ensures graceful degradation when the GitHub API fails, returning null values instead of throwing errors. This is appropriate for a version fetcher that should fail gracefully.
140-160: LGTM! Good edge case coverage.The test validates handling of Chart.yaml files missing the version field, ensuring the function returns null rather than throwing an error.
162-189: LGTM! Proper beta tag handling.The test verifies that beta tags with
-betasuffixes are correctly parsed, with the suffix stripped when constructing the branch name (v25.2.1-beta1 → release/v25.2.x).
191-203: LGTM! Complete null parameter handling.The test ensures that null or undefined parameters are handled gracefully with early returns, avoiding unnecessary API calls and returning appropriate null values.
extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js
Show resolved
Hide resolved
micheleRP
left a 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.
lgtm
This pull request introduces a new test suite for the
get-latest-redpanda-helm-version-from-operatormodule, updates the path used to fetch the Helm chart YAML file, and bumps the package version. The main focus is on improving the reliability and coverage of the version-fetching logic by thoroughly testing various scenarios.Testing improvements
getLatestHelmVersioncovering stable and beta release fetching, different version formats, error handling, missing fields, and edge cases in__tests__/extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.test.js.Bug fixes
charts/redpanda/Chart.yamltocharts/redpanda/chart/Chart.yamlinget-latest-redpanda-helm-version-from-operator.jsto match the actual repository structure.Maintenance
package.jsonfrom4.12.5to4.12.6.