Skip to content

Conversation

@jhadvig
Copy link
Member

@jhadvig jhadvig commented Nov 20, 2025

Tested the change on a live cluster and worked as desired.

/assign @spadgett @JoelSpeed @everettraven

@openshift-ci-robot
Copy link

Pipeline controller notification
This repository is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger optional jobs most likely to be impacted by the proposed changes.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 20, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 20, 2025

@jhadvig: This pull request references CONSOLE-4882 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 story to target the "4.21.0" version, but no target version was set.

In response to this:

Tested the change on a live cluster and worked as desired.

/assign @spadgett @JoelSpeed

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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

This pull request expands href field validation for ConsoleLink and ConsoleNotification APIs to accept both https URLs and mailto links. Changes include updating the validation regex pattern from ^https:// to ^(https://|mailto:), updating field descriptions, regenerating CRD manifests, updating generated documentation, and adding test coverage for mailto support.

Changes

Cohort / File(s) Summary
Source Code Validation
console/v1/types.go
Updated Link.Href field validation pattern from ^https:// to `^(https://
CRD Manifests
console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml, console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml
Updated ConsoleLink and ConsoleNotification CRD schema definitions to allow mailto links in addition to https URLs; pattern updated to `^(https://
Feature-Gated CRD Manifests
console/v1/zz_generated.featuregated-crd-manifests/consolelinks.console.openshift.io/AAA_ungated.yaml, console/v1/zz_generated.featuregated-crd-manifests/consolenotifications.console.openshift.io/AAA_ungated.yaml
Applied same href field validation updates to feature-gated CRD manifest versions.
Generated Documentation
console/v1/zz_generated.swagger_doc_generated.go, openapi/generated_openapi/zz_generated.openapi.go
Updated SwaggerDoc and OpenAPI schema descriptions for Link.Href field to reflect support for both https and mailto link formats.
OpenAPI Schema
openapi/openapi.json
Extensive updates to schema descriptions, enum options, and default values across numerous API resource definitions (dnsRecordsType, Route, Service, Pod, Node, ResourceClaim, and others); includes clarifications for validation constraints and property semantics.
Test Coverage
console/v1/tests/consolelinks.console.openshift.io/AAA_ungated.yaml
Added new test case "Should be able to create a ConsoleLink with mailto href" to verify ConsoleLink creation with mailto: link validation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • File breadth: Changes span multiple generated manifests and documentation files, though most follow the same pattern update.
  • Generated content: Most files are auto-generated (prefixed with zz_generated.*), typically lower review risk, but regeneration accuracy should be verified.
  • Concern area: The openapi/openapi.json file contains extensive unrelated schema updates (dnsRecordsType, Route, Service, Pod, Node, ResourceClaim, etc.) that appear disconnected from the href validation feature. Verify whether these changes are intentional and belong in this PR.
  • Pattern consistency: The core change (href pattern from ^https:// to ^(https://|mailto:)) is applied consistently across files, reducing complexity.
  • Test addition: New test case appropriately validates the mailto functionality.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

🔧 golangci-lint (2.5.0)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented

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_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ 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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 20, 2025

Hello @jhadvig! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 20, 2025
Copy link

@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: 0

🧹 Nitpick comments (1)
console/v1/types.go (1)

7-8: LGTM! The regex correctly adds mailto support.

The pattern change from ^https:// to ^(https://|mailto:) correctly implements the stated goal, and the comment accurately describes the allowed formats.

Optional enhancement: Consider adding more comprehensive validation for improved robustness:

-	// href is the absolute URL for the link. Must use https:// for web URLs or mailto: for email links.
-	// +kubebuilder:validation:Pattern=`^(https://|mailto:)`
+	// href is the absolute URL for the link. Must use https:// for web URLs or mailto: for email links.
+	// +kubebuilder:validation:Pattern=`^(https://[^\s]+|mailto:[^\s]+)$`

This would:

  • Add an end anchor to validate the entire string
  • Disallow whitespace in URLs/email addresses
  • Provide stricter format validation

However, this is entirely optional—the current implementation maintains consistency with the original pattern and may be sufficient depending on how the href is validated/sanitized in the rendering layer.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 916c700 and 241cc51.

📒 Files selected for processing (9)
  • console/v1/tests/consolelinks.console.openshift.io/AAA_ungated.yaml (1 hunks)
  • console/v1/types.go (1 hunks)
  • console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml (1 hunks)
  • console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml (1 hunks)
  • console/v1/zz_generated.featuregated-crd-manifests/consolelinks.console.openshift.io/AAA_ungated.yaml (1 hunks)
  • console/v1/zz_generated.featuregated-crd-manifests/consolenotifications.console.openshift.io/AAA_ungated.yaml (1 hunks)
  • console/v1/zz_generated.swagger_doc_generated.go (1 hunks)
  • openapi/generated_openapi/zz_generated.openapi.go (2 hunks)
  • openapi/openapi.json (9 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml
  • console/v1/zz_generated.featuregated-crd-manifests/consolelinks.console.openshift.io/AAA_ungated.yaml
  • console/v1/zz_generated.swagger_doc_generated.go
  • console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml
  • openapi/generated_openapi/zz_generated.openapi.go
  • console/v1/tests/consolelinks.console.openshift.io/AAA_ungated.yaml
  • console/v1/zz_generated.featuregated-crd-manifests/consolenotifications.console.openshift.io/AAA_ungated.yaml
  • console/v1/types.go
  • openapi/openapi.json
🔇 Additional comments (10)
openapi/generated_openapi/zz_generated.openapi.go (2)

25676-25682: Consistent description update for Link.href field.

The description matches the ConsoleLinkSpec.href field update, ensuring consistency across the OpenAPI schema.


24177-24183: Description is accurate and properly verified.

The validation pattern in console/v1/types.go has been correctly updated to ^(https://|mailto:), confirming alignment with the description in the generated OpenAPI schema. Both hunks properly document the expanded href support.

console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml (1)

72-76: ConsoleNotification link href pattern and docs look consistent

Allowing https:// and mailto: via pattern: ^(https://|mailto:) and updating the description keeps the validation behavior consistent with the rest of the API and just broadens the accepted schemes as intended.

console/v1/tests/consolelinks.console.openshift.io/AAA_ungated.yaml (1)

21-35: New mailto ConsoleLink test is well-formed

The added test case cleanly exercises a mailto: href with the minimal required fields and matching expected spec, providing good coverage for the new allowed scheme.

console/v1/zz_generated.swagger_doc_generated.go (1)

15-18: Swagger doc for Link.href correctly reflects https + mailto support

The updated description for Link.href matches the broadened validation (https for web URLs, mailto for email links) and keeps the distinction from CLIDownloadLink (still https-only).

console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml (1)

83-86: ConsoleLink href schema aligns with new mailto support

The href description and pattern: ^(https://|mailto:) correctly broaden ConsoleLink to accept both https URLs and mailto links while preserving previous https behavior.

console/v1/zz_generated.featuregated-crd-manifests/consolelinks.console.openshift.io/AAA_ungated.yaml (1)

82-85: Feature-gated ConsoleLink CRD stays in sync on href validation

The feature-gated CRD mirrors the updated href description and ^(https://|mailto:) pattern, keeping behavior consistent across gated and ungated manifests.

console/v1/zz_generated.featuregated-crd-manifests/consolenotifications.console.openshift.io/AAA_ungated.yaml (1)

72-74: All changes verified and correctly sourced from types.go.

The href validation pattern ^(https://|mailto:) in lines 72-74 correctly originates from the Link struct in console/v1/types.go, which defines the validation using the +kubebuilder:validation:Pattern tag. The description accurately reflects the new support for mailto: links, and the generated manifest properly reflects the source definition. The regex pattern is well-formed and the file is correctly generated.

openapi/openapi.json (2)

13306-13306: Pattern validation is correctly implemented in source code.

The original concern is based on incomplete understanding. The href field pattern validation exists in the source file console/v1/types.go (lines 7-8) via the kubebuilder marker +kubebuilder:validation:Pattern=^(https://|mailto:)`` on the Link struct. This marker is the authoritative source for validation enforcement and properly flows through to generated CRD manifests and the openapi.json descriptions. The PR changes to the openapi.json descriptions accurately document this validation behavior.

Likely an incorrect or invalid review comment.


4782-4789: Regeneration of openapi.json is picking up pre-existing Go source documentation improvements, unrelated to the mailto: link feature.

The git diff confirms your observation. The description expansions for dnsRecordsType, idleConnectionTerminationPolicy, and httpKeepAliveTimeout are not new additions—they are pre-existing comments in the Go source files (config/v1/types_infrastructure.go and operator/v1/types_ingress.go). When openapi.json is regenerated via the hack/update-openapi.sh script, it picks up these complete descriptions automatically. This PR's main change is supporting mailto: links in ConsoleLink, but the regenerated spec captures all pre-existing Go source documentation.

These changes should be evaluated as part of the file regeneration process. If the openapi.json regeneration was performed intentionally as part of this PR, the expanded descriptions are an expected artifact. If it was unintended, consider reverting openapi.json to prevent scope creep, or split the regeneration into a separate maintenance PR.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 20, 2025

@jhadvig: This pull request references CONSOLE-4882 which is a valid jira issue.

In response to this:

Tested the change on a live cluster and worked as desired.

/assign @spadgett @JoelSpeed @everettraven

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.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Spoke with @jhadvig and this validation change is the only thing necessary to ensure that this works.

This is a very small and unlikely to break anything change.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 20, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven

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

The pull request process is described here

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2025
@jhadvig
Copy link
Member Author

jhadvig commented Nov 20, 2025

/verified by @jhadvig

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 20, 2025
@openshift-ci-robot
Copy link

@jhadvig: This PR has been marked as verified by @jhadvig.

In response to this:

/verified by @jhadvig

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
Copy link
Contributor

openshift-ci bot commented Nov 20, 2025

@jhadvig: 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.

@openshift-merge-bot openshift-merge-bot bot merged commit 32e27fc into openshift:master Nov 20, 2025
15 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants