Skip to content

Conversation

@cajieh
Copy link
Contributor

@cajieh cajieh commented Nov 24, 2025

… console

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 24, 2025
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-65678, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

… console

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 24, 2025

Walkthrough

Added two new default YAML templates (MachineConfigModel and ServiceMonitorModel) to the YAML templates file, and adjusted the default-template detection in the Create YAML component to use the resolved template when calculating isDefaultTemplate. No exported APIs were changed.

Changes

Cohort / File(s) Summary
YAML template additions
frontend/public/models/yaml-templates.ts
Added two new default templates: a MachineConfigModel template containing an OpenShift MachineConfig manifest with ignition version, storage files, and a sample /etc/example-config file; and a ServiceMonitorModel template containing a ServiceMonitor manifest with a basic app selector and endpoint configuration.
Create YAML behavior tweak
frontend/public/components/create-yaml.tsx
In CreateYAMLInner, changed the isDefaultTemplate calculation to compare against resolvedTemplate instead of template, aligning the default check with how resolvedTemplate is chosen and used elsewhere.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review YAML manifest syntax and ensure indentation/escaping and resource fields match expected schemas for MachineConfig and ServiceMonitor.
  • Validate the ignition storage/file content and keys (paths, permissions) for MachineConfig template.
  • Verify the ServiceMonitor template matches PrometheusOperator expectations (selector, endpoints).
  • Confirm the isDefaultTemplate change doesn't alter UI flows unexpectedly (template selection, initial resource rendering).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 36ec7c3 and b4e519c.

📒 Files selected for processing (2)
  • frontend/public/components/create-yaml.tsx (1 hunks)
  • frontend/public/models/yaml-templates.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/models/yaml-templates.ts
🧰 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:

  • frontend/public/components/create-yaml.tsx
🔇 Additional comments (1)
frontend/public/components/create-yaml.tsx (1)

66-67: Bug fix correctly aligns default template detection with resolved template.

The change fixes a logic error where isDefaultTemplate was comparing the template prop (often undefined when no custom template is provided) instead of the resolvedTemplate that's actually used. When template is undefined, the fallback chain resolves to either a model-specific or DEFAULT template, but the old check would incorrectly return false. This prevented the apiVersion override (lines 77-78) from being applied, likely causing the runtime error mentioned in the PR title when creating resources with the default template.

The fix correctly identifies when the DEFAULT template is being used after resolution.


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

@cajieh
Copy link
Contributor Author

cajieh commented Nov 24, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 24, 2025
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-65678, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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 openshift-ci bot requested review from Leo6Leo, spadgett and yapei November 24, 2025 15:48
@openshift-ci openshift-ci bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 24, 2025
@cajieh cajieh force-pushed the runtime-error-create-machineConfig-default-yaml- branch from 36ec7c3 to b4e519c Compare November 24, 2025 16:09
@cajieh cajieh changed the title OCPBUGS-65678: Runtime error occurs when create MachineConfig with default yaml from… [WIP] OCPBUGS-65765, OCPBUGS-65678: apiVersion is empty on YAML creation page - Runtime error occurs when create MachineConfig with default yaml from… Nov 24, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Nov 24, 2025
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-65765, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

This pull request references Jira Issue OCPBUGS-65678, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

… console

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 openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 24, 2025
@cajieh cajieh changed the title [WIP] OCPBUGS-65765, OCPBUGS-65678: apiVersion is empty on YAML creation page - Runtime error occurs when create MachineConfig with default yaml from… OCPBUGS-65765, OCPBUGS-65678: apiVersion is empty on YAML creation page - Runtime error occurs when create MachineConfig with default yaml from… Nov 25, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 25, 2025
@logonoff
Copy link
Member

logonoff commented Dec 2, 2025

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-65765, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

This pull request references Jira Issue OCPBUGS-65678, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

/jira refresh

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.

@logonoff
Copy link
Member

logonoff commented Dec 2, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Dec 2, 2025
@openshift-ci-robot
Copy link
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-65765, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

This pull request references Jira Issue OCPBUGS-65678, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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.

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Dec 9, 2025

/retest-required

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d93076f and 0 for PR HEAD b4e519c in total

@openshift-ci-robot
Copy link
Contributor

/hold

Revision b4e519c was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2025
@Leo6Leo
Copy link
Contributor

Leo6Leo commented Dec 11, 2025

/retest-required

1 similar comment
@Leo6Leo
Copy link
Contributor

Leo6Leo commented Dec 11, 2025

/retest-required

@openshift-bot
Copy link
Contributor

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Dec 12, 2025
@openshift-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-65765, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

This pull request references Jira Issue OCPBUGS-65678, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Dec 12, 2025

/retest-required

@cajieh
Copy link
Contributor Author

cajieh commented Dec 15, 2025

/test e2e-gcp-console

@cajieh
Copy link
Contributor Author

cajieh commented Dec 15, 2025

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-65765, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

This pull request references Jira Issue OCPBUGS-65678, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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.

@cajieh
Copy link
Contributor Author

cajieh commented Dec 15, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 15, 2025
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-65765, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

This pull request references Jira Issue OCPBUGS-65678, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

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.

@cajieh
Copy link
Contributor Author

cajieh commented Dec 17, 2025

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 17, 2025
@cajieh
Copy link
Contributor Author

cajieh commented Dec 17, 2025

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9ac9e36 and 2 for PR HEAD b4e519c in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d3b540a and 1 for PR HEAD b4e519c in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 19, 2025

@cajieh: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 99c3437 into openshift:main Dec 19, 2025
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@cajieh: Jira Issue OCPBUGS-65765: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-65765 has been moved to the MODIFIED state.

Jira Issue OCPBUGS-65678: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-65678 has been moved to the MODIFIED state.

Details

In response to this:

… console

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.

@cajieh
Copy link
Contributor Author

cajieh commented Dec 19, 2025

/cherry-pick release-4.21

@openshift-cherrypick-robot

@cajieh: new pull request created: #15871

Details

In response to this:

/cherry-pick release-4.21

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.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.22.0-0.nightly-2025-12-21-224908

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants