Skip to content

wip#6908

Closed
pacevedom wants to merge 1 commit into
openshift:mainfrom
pacevedom:bootupd
Closed

wip#6908
pacevedom wants to merge 1 commit into
openshift:mainfrom
pacevedom:bootupd

Conversation

@pacevedom

@pacevedom pacevedom commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests
    • Updated the kickstart installation template prologue to run a pre-install step that disables bootupd during Anaconda installs, ensuring bootupd-dependent behavior is avoided and any cached Python artifacts are removed.

@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 Jun 19, 2026
@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@pacevedom

Copy link
Copy Markdown
Contributor Author

/test ?

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

A %pre script is added to the kickstart prologue that disables bootupd functionality during Anaconda installation by patching rpm-ostree's util.py to force have_bootupd() to return False and removing related cache directories.

Changes

Bootupd Disabling in Kickstart

Layer / File(s) Summary
Bootupd disabling %pre script
test/kickstart-templates/includes/main-prologue.cfg
A %pre script locates and patches rpm-ostree's util.py to disable have_bootupd(), preventing bootupd-dependent code paths during installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'wip' is vague and generic, providing no meaningful information about the actual changeset which adds a bootupd-disabling script to the kickstart prologue. Replace with a descriptive title that captures the main change, e.g., 'Disable bootupd in Anaconda kickstart prologue' or 'Add bootupd disabling script to kickstart template.'
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Stable And Deterministic Test Names ✅ Passed This PR modifies only a Kickstart configuration file, not Ginkgo test files. No test title definitions (It, Describe, Context, When) are present, making the check inapplicable.
Test Structure And Quality ✅ Passed PR only modifies a Kickstart configuration file (.cfg); no Ginkgo Go test code is present, making this quality check inapplicable.
Microshift Test Compatibility ✅ Passed This PR modifies a kickstart template file, not Ginkgo e2e tests. The check for MicroShift API compatibility is inapplicable when no e2e tests are added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. The changes only modify a Kickstart configuration file (main-prologue.cfg) to disable bootupd during Anaconda installation, which is not subject to SNO tes...
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a Kickstart template for Anaconda boot configuration, not deployment manifests, operators, or controllers. The custom check for topology-aware scheduling constraints is not applica...
Ote Binary Stdout Contract ✅ Passed PR modifies only Kickstart template configuration and shell scripts, not Go test code or OTE binaries that communicate via JSON stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies only kickstart template prologue (shell script), not Ginkgo e2e tests. Custom check for IPv6/disconnected compatibility does not apply to non-test files.
No-Weak-Crypto ✅ Passed No weak cryptography detected in the PR changes; the file contains only shell script code for patching the Anaconda bootupd behavior with no cryptographic operations.
Container-Privileges ✅ Passed PR modifies only a Kickstart template file, not container/K8s manifests; check is inapplicable.
No-Sensitive-Data-In-Logs ✅ Passed The %pre script logs only system file paths (standard Python package locations) to console and does not expose passwords, API keys, tokens, PII, session IDs, internal hostnames, or customer data.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@pacevedom

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 19, 2026
@pacevedom

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@test/kickstart-templates/includes/main-prologue.cfg`:
- Around line 13-19: The sed command that modifies the have_bootupd function in
util.py does not verify success before proceeding. Add an error check
immediately after the sed command to ensure the modification was applied
successfully. Since this is critical boot functionality in the %pre phase, the
script should fail if the sed operation fails rather than silently continuing.
Check the exit status of the sed command and exit with an error code if it
fails, or use the sed command with a flag that will cause the script to fail if
the operation does not complete as expected.
- Line 14: Add logging after the UTIL_FILE variable assignment to identify and
display which util.py file was found and will be patched. After the line that
assigns UTIL_FILE from the find command, add an echo statement that outputs the
file path being patched to /dev/console for visibility. This will help with
debugging when test failures occur across different RHEL/Fedora versions and
will make it clear whether the correct util.py was located or if the pattern
matching failed.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 6a1c03d4-e677-445e-9d2b-4d6cd35c6463

📥 Commits

Reviewing files that changed from the base of the PR and between 64c8006 and 7bef900.

📒 Files selected for processing (1)
  • test/kickstart-templates/includes/main-prologue.cfg

Comment on lines +13 to +19
%pre --log=/dev/console
UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)
if [ -n "${UTIL_FILE}" ] && grep -q 'def have_bootupd' "${UTIL_FILE}"; then
sed -i '/def have_bootupd/a\ return False' "${UTIL_FILE}"
find "$(dirname "${UTIL_FILE}")" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
fi
%end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Verify sed success and consider fallback for missing targets.

The script silently proceeds even if sed fails to modify the function. Since this is a %pre phase that affects critical boot paths, undetected modification failures could leave bootupd enabled during installation.

🛡️ Proposed improvement to verify sed success
 %pre --log=/dev/console
 UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)
 if [ -n "${UTIL_FILE}" ] && grep -q 'def have_bootupd' "${UTIL_FILE}"; then
-    sed -i '/def have_bootupd/a\    return False' "${UTIL_FILE}"
+    if ! sed -i '/def have_bootupd/a\    return False' "${UTIL_FILE}"; then
+        echo "ERROR: Failed to patch have_bootupd() in ${UTIL_FILE}" >> /dev/console
+        exit 1
+    fi
     find "$(dirname "${UTIL_FILE}")" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
 fi
 %end
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
%pre --log=/dev/console
UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)
if [ -n "${UTIL_FILE}" ] && grep -q 'def have_bootupd' "${UTIL_FILE}"; then
sed -i '/def have_bootupd/a\ return False' "${UTIL_FILE}"
find "$(dirname "${UTIL_FILE}")" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
fi
%end
%pre --log=/dev/console
UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)
if [ -n "${UTIL_FILE}" ] && grep -q 'def have_bootupd' "${UTIL_FILE}"; then
if ! sed -i '/def have_bootupd/a\ return False' "${UTIL_FILE}"; then
echo "ERROR: Failed to patch have_bootupd() in ${UTIL_FILE}" >> /dev/console
exit 1
fi
find "$(dirname "${UTIL_FILE}")" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
fi
%end
🤖 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 `@test/kickstart-templates/includes/main-prologue.cfg` around lines 13 - 19,
The sed command that modifies the have_bootupd function in util.py does not
verify success before proceeding. Add an error check immediately after the sed
command to ensure the modification was applied successfully. Since this is
critical boot functionality in the %pre phase, the script should fail if the sed
operation fails rather than silently continuing. Check the exit status of the
sed command and exit with an error code if it fails, or use the sed command with
a flag that will cause the script to fail if the operation does not complete as
expected.

# causes both the storage module (installs GRUB to MBR/ESP) and the rpm-ostree
# module (configures grub.cfg) to use their standard non-bootupd code paths.
%pre --log=/dev/console
UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Simulate the find pattern used in the kickstart
# Expected: Exactly one file found and verified

UTIL_FILE=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | head -1)

if [ -z "${UTIL_FILE}" ]; then
  echo "ERROR: No util.py found. Check pyanaconda package and version."
  exit 1
fi

echo "Found util.py at: ${UTIL_FILE}"

# Count matches to detect silent failures from head -1
MATCH_COUNT=$(find /usr/lib*/python3*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree -name util.py 2>/dev/null | wc -l)
if [ "${MATCH_COUNT}" -gt 1 ]; then
  echo "WARNING: Multiple matches found (${MATCH_COUNT}), using first: ${UTIL_FILE}"
fi

# Verify expected content
if ! grep -q 'def have_bootupd' "${UTIL_FILE}"; then
  echo "ERROR: have_bootupd() not found in ${UTIL_FILE}"
  exit 1
fi

echo "SUCCESS: util.py is valid and contains have_bootupd()"

Repository: openshift/microshift

Length of output: 127


🏁 Script executed:

# Read the target file to understand context
cat -n test/kickstart-templates/includes/main-prologue.cfg | head -30

Repository: openshift/microshift

Length of output: 1704


🏁 Script executed:

# Check the overall structure of the kickstart template directory
find test/kickstart-templates -type f | head -20

Repository: openshift/microshift

Length of output: 1155


Add logging to identify which util.py file was patched for better debugging.

The path pattern is fragile, but your code already validates file existence and content before patching (line 15). However, explicitly logging which file was identified and modified would help with test failures across different RHEL/Fedora versions. For example:

echo "Patching have_bootupd() in ${UTIL_FILE}" > /dev/console

This ensures test failures can reveal whether a different util.py was patched or the pattern failed entirely.

🤖 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 `@test/kickstart-templates/includes/main-prologue.cfg` at line 14, Add logging
after the UTIL_FILE variable assignment to identify and display which util.py
file was found and will be patched. After the line that assigns UTIL_FILE from
the find command, add an echo statement that outputs the file path being patched
to /dev/console for visibility. This will help with debugging when test failures
occur across different RHEL/Fedora versions and will make it clear whether the
correct util.py was located or if the pattern matching failed.

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@pacevedom: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-tests 7bef900 link true /test e2e-aws-tests

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.

@pacevedom pacevedom closed this Jun 19, 2026
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/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant