console icon indicating copy to clipboard operation
console copied to clipboard

OCPBUGS-65765, OCPBUGS-65678: apiVersion is empty on YAML creation page - Runtime error occurs when create MachineConfig with default yaml from…

Open cajieh opened this issue 1 month ago • 33 comments

… console

cajieh avatar Nov 24 '25 15:11 cajieh

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

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-robot avatar Nov 24 '25 15:11 openshift-ci-robot

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 36ec7c34d60651cea12fd89998181dc4f25ee7ef and b4e519c3cf4c245ec2036e648fd912abe90a8978.

📒 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.

coderabbitai[bot] avatar Nov 24 '25 15:11 coderabbitai[bot]

/jira refresh

cajieh avatar Nov 24 '25 15:11 cajieh

@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

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-robot avatar Nov 24 '25 15:11 openshift-ci-robot

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

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-robot avatar Nov 24 '25 16:11 openshift-ci-robot

/jira refresh

logonoff avatar Dec 02 '25 19:12 logonoff

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

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-robot avatar Dec 02 '25 19:12 openshift-ci-robot

/jira refresh

logonoff avatar Dec 02 '25 19:12 logonoff

@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

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-robot avatar Dec 02 '25 19:12 openshift-ci-robot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh, logonoff

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[bot] avatar Dec 02 '25 19:12 openshift-ci[bot]

@cajieh maybe add a test case in frontend/public/components/__tests__/create-yaml.spec.tsx for better coverage that would have caught this bug

sg00dwin avatar Dec 02 '25 20:12 sg00dwin

/label acknowledge-critical-fixes-only /verified later @yapei

cajieh avatar Dec 08 '25 17:12 cajieh

/retest

cajieh avatar Dec 08 '25 17:12 cajieh

@cajieh: This PR has been marked to be verified later by @yapei.

In response to this:

/label acknowledge-critical-fixes-only /verified later @yapei

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 avatar Dec 08 '25 17:12 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 370e6b0c82e414a473fb3fb30ede556d9b92aee4 and 2 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total

openshift-ci-robot avatar Dec 09 '25 03:12 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 2db4d6278e766aee65982a8d49ecdd5286438511 and 1 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total

openshift-ci-robot avatar Dec 09 '25 10:12 openshift-ci-robot

/retest-required

Leo6Leo avatar Dec 09 '25 16:12 Leo6Leo

/retest-required

Remaining retests: 0 against base HEAD d93076f2c6250e13f0f9d05ad1e1d5dd22910e75 and 0 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total

openshift-ci-robot avatar Dec 10 '25 01:12 openshift-ci-robot

/hold

Revision b4e519c3cf4c245ec2036e648fd912abe90a8978 was retested 3 times: holding

openshift-ci-robot avatar Dec 10 '25 06:12 openshift-ci-robot

/retest-required

Leo6Leo avatar Dec 11 '25 13:12 Leo6Leo

/retest-required

Leo6Leo avatar Dec 11 '25 18:12 Leo6Leo

/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-bot avatar Dec 12 '25 08:12 openshift-bot

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

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.

openshift-ci-robot avatar Dec 12 '25 08:12 openshift-ci-robot

/retest-required

Leo6Leo avatar Dec 12 '25 14:12 Leo6Leo

/test e2e-gcp-console

cajieh avatar Dec 15 '25 09:12 cajieh

/jira refresh

cajieh avatar Dec 15 '25 09:12 cajieh

@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

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-robot avatar Dec 15 '25 09:12 openshift-ci-robot

/jira refresh

cajieh avatar Dec 15 '25 09:12 cajieh

@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

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-robot avatar Dec 15 '25 09:12 openshift-ci-robot

/unhold

cajieh avatar Dec 17 '25 14:12 cajieh