RFE-7965: add basic auth support for helm repositories
related: https://issues.redhat.com/browse/HELM-585 fixes: https://issues.redhat.com/browse/RFE-7965
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
@martinszuc: This pull request references RFE-7965 which is a valid jira issue.
Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature request to target the "4.21.0" version, but no target version was set.
In response to this:
related: https://issues.redhat.com/browse/HELM-584 fixes: https://issues.redhat.com/browse/RFE-7965
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
/ok-to-test
there is an idea for feature about checking whether the basic auth secret was setup correct and contains correct values (username, password) ticket: https://issues.redhat.com/browse/HELM-586
@martinszuc: This pull request references RFE-7965 which is a valid jira issue.
In response to this:
related: https://issues.redhat.com/browse/HELM-585 fixes: https://issues.redhat.com/browse/RFE-7965
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
Walkthrough
This PR adds basic authentication support to Helm Chart Repository configuration. Changes include new type definitions for basicAuthConfig, form component updates to accept and render a namespace-scoped Secret field, validation requiring HTTPS with basic auth, utility updates for conditional config inclusion based on scope, and comprehensive test coverage.
Changes
| Cohort / File(s) | Summary |
|---|---|
Type Definitionsfrontend/packages/helm-plugin/src/types/helm-types.ts |
Added optional basicAuthConfig property to HelmChartRepositoryType.connectionConfig (with name field) and HelmChartRepositoryFormData (as string). |
Form Componentsfrontend/packages/helm-plugin/src/components/forms/HelmChartRepository/CreateHelmChartRepositoryForm.tsx,frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/CreateHelmChartRepositoryFormEditor.tsx |
Extended component props with namespace: string. Added conditional ResourceDropdownField for basicAuthConfig Secret selection when scope is ProjectHelmChartRepository. |
Form Utilitiesfrontend/packages/helm-plugin/src/components/forms/HelmChartRepository/helmchartrepository-create-utils.ts,frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/helmchartrepository-validation-utils.ts |
Updated convertToHelmChartRepository to accept optional existingRepo parameter and conditionally include basicAuthConfig based on scope. Added Yup validation requiring HTTPS when basicAuthConfig is present. |
Localizationfrontend/packages/helm-plugin/locales/en/helm-plugin.json |
Added two locale keys: "Basic authentication" and "Basic authentication requires HTTPS". |
Testsfrontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/helmchartrepository-*.ts |
Added test coverage for basicAuthConfig scope-based behavior (ProjectHelmChartRepository vs. HelmChartRepository), round-trip conversion, and sample data with basicAuthConfig. |
Estimated code review effort
๐ฏ 3 (Moderate) | โฑ๏ธ ~25 minutes
- Conditional logic for basicAuthConfig inclusion: Review the interaction between
scopeandexistingRepo.kindin determining whetherbasicAuthConfigis included in the resource spec (helmchartrepository-create-utils.ts) - HTTPS validation requirement: Verify the Yup validation rule correctly enforces HTTPS when basic authentication is configured (
helmchartrepository-validation-utils.ts) - Scope-based field visibility: Confirm the
ResourceDropdownFieldrendering logic properly checks bothformData.scopeandexistingRepo.kindforProjectHelmChartRepository(CreateHelmChartRepositoryFormEditor.tsx) - Test completeness: Verify test cases cover all scope combinations and round-trip form-to-resource conversions
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
[!TIP]
๐ Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests โ including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- ๐ Description โ Summarize the main change in 50โ60 words, explaining what was done.
- ๐ References โ List relevant issues, discussions, documentation, or related PRs.
- ๐ฆ Dependencies & Requirements โ Mention any new/updated dependencies, environment variable changes, or configuration updates.
- ๐ Contributor Summary โ Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- โ๏ธ Additional Notes โ Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Comment @coderabbitai help to get the list of available commands and usage tips.
/retest
@coderabbitai review
@webbnh: I'll review the changes in this pull request.
โ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: martinszuc, webbnh Once this PR has been reviewed and has the lgtm label, please assign jhadvig for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
/retest-required
/retest-required
/retest-required
@martinszuc: all tests passed!
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.