Skip to content

Conversation

@JakeSCahill
Copy link
Contributor

This pull request introduces a new test suite for the get-latest-redpanda-helm-version-from-operator module, 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

  • Added comprehensive unit tests for getLatestHelmVersion covering 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

  • Updated the chart file path from charts/redpanda/Chart.yaml to charts/redpanda/chart/Chart.yaml in get-latest-redpanda-helm-version-from-operator.js to match the actual repository structure.

Maintenance

  • Bumped the package version in package.json from 4.12.5 to 4.12.6.

@JakeSCahill JakeSCahill requested review from a team and Feediver1 December 5, 2025 17:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

📝 Walkthrough

Walkthrough

This pull request adds comprehensive test coverage for the Helm version fetching functionality, updates the Chart.yaml file path in the implementation from charts/redpanda/Chart.yaml to charts/redpanda/chart/Chart.yaml, and bumps the package version to 4.12.6. The test suite validates multiple scenarios including stable and beta release fetching, version format handling, error conditions, and parameter edge cases. No functional logic changes are introduced beyond the path update.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Test file review: Multiple test scenarios (8+ test cases) covering different code paths, mock setups, and assertions require careful validation to ensure correctness and proper coverage
  • Path constant update: Simple one-line change but should be verified that the new path is correct for the repository structure
  • Version bump: Trivial change, but confirm versioning strategy is appropriate

Possibly related PRs

Suggested reviewers

  • kbatuigas
  • paulohtb6

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: fixing the Helm version fetcher by correcting paths to the chart file.
Description check ✅ Passed The description is directly related to the changeset, covering all three main aspects: new test suite, chart path fix, and version bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-helm-fetcher

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for docs-extensions-and-macros ready!

Name Link
🔨 Latest commit 3562c79
🔍 Latest deploy log https://app.netlify.com/projects/docs-extensions-and-macros/deploys/69331627f1cde10007e1cc04
😎 Deploy Preview https://deploy-preview-159--docs-extensions-and-macros.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@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

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between d80f6ca and 3562c79.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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 -beta suffixes 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.

Copy link

@micheleRP micheleRP left a comment

Choose a reason for hiding this comment

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

lgtm

@JakeSCahill JakeSCahill merged commit 195f3ae into main Dec 5, 2025
19 checks passed
@JakeSCahill JakeSCahill deleted the fix-helm-fetcher branch December 5, 2025 17:56
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.

3 participants