Skip to content

MGMT-24493: Allow HTTPS proxy for Discovery ISO#3777

Open
LiorSoffer wants to merge 2 commits into
openshift-assisted:masterfrom
LiorSoffer:proxy
Open

MGMT-24493: Allow HTTPS proxy for Discovery ISO#3777
LiorSoffer wants to merge 2 commits into
openshift-assisted:masterfrom
LiorSoffer:proxy

Conversation

@LiorSoffer

@LiorSoffer LiorSoffer commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

https://redhat.atlassian.net/browse/MGMT-24493

BE: openshift/assisted-service#10589

Summary by CodeRabbit

  • New Features

    • HTTPS proxy URLs are now supported across cluster configuration and deployment forms.
    • Added clearer static IP guidance with a link to relevant documentation.
  • Bug Fixes

    • Corrected HTTPS proxy validation so valid HTTP and HTTPS URLs are accepted consistently.
    • Updated validation messages to accurately describe supported URL formats.
    • Improved translation handling for AI-related localization keys.

@openshift-ci-robot

openshift-ci-robot commented Jun 10, 2026

Copy link
Copy Markdown

@LiorSoffer: This pull request references MGMT-24493 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 bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/MGMT-24493

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 10, 2026
@openshift-ci
openshift-ci Bot requested review from ElayAharoni and asmasarw June 10, 2026 10:07
@openshift-ci openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 10, 2026
@LiorSoffer LiorSoffer added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds dedicated HTTP/HTTPS proxy validation across multiple forms, updates localized validation messages and translation guidance, and extracts StaticIPInfo into a shared component with updated imports and exports.

Changes

HTTPS Proxy Configuration Support

Layer / File(s) Summary
Translation rules and validation messages
.cursor/rules/translations.mdc, libs/locales/lib/en/translation.json, libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
Translation guidance and English helper/error messages now describe HTTP and HTTPS URL support.
HTTPS proxy validation schema
libs/ui-lib/lib/common/validationSchemas/proxyValidation.tsx
Adds httpsProxyValidationSchema, accepting valid http:// and https:// URLs while preserving paired-field and empty-value handling.
Form validation wiring
libs/ui-lib/lib/cim/..., libs/ui-lib/lib/ocm/..., libs/ui-lib/lib/cim/components/modals/*
HTTPS proxy fields across CIM, OCM, infrastructure, hosted-cluster, discovery, and edit-proxy forms now use the dedicated schema.
StaticIPInfo component relocation
libs/ui-lib/lib/common/components/clusterConfiguration/*, libs/ui-lib/lib/cim/components/modals/*
Adds shared StaticIPInfo, updates imports and barrel exports, and removes the previous local implementation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant NetworkForm
  participant httpsProxyValidationSchema
  participant URLParser
  participant i18next
  NetworkForm->>httpsProxyValidationSchema: validate httpsProxy
  httpsProxyValidationSchema->>URLParser: parse HTTP or HTTPS URL
  httpsProxyValidationSchema->>i18next: resolve validation message
  i18next-->>NetworkForm: localized validation result
Loading

Possibly related PRs

Suggested labels: lgtm

Suggested reviewers: asmasarw, elayaharoni, jgyselov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: enabling HTTPS proxy support for Discovery ISO flows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@openshift-ci openshift-ci Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.cursor/rules/translations.mdc:
- Around line 45-48: The Trans i18nKey should be the stable translation key
string, not a localized value returned by t(), so update ProxyFields.tsx to stop
passing i18nKey={supportHttps ? t('ai:...') : t('ai:...')} and instead use
i18nKey={supportHttps ? 'ai:...' : 'ai:...'} (or compute the key string via a
small helper) and render t(...) only where you need the translated text; also
adjust the guidance in .cursor/rules/translations.mdc to reflect that Trans
expects key strings like "ai:..." and that using t() inside i18nKey will break
lookups at runtime even though parser extraction may succeed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34ce6150-9525-4c0c-b283-eee69a7cfc0e

📥 Commits

Reviewing files that changed from the base of the PR and between 691a72a and 7aafc65.

📒 Files selected for processing (6)
  • .cursor/rules/translations.mdc
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/validationSchemas/proxyValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx

Comment thread .cursor/rules/translations.mdc Outdated
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2026
@LiorSoffer LiorSoffer closed this Jul 16, 2026
@openshift-ci openshift-ci Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 16, 2026
Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
@LiorSoffer LiorSoffer reopened this Jul 16, 2026
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiorSoffer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiorSoffer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (4)
libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx (1)

67-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Wrap translation props with t().

As per coding guidelines, always wrap strings used in i18nKey or other translation props with t('ai:…'); do not use bare string literals.

However, since the Trans component from react-i18next typically relies on a static string key for extraction and rendering, please verify if dynamically resolving it with t() causes any issues.

♻️ Proposed refactor
-              i18nKey={'ai:URL must start with <bold>http</bold> or <bold>https</bold>.'}
+              i18nKey={t('ai:URL must start with <bold>http</bold> or <bold>https</bold>.')}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx` at
line 67, Update the translation prop in ProxyFields to pass the result of the
i18n translation function t() using the existing ai-prefixed key instead of a
bare string literal, while preserving the Trans component’s expected rendering
and extraction behavior.

Source: Coding guidelines

libs/ui-lib/lib/cim/components/modals/DiscoveryImageConfigForm.tsx (1)

28-31: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer the barrel for the exported clusterConfiguration components. UploadSSH, ProxyFields, and StaticIPInfo can come from libs/ui-lib/lib/common/components/clusterConfiguration; DiscoveryImageTypeControlGroup still needs its direct import unless it’s added to the barrel.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-lib/lib/cim/components/modals/DiscoveryImageConfigForm.tsx` around
lines 28 - 31, Update the imports in DiscoveryImageConfigForm to load UploadSSH,
ProxyFields, and StaticIPInfo from the clusterConfiguration barrel export. Keep
DiscoveryImageTypeControlGroup’s direct import unchanged unless it is explicitly
added to that barrel.

Source: Coding guidelines

libs/ui-lib/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx (1)

89-94: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove stale comment.

With the switch to the dedicated httpsProxyValidationSchema, the comment stating that the schema is shared because HTTPS is not supported is now outdated.

♻️ Proposed refactor
       httpsProxy: httpsProxyValidationSchema({
         values,
         pairValueName: 'httpProxy',
         allowEmpty: true,
         t,
-      }), // share the schema, httpS is currently not supported
+      }),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-lib/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx` around lines 89
- 94, Remove the stale inline comment after the httpsProxyValidationSchema
configuration in InfraEnvFormPage, leaving the dedicated HTTPS validation schema
usage unchanged.
libs/ui-lib/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx (1)

33-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove stale comment.

Since httpsProxy now uses its own dedicated validation schema and supports HTTPS URLs, the comment indicating that the schema is shared because "httpS is currently not supported" is outdated and should be removed.

♻️ Proposed refactor
-      httpsProxy: httpsProxyValidationSchema({ values, pairValueName: 'httpProxy', t }), // share the schema, httpS is currently not supported
+      httpsProxy: httpsProxyValidationSchema({ values, pairValueName: 'httpProxy', t }),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@libs/ui-lib/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx`
at line 33, Remove the stale inline comment from the httpsProxy validation
schema configuration in NetworkStep, leaving the dedicated
httpsProxyValidationSchema call and its arguments unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@libs/ui-lib/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx`:
- Line 33: Remove the stale inline comment from the httpsProxy validation schema
configuration in NetworkStep, leaving the dedicated httpsProxyValidationSchema
call and its arguments unchanged.

In `@libs/ui-lib/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx`:
- Around line 89-94: Remove the stale inline comment after the
httpsProxyValidationSchema configuration in InfraEnvFormPage, leaving the
dedicated HTTPS validation schema usage unchanged.

In `@libs/ui-lib/lib/cim/components/modals/DiscoveryImageConfigForm.tsx`:
- Around line 28-31: Update the imports in DiscoveryImageConfigForm to load
UploadSSH, ProxyFields, and StaticIPInfo from the clusterConfiguration barrel
export. Keep DiscoveryImageTypeControlGroup’s direct import unchanged unless it
is explicitly added to that barrel.

In `@libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx`:
- Line 67: Update the translation prop in ProxyFields to pass the result of the
i18n translation function t() using the existing ai-prefixed key instead of a
bare string literal, while preserving the Trans component’s expected rendering
and extraction behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c763e394-a728-4681-ab86-1fe42fb812b1

📥 Commits

Reviewing files that changed from the base of the PR and between 24f5a41 and 1ad6ed8.

📒 Files selected for processing (15)
  • .cursor/rules/translations.mdc
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/cim/components/ClusterDeployment/use-networking-formik.ts
  • libs/ui-lib/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx
  • libs/ui-lib/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx
  • libs/ui-lib/lib/cim/components/modals/AddHostModal.tsx
  • libs/ui-lib/lib/cim/components/modals/DiscoveryImageConfigForm.tsx
  • libs/ui-lib/lib/cim/components/modals/EditProxyModal.tsx
  • libs/ui-lib/lib/cim/components/modals/types.ts
  • libs/ui-lib/lib/common/components/clusterConfiguration/DownloadIso.tsx
  • libs/ui-lib/lib/common/components/clusterConfiguration/ProxyFields.tsx
  • libs/ui-lib/lib/common/components/clusterConfiguration/StaticIPInfo.tsx
  • libs/ui-lib/lib/common/components/clusterConfiguration/index.ts
  • libs/ui-lib/lib/common/validationSchemas/proxyValidation.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • .cursor/rules/translations.mdc

@LiorSoffer

Copy link
Copy Markdown
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants