Conversation
✅ Deploy Preview for docs-extensions-and-macros ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughA new module, Sequence Diagram(s)sequenceDiagram
participant Client
participant set-latest-version.js
participant GetLatestOperatorVersion
participant GetLatestHelmChartVersionFromOperator
participant GitHubAPI
Client->>set-latest-version.js: register()
set-latest-version.js->>GetLatestOperatorVersion: fetch operator version
GetLatestOperatorVersion-->>set-latest-version.js: return {stable, beta} tags
alt operator version available
set-latest-version.js->>GetLatestHelmChartVersionFromOperator: fetch Helm chart version (with operator tags)
GetLatestHelmChartVersionFromOperator->>GitHubAPI: fetch Chart.yaml from branch derived from Docker tag
GitHubAPI-->>GetLatestHelmChartVersionFromOperator: return Chart.yaml content
GetLatestHelmChartVersionFromOperator-->>set-latest-version.js: return {latestStableRelease, latestBetaRelease}
else operator version unavailable
set-latest-version.js->>set-latest-version.js: log error, set Helm chart result as rejected
end
set-latest-version.js->>Client: update latestVersions object and log result
Suggested reviewers
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js (3)
13-13: Consider adding parameter validation for repository specificity.The function accepts any repository name but the logic is specifically designed for the
redpanda-operatorrepository structure (Chart.yaml path, branch naming convention). Consider adding validation to ensure the repo parameter isredpanda-operator.module.exports = async (github, owner, repo, stableDockerTag, betaDockerTag) => { + if (repo !== 'redpanda-operator') { + throw new Error('This function is designed specifically for the redpanda-operator repository'); + } const yaml = require('js-yaml');
15-15: Consider making the Chart.yaml path configurable.The hardcoded path
charts/redpanda/Chart.yamlcreates a tight coupling to the current repository structure. Consider making this configurable to improve maintainability.module.exports = async (github, owner, repo, stableDockerTag, betaDockerTag) => { const yaml = require('js-yaml'); - const path = 'charts/redpanda/Chart.yaml'; + const path = process.env.CHART_YAML_PATH || 'charts/redpanda/Chart.yaml';
57-60: Improve error specificity for better debugging.The error handling could be more specific about the type of failure to aid in debugging.
} catch (error) { - console.error(`Failed to fetch Chart.yaml for branch ${branchName}:`, error.message); + console.error(`Failed to fetch Chart.yaml for branch ${branchName} (${error.status || 'unknown status'}):`, error.message); return null; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js(1 hunks)extensions/version-fetcher/get-latest-redpanda-helm-version.js(0 hunks)extensions/version-fetcher/set-latest-version.js(3 hunks)package.json(1 hunks)
💤 Files with no reviewable changes (1)
- extensions/version-fetcher/get-latest-redpanda-helm-version.js
🧰 Additional context used
🧬 Code Graph Analysis (1)
extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js (1)
extensions/version-fetcher/set-latest-version.js (2)
github(27-27)owner(21-21)
⏰ 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). (3)
- GitHub Check: Redirect rules - docs-extensions-and-macros
- GitHub Check: Header rules - docs-extensions-and-macros
- GitHub Check: Pages changed - docs-extensions-and-macros
🔇 Additional comments (6)
package.json (1)
3-3: Version increment looks appropriate.The patch version bump from 4.6.4 to 4.6.5 correctly reflects the refactoring changes to the Helm chart version fetching logic.
extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js (2)
29-29: Regex pattern handles expected version formats correctly.The regex pattern correctly matches both standard versions (v2.4.2) and beta versions (v25.1.3-beta), supporting the documented version formats.
68-71: Efficient concurrent fetching implementation.Using
Promise.allto fetch both stable and beta chart versions concurrently is an excellent performance optimization that reduces the total execution time.extensions/version-fetcher/set-latest-version.js (3)
7-7: Import statement is correct.The import of the new Helm chart version fetcher function is properly implemented.
44-69: Well-structured deferred fetching logic with comprehensive error handling.The approach of deferring Helm chart version fetching until after the operator version is available is logical and correctly implemented. The error handling covers both operator unavailability and Helm chart fetch failures.
134-139: Improved logging format enhances readability.The structured multiline logging format with conditional beta version information provides much better visibility into the version fetching results.
|
Caution No docstrings were generated. |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
In redpanda-data/helm-charts#1695, we moved the Redpanda Helm chart to the
redpanda-operatorrepo. As a result, this pull request updates our version fetcher extension to fetch the Helm version from that repo.This pull request introduces a significant refactor to the Helm chart version-fetching logic, replacing the previous GitHub releases-based approach with a branch-based approach derived from Docker tags. It also updates the integration of this new logic into the version-fetching workflow and improves logging for better clarity.
Refactoring Helm Chart Version Logic:
get-latest-redpanda-helm-version-from-operator.jsto fetch Helm chart versions by deriving branches from Docker tags and readingChart.yamlfiles. This replaces the previous logic that relied on GitHub releases.get-latest-redpanda-helm-version.jsthat fetched Helm chart versions based on GitHub release tags.Integration Updates:
set-latest-version.jsto replace the old Helm chart version-fetching logic with the new branch-based approach. The new logic depends on the operator version to determine stable and beta Docker tags. [1] [2]Logging Improvements:
set-latest-version.jsto provide clearer and more structured output for the latest versions of Redpanda components, including Helm charts and the operator.Miscellaneous:
package.jsonto increment the version from4.6.4to4.6.5.