OCPBUGS-65765, OCPBUGS-65678: apiVersion is empty on YAML creation page - Runtime error occurs when create MachineConfig with default yaml from…
… console
@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.
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
isDefaultTemplatechange 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
isDefaultTemplatewas comparing thetemplateprop (often undefined when no custom template is provided) instead of theresolvedTemplatethat's actually used. Whentemplateis undefined, the fallback chain resolves to either a model-specific or DEFAULT template, but the old check would incorrectly return false. This prevented theapiVersionoverride (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.
/jira refresh
@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.
@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.
/jira refresh
@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.
/jira refresh
@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.
[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
- ~~frontend/OWNERS~~ [cajieh,logonoff]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@cajieh maybe add a test case in frontend/public/components/__tests__/create-yaml.spec.tsx for better coverage that would have caught this bug
/label acknowledge-critical-fixes-only /verified later @yapei
/retest
@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.
/retest-required
Remaining retests: 0 against base HEAD 370e6b0c82e414a473fb3fb30ede556d9b92aee4 and 2 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total
/retest-required
Remaining retests: 0 against base HEAD 2db4d6278e766aee65982a8d49ecdd5286438511 and 1 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total
/retest-required
/retest-required
Remaining retests: 0 against base HEAD d93076f2c6250e13f0f9d05ad1e1d5dd22910e75 and 0 for PR HEAD b4e519c3cf4c245ec2036e648fd912abe90a8978 in total
/hold
Revision b4e519c3cf4c245ec2036e648fd912abe90a8978 was retested 3 times: holding
/retest-required
/retest-required
/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: 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.
/retest-required
/test e2e-gcp-console
/jira refresh
@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.
/jira refresh
@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.
/unhold