Skip to content

RPMs build improvements#167

Merged
ggiguash merged 2 commits intomicroshift-io:mainfrom
pmtk:optimize-builds
Dec 13, 2025
Merged

RPMs build improvements#167
ggiguash merged 2 commits intomicroshift-io:mainfrom
pmtk:optimize-builds

Conversation

@pmtk
Copy link
Copy Markdown
Contributor

@pmtk pmtk commented Dec 12, 2025

Follow-up fixes on #163

Summary by CodeRabbit

  • Chores

    • Consolidated SRPM/RPM pipeline: removed separate SRPM phase and pass build inputs directly into the RPM stage.
    • Simplified build outputs and mounting/unmounting flow to reduce intermediate copies and temp work; added extra cleanup steps.
    • Removed a separate post-build repository-prep step and streamlined image build sequence.
  • Documentation

    • Clarified directory-structure guidance for image build scripts.

✏️ Tip: You can customize this high-level summary in your review settings.

@pmtk pmtk requested a review from a team as a code owner December 12, 2025 17:59
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 12, 2025

Walkthrough

GitHub Actions removed the separate srpm step and pass USHIFT_GITREF and OKD_VERSION_TAG directly to make rpm. Makefile and packaging Containerfiles consolidate SRPM/RPM mounting/extraction and artifact copying into their targets; src/image/postbuild.sh was deleted and CLAUDE.md updated.

Changes

Cohort / File(s) Summary
GitHub Actions
\.github/actions/build/action.yaml`, `.github/actions/build-deb/action.yaml``
Removed the separate srpm step; moved USHIFT_GITREF and OKD_VERSION_TAG inputs into the make rpm invocation; eliminated srpm invocation from workflows.
Makefile targets
\Makefile``
rpm now depends on srpm; targets mount images, copy RPMS/SRPMS into computed outdirs, use quieter unmounts and trap-based cleanup, and print consolidated success messages; pre-checks removed.
Container build files
\packaging/rpm.Containerfile`, `packaging/srpm.Containerfile``
rpm.Containerfile: added explicit repo/RPMS layout steps, moves SRPMS into RPMS/srpms, removes cache, and clarifies extraction messages. srpm.Containerfile: extract OKD client directly to /usr/local/bin and removed post-build SRPM copy.
Removed / docs
\src/image/postbuild.sh`, `CLAUDE.md``
Deleted src/image/postbuild.sh (removed createrepo + srpms-copy script). Updated CLAUDE.md to reflect removal of postbuild.sh and adjusted image build notes.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant GH as GitHub Actions
participant Make as Makefile (srpm/rpm)
participant Podman as Container build/runtime
participant Host as Host filesystem
GH->>Make: invoke make rpm (with USHIFT_GITREF, OKD_VERSION_TAG)
Make->>Podman: build SRPM image (srpm target)
Podman-->>Make: SRPM image available
Make->>Podman: mount SRPM image
Podman-->>Host: copy SRPMS -> SRPM_WORKDIR / tmp
Make->>Podman: unmount SRPM image
Make->>Podman: build RPM image (rpm target)
Podman-->>Make: RPM image available
Make->>Podman: mount RPM image
Podman-->>Host: copy RPMs -> RPM_OUTDIR / tmp
Make->>Podman: unmount RPM image
Make->>Host: finalize repo metadata (createrepo / move/versioning)
GH->>Host: continue downstream steps

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Pay attention to:
    • Makefile mount/unmount, trap and temp-dir fallback logic.
    • Consistency of RPM_OUTDIR / SRPM_WORKDIR and argument wiring from Actions to make rpm.
    • The new repository/RPMS layout and file moves in packaging/rpm.Containerfile.
    • Removal of src/image/postbuild.sh and where createrepo/repodata generation now occurs.

Possibly related PRs

Suggested reviewers

  • praveenkumar
  • eslutsky

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'RPMs build improvements' is vague and generic; it doesn't convey the specific nature of the changes (moving to image mounts, consolidating SRPMs, adding dependencies). Use a more specific title that highlights the main change, such as 'Switch RPM build to image mounts and consolidate SRPM artifacts' or 'Refactor RPM build process with image mount/copy and SRPM consolidation'.
✅ Passed checks (2 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.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Comment thread packaging/rpm.Containerfile
Copy link
Copy Markdown

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

🧹 Nitpick comments (3)
packaging/srpm.Containerfile (1)

31-36: Harden OKD client download/extract (integrity + safer tar)
Consider adding curl --fail and checksum/signature verification, and extracting with safer flags (e.g., --no-same-owner --no-same-permissions) to reduce supply-chain risk.

-    curl -L --retry 5 -o /tmp/okd-client.tar.gz "${OKD_CLIENT_URL}" && \
-    tar -xzf /tmp/okd-client.tar.gz -C /usr/local/bin/ && \
+    curl -fL --retry 5 -o /tmp/okd-client.tar.gz "${OKD_CLIENT_URL}" && \
+    tar -xzf /tmp/okd-client.tar.gz -C /usr/local/bin/ --no-same-owner --no-same-permissions && \
     rm -rf /tmp/okd-client.tar.gz
Makefile (2)

73-86: rpm→srpm dependency looks right; consider avoiding root-owned outputs + mount leaks
Build order is now enforced (good). Two nits: sudo cp will make artifacts root-owned, and && chaining skips umount on copy failure.

 	@outdir="$${RPM_OUTDIR:-$$(mktemp -d /tmp/microshift-rpms-XXXXXX)}" && \
 	mntdir="$$(sudo podman image mount "${RPM_IMAGE}")" && \
-	sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \
-	sudo podman image umount "${RPM_IMAGE}" >/dev/null && \
+	trap 'sudo podman image umount "${RPM_IMAGE}" >/dev/null 2>&1 || true' EXIT && \
+	sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \
+	sudo chown -R "$$(id -u):$$(id -g)" "$${outdir}" && \
+	trap - EXIT && sudo podman image umount "${RPM_IMAGE}" >/dev/null && \
 	echo -e "\nBuild completed successfully\nRPMs are available in '$${outdir}'"

87-103: Same mount/copy concerns apply to SRPM extraction
Same ownership + “umount skipped on failure” concern in the SRPM target.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2754183 and 2d2796c.

📒 Files selected for processing (7)
  • .github/actions/build-deb/action.yaml (1 hunks)
  • .github/actions/build/action.yaml (1 hunks)
  • CLAUDE.md (1 hunks)
  • Makefile (1 hunks)
  • packaging/rpm.Containerfile (1 hunks)
  • packaging/srpm.Containerfile (2 hunks)
  • src/image/postbuild.sh (0 hunks)
💤 Files with no reviewable changes (1)
  • src/image/postbuild.sh
🧰 Additional context used
📓 Path-based instructions (1)
packaging/**

📄 CodeRabbit inference engine (CLAUDE.md)

Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Files:

  • packaging/rpm.Containerfile
  • packaging/srpm.Containerfile
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure

Applied to files:

  • CLAUDE.md
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Applied to files:

  • CLAUDE.md
  • packaging/rpm.Containerfile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/okd/** : OKD version detection logic should be implemented in src/okd/ directory

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Applied to files:

  • CLAUDE.md
  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64

Applied to files:

  • CLAUDE.md
  • .github/actions/build/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-10-17T10:53:08.461Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-04T13:35:05.230Z
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Versioning scheme format: MICROSHIFT-VERSION_gMICROSHIFT-GIT-COMMIT_OKD-VERSION; timestamps are included for tag builds but not for branch builds

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
  • packaging/srpm.Containerfile
📚 Learning: 2025-11-26T06:46:33.353Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 137
File: src/quickrpm.sh:83-98
Timestamp: 2025-11-26T06:46:33.353Z
Learning: In the microshift-io/microshift repository, the quickrpm.sh script only supports RHEL 9 or above (and equivalent CentOS/Fedora versions), where util-linux includes the `--nooverlap` flag for losetup.

Applied to files:

  • packaging/rpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/srpm.Containerfile
📚 Learning: 2025-10-17T07:44:32.742Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.

Applied to files:

  • .github/actions/build/action.yaml
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset

Applied to files:

  • packaging/srpm.Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: fedora-bootc (ubuntu-24.04-arm)
  • GitHub Check: fedora-bootc (ubuntu-24.04)
  • GitHub Check: isolated-network (kindnet, ubuntu-24.04, 0)
  • GitHub Check: centos10-bootc
  • GitHub Check: isolated-network (ovnk, ubuntu-24.04, 1)
  • GitHub Check: ubuntu-rpm2deb
  • GitHub Check: centos9-bootc
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04-arm)
🔇 Additional comments (2)
CLAUDE.md (1)

116-120: Doc update matches postbuild.sh removal
Line 118 correctly reflects the new reality (only prebuild.sh is relevant under src/image/).

packaging/srpm.Containerfile (1)

69-70: SRPM artifact path verifiedsrc/image/build-rpms.sh correctly outputs SRPMs to /home/microshift/microshift/_output/rpmbuild/SRPMS/ (confirmed at line 81), and the Makefile extracts from this same path in the mounted container image. Paths match as expected.

Comment thread .github/actions/build-deb/action.yaml
Comment thread .github/actions/build/action.yaml
Comment thread packaging/rpm.Containerfile Outdated
@ggiguash
Copy link
Copy Markdown
Contributor

@coderabbitai
Perform full code review.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 13, 2025

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the PR diff to examine all changes
gh pr diff 167 --repo microshift-io/microshift > /tmp/pr_diff.txt
cat /tmp/pr_diff.txt

Length of output: 7848


🏁 Script executed:

#!/bin/bash
# Get the full content of modified files to understand context better
echo "=== Makefile ==="
cat Makefile

echo -e "\n\n=== packaging/rpm.Containerfile ==="
cat packaging/rpm.Containerfile

echo -e "\n\n=== packaging/srpm.Containerfile ==="
cat packaging/srpm.Containerfile

Length of output: 13189


🏁 Script executed:

#!/bin/bash
# Check GitHub Actions workflow files
echo "=== .github/actions/build/action.yaml ==="
cat .github/actions/build/action.yaml

echo -e "\n\n=== .github/actions/build-deb/action.yaml ==="
cat .github/actions/build-deb/action.yaml

Length of output: 8217


🏁 Script executed:

#!/bin/bash
# Check bootc.Containerfile to see if it depends on the new directory structure
echo "=== packaging/bootc.Containerfile ==="
cat packaging/bootc.Containerfile

Length of output: 2985


🏁 Script executed:

#!/bin/bash
# Check if there are any other references to postbuild.sh in the codebase
echo "=== Searching for postbuild.sh references ==="
rg -n "postbuild" --type-add 'config:*.{yaml,yml,md,mk}' --type config

echo -e "\n=== Searching for /output references (old volume mount) ==="
rg -n "/output" --type-add 'config:*.{yaml,yml,md,mk,Containerfile}' --type config

echo -e "\n=== Checking for BUILDER_RPM_REPO_PATH usage ==="
rg -n "BUILDER_RPM_REPO_PATH"

Length of output: 1037


🏁 Script executed:

#!/bin/bash
# Verify the error handling in the Makefile targets
echo "=== Checking Makefile shell options ==="
grep -n "set -" Makefile || echo "No 'set' commands found in Makefile"

echo -e "\n=== Checking for error handling in pipelines ==="
grep -n "&&" Makefile | head -20

Length of output: 1191


🏁 Script executed:

#!/bin/bash
# Check for any tests or scripts that might reference the old paths/structure
echo "=== Searching for references to srpms directory ==="
rg -n "srpms" --type-add 'script:*.sh' --type script

echo -e "\n=== Checking for references to old SRPMS path in _output ==="
rg -n "_output.*SRPMS" 

echo -e "\n=== Checking src/rpm/create_repos.sh for potential issues ==="
cat src/rpm/create_repos.sh

Length of output: 2224


🏁 Script executed:

#!/bin/bash
# Verify the exact extraction paths match between rpm.Containerfile and Makefile
echo "=== rpm.Containerfile - where RPMs are placed ==="
rg -n "BUILDER_RPM_REPO_PATH|mv.*rpmbuild/RPMS" packaging/rpm.Containerfile

echo -e "\n=== Makefile - where RPMs are extracted from ==="
rg -n "rpmbuild/RPMS" Makefile

echo -e "\n=== Check if version.txt is referenced elsewhere ==="
rg -n "version\.txt" --type-add 'script:*.sh' --type script

Length of output: 889


🏁 Script executed:

#!/bin/bash
# Check for any documentation about the build process that might need updating
echo "=== Checking documentation files ==="
fd -e md . | head -20

echo -e "\n=== Checking docs/build.md content ==="
cat docs/build.md 2>/dev/null || echo "docs/build.md not found"

Length of output: 5531


@ggiguash I've completed a full code review of PR #167. Here's my comprehensive analysis:

✅ Positive Changes

  1. Improved Architecture: The shift from volume mounts to image mount/copy is cleaner and more explicit
  2. Better Error Handling: The heredoc in rpm.Containerfile with set -euo pipefail is excellent
  3. Simplified Workflow: Having rpm depend on srpm makes the build process more intuitive
  4. Consolidated Structure: Moving SRPMs to RPMS/srpms/ consolidates all artifacts under one directory
  5. Enhanced Cleanup: Added /root/.cache/go-build cleanup

🔴 Critical Issues

1. Version.txt Inconsistency in build-rpms.sh

In src/image/build-rpms.sh, there are two version.txt writes:

  • Line 76: echo "${MICROSHIFT_VERSION}" > _output/rpmbuild/RPMS/version.txt
  • Line 81: echo "${MICROSHIFT_VERSION}" > _output/rpmbuild/SRPMS/version.txt

However, in rpm.Containerfile, you're now moving version.txt from /tmp (where the SRPM is extracted) to RPMS/:

mv ./version.txt ${BUILDER_RPM_REPO_PATH}/RPMS/

This expects version.txt to be in /tmp alongside the extracted SRPM, but the srpm.Containerfile only creates it in _output/rpmbuild/SRPMS/ (line 81 of build-rpms.sh). The SRPMS directory is then copied to the rpm.Containerfile's /tmp, so version.txt should be present. However, line 76 writing to RPMS/version.txt may be redundant now.

Recommendation: Verify the version.txt flow and consider removing the duplicate write at line 76 of build-rpms.sh since it's now handled by rpm.Containerfile.

🟡 Medium Priority Issues

2. Makefile Error Handling

The Makefile extraction logic uses && chains without set -e:

@outdir="$${RPM_OUTDIR:-$$(mktemp -d /tmp/microshift-rpms-XXXXXX)}" && \
mntdir="$$(sudo podman image mount "${RPM_IMAGE}")" && \
sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \
sudo podman image umount "${RPM_IMAGE}" >/dev/null && \

Issues:

  • If any command in the chain fails, the image may remain mounted
  • umount redirects to /dev/null, silencing potential errors
  • No cleanup trap for failed operations

Recommendation: Add error handling:

@outdir="$${RPM_OUTDIR:-$$(mktemp -d /tmp/microshift-rpms-XXXXXX)}" && \
mntdir="$$(sudo podman image mount "${RPM_IMAGE}")" && \
{ sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \
  sudo podman image umount "${RPM_IMAGE}" >/dev/null ; } || \
{ sudo podman image umount "${RPM_IMAGE}" >/dev/null 2>&1 || true ; exit 1 ; } && \

Or use a trap-based approach for robustness.

3. Silent Unmount Failures

Redirecting umount errors to /dev/null could hide real issues:

sudo podman image umount "${RPM_IMAGE}" >/dev/null && \

Recommendation: At minimum, redirect stderr separately or check exit status explicitly:

sudo podman image umount "${RPM_IMAGE}" 2>/dev/null || { echo "Warning: Failed to unmount image" >&2; } && \

🟢 Minor Issues

4. Documentation Message Mismatch

docs/build.md still references the old message format. While the Makefile now outputs:

SRPM is available in '...'

The docs should be verified for consistency (though this is a minor point since the functionality is correct).

5. Path Verification Comment

In rpm.Containerfile line 83:

sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \

The hardcoded path works, but it would be more maintainable to reference the same variable used in the Containerfile. Not critical since paths are consistent.

📋 Verification Questions

  1. Have you tested the build process end-to-end to ensure the mount/copy approach works reliably?
  2. Are there any downstream consumers that expect SRPMs in a separate location (not under RPMS/srpms/)?
  3. Should the GitHub Actions workflows have any additional error handling or verification steps?

Summary

The refactoring is well-executed and represents a solid improvement. The main concerns are around error handling in edge cases and the version.txt flow. Once these are addressed, this will be a clean optimization.


🧠 Learnings used
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
packaging/srpm.Containerfile (1)

31-36: Harden OKD client download to fail fast (Line 31-36).
Recommend curl -fSL --retry 5 --retry-all-errors ... so network/404/403 errors don’t masquerade as tar failures.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2754183 and 86cb6c6.

📒 Files selected for processing (7)
  • .github/actions/build-deb/action.yaml (1 hunks)
  • .github/actions/build/action.yaml (1 hunks)
  • CLAUDE.md (1 hunks)
  • Makefile (1 hunks)
  • packaging/rpm.Containerfile (1 hunks)
  • packaging/srpm.Containerfile (2 hunks)
  • src/image/postbuild.sh (0 hunks)
💤 Files with no reviewable changes (1)
  • src/image/postbuild.sh
🧰 Additional context used
📓 Path-based instructions (1)
packaging/**

📄 CodeRabbit inference engine (CLAUDE.md)

Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Files:

  • packaging/srpm.Containerfile
  • packaging/rpm.Containerfile
🧠 Learnings (17)
📓 Common learnings
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • CLAUDE.md
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • CLAUDE.md
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • CLAUDE.md
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-10-17T10:53:08.461Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • CLAUDE.md
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-11-26T06:46:33.353Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 137
File: src/quickrpm.sh:83-98
Timestamp: 2025-11-26T06:46:33.353Z
Learning: In the microshift-io/microshift repository, the quickrpm.sh script only supports RHEL 9 or above (and equivalent CentOS/Fedora versions), where util-linux includes the `--nooverlap` flag for losetup.

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
📚 Learning: 2025-12-04T13:35:05.230Z
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Versioning scheme format: MICROSHIFT-VERSION_gMICROSHIFT-GIT-COMMIT_OKD-VERSION; timestamps are included for tag builds but not for branch builds

Applied to files:

  • packaging/srpm.Containerfile
  • .github/actions/build/action.yaml
  • .github/actions/build-deb/action.yaml
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to .github/workflows/**/*.{yaml,yml} : GitHub Actions workflows should be used for CI/CD: builders.yaml for pre-submit tests, installers.yaml for quickstart tests, release.yaml for manual releases, and release-okd.yaml for daily OKD ARM builds

Applied to files:

  • .github/actions/build/action.yaml
📚 Learning: 2025-10-17T07:44:32.742Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.

Applied to files:

  • .github/actions/build/action.yaml
  • packaging/rpm.Containerfile
  • Makefile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/okd/** : OKD version detection logic should be implemented in src/okd/ directory

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-10-17T10:31:57.408Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: src/debian/install.sh:12-0
Timestamp: 2025-10-17T10:31:57.408Z
Learning: In the MicroShift project, the Ubuntu version in src/debian/install.sh is intentionally hardcoded to "xUbuntu_20.04" because CRI-O builds are not available for all the latest Ubuntu versions. This should not be changed to dynamic detection.

Applied to files:

  • .github/actions/build-deb/action.yaml
🪛 GitHub Actions: builders
packaging/rpm.Containerfile

[error] 1-1: Build failed: Unknown instruction: "SET" encountered in here-document during RUN /bin/bash - <<EOT in STEP 6/26.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04)
🔇 Additional comments (5)
CLAUDE.md (1)

118-119: Doc update looks consistent with current image build flow (Line 118).

.github/actions/build-deb/action.yaml (1)

42-45: Multiline make rpm args are now passed correctly (Line 42-45).

.github/actions/build/action.yaml (1)

53-56: Multiline make rpm args are now passed correctly (Line 53-56).

packaging/srpm.Containerfile (1)

69-70: SRPM build invocation is straightforward (Line 69-70).

packaging/rpm.Containerfile (1)

18-43: Review comment is not applicable to current code: the heredoc syntax described does not exist in packaging/rpm.Containerfile.

The file currently uses traditional RUN \ ... && \ ... line-continuation syntax (lines 18-31), not the RUN /bin/bash - <<EOT heredoc form referenced in the review. The code does not exhibit the build failure described.

Likely an incorrect or invalid review comment.

Comment thread Makefile
Comment thread Makefile
Copy link
Copy Markdown

@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)
packaging/rpm.Containerfile (1)

14-14: Harden path handling (quoting + “non-empty” guard) before rm -rf/mv.
Right now unquoted ${BUILDER_RPM_REPO_PATH} plus unconditional rm -rf ${BUILDER_RPM_REPO_PATH}/RPMS is a bit footgun-y if the arg is ever set unexpectedly.

 RUN cat > ${BUILD_RPM_SCRIPT_PATH} <<'EOF'
 #!/bin/bash
 set -euo pipefail
+ : "${BUILDER_RPM_REPO_PATH:?BUILDER_RPM_REPO_PATH must be set}"
@@
-mkdir -p ${BUILDER_RPM_REPO_PATH}/
-rm -rf ${BUILDER_RPM_REPO_PATH}/RPMS
-mv /root/rpmbuild/RPMS ${BUILDER_RPM_REPO_PATH}/
+mkdir -p "${BUILDER_RPM_REPO_PATH}/"
+rm -rf "${BUILDER_RPM_REPO_PATH}/RPMS"
+mv /root/rpmbuild/RPMS "${BUILDER_RPM_REPO_PATH}/"
@@
-mkdir -p ${BUILDER_RPM_REPO_PATH}/RPMS/srpms/
-mv ./microshift-*.src.rpm ${BUILDER_RPM_REPO_PATH}/RPMS/srpms/
-mv ./version.txt ${BUILDER_RPM_REPO_PATH}/RPMS/
+mkdir -p "${BUILDER_RPM_REPO_PATH}/RPMS/srpms/"
+mv ./microshift-*.src.rpm "${BUILDER_RPM_REPO_PATH}/RPMS/srpms/"
+mv ./version.txt "${BUILDER_RPM_REPO_PATH}/RPMS/"
@@
-createrepo -v ${BUILDER_RPM_REPO_PATH}/RPMS
+createrepo -v "${BUILDER_RPM_REPO_PATH}/RPMS"

Also applies to: 18-48

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86cb6c6 and fda2f2c.

📒 Files selected for processing (1)
  • packaging/rpm.Containerfile (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packaging/**

📄 CodeRabbit inference engine (CLAUDE.md)

Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Files:

  • packaging/rpm.Containerfile
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Versioning scheme format: MICROSHIFT-VERSION_gMICROSHIFT-GIT-COMMIT_OKD-VERSION; timestamps are included for tag builds but not for branch builds
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to .github/workflows/**/*.{yaml,yml} : GitHub Actions workflows should be used for CI/CD: builders.yaml for pre-submit tests, installers.yaml for quickstart tests, release.yaml for manual releases, and release-okd.yaml for daily OKD ARM builds
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-10-17T10:53:08.461Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-11-26T06:46:33.353Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 137
File: src/quickrpm.sh:83-98
Timestamp: 2025-11-26T06:46:33.353Z
Learning: In the microshift-io/microshift repository, the quickrpm.sh script only supports RHEL 9 or above (and equivalent CentOS/Fedora versions), where util-linux includes the `--nooverlap` flag for losetup.

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-04T13:35:05.230Z
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Applied to files:

  • packaging/rpm.Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: isolated-network (ovnk, ubuntu-24.04, 1)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04)
  • GitHub Check: ubuntu-rpm2deb
  • GitHub Check: fedora-bootc (ubuntu-24.04)
  • GitHub Check: centos10-bootc
  • GitHub Check: isolated-network (kindnet, ubuntu-24.04, 0)
  • GitHub Check: centos9-bootc
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04-arm)
  • GitHub Check: fedora-bootc (ubuntu-24.04-arm)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04)
🔇 Additional comments (2)
packaging/rpm.Containerfile (2)

18-44: Make /tmp cleanup + version.txt handling resilient to flow changes.
Two concerns:

  1. rm -rf /tmp/* can fail under set -e if the glob doesn’t match (bash leaves it literal).
  2. mv ./version.txt ... will hard-fail if version.txt is no longer present in the SRPM payload (and this PR’s objectives mention version.txt may now be duplicated/reshuffled).
 set -euo pipefail
+shopt -s nullglob
@@
-mv ./version.txt ${BUILDER_RPM_REPO_PATH}/RPMS/
+mv ./version.txt "${BUILDER_RPM_REPO_PATH}/RPMS/"  # verify single source of truth for version.txt
@@
-rm -rf /root/rpmbuild /tmp/* /root/.cache/go-build
+rm -rf /root/rpmbuild /tmp/* /root/.cache/go-build

If version.txt is intentionally optional now, make it explicit (e.g., if [[ -f version.txt ]]; then ...; fi)—but if it’s required, please confirm it’s produced exactly once in the new pipeline.


24-26: cpio under set -e can be surprisingly strict—please confirm exit codes in CI.
Some cpio warnings can produce non-zero exits; with set -e that becomes a hard build failure. If you’ve already validated this in the target build environment, ignore; otherwise, it may need a small allowance (only for known-benign exit codes).

Copy link
Copy Markdown

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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fda2f2c and 71960a9.

📒 Files selected for processing (1)
  • packaging/rpm.Containerfile (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packaging/**

📄 CodeRabbit inference engine (CLAUDE.md)

Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Files:

  • packaging/rpm.Containerfile
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Versioning scheme format: MICROSHIFT-VERSION_gMICROSHIFT-GIT-COMMIT_OKD-VERSION; timestamps are included for tag builds but not for branch builds
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to .github/workflows/**/*.{yaml,yml} : GitHub Actions workflows should be used for CI/CD: builders.yaml for pre-submit tests, installers.yaml for quickstart tests, release.yaml for manual releases, and release-okd.yaml for daily OKD ARM builds
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-10-17T10:53:08.461Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-11-26T06:46:33.353Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 137
File: src/quickrpm.sh:83-98
Timestamp: 2025-11-26T06:46:33.353Z
Learning: In the microshift-io/microshift repository, the quickrpm.sh script only supports RHEL 9 or above (and equivalent CentOS/Fedora versions), where util-linux includes the `--nooverlap` flag for losetup.

Applied to files:

  • packaging/rpm.Containerfile
📚 Learning: 2025-12-04T13:35:05.230Z
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Applied to files:

  • packaging/rpm.Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04)
  • GitHub Check: isolated-network (kindnet, ubuntu-24.04, 0)
  • GitHub Check: fedora-bootc (ubuntu-24.04)
  • GitHub Check: centos10-bootc
  • GitHub Check: fedora-bootc (ubuntu-24.04-arm)
  • GitHub Check: isolated-network (ovnk, ubuntu-24.04, 1)
  • GitHub Check: ubuntu-rpm2deb
  • GitHub Check: centos9-bootc
🔇 Additional comments (3)
packaging/rpm.Containerfile (3)

1-16: LGTM on base setup and package installation.

The FROM stages, package installation, and ARG declarations are well-structured. The COPY from SRPM stage correctly brings in the source artifacts.


46-48: Script lifecycle is well-structured.

The chmod, execute, and cleanup pattern is correct. However, this is contingent on fixing the critical ARG expansion issue in the script content (lines 18-44).


39-39: Remove the verification request—version.txt move is necessary.

The ./version.txt originates from the SRPM stage built by build-rpms.sh srpm, which writes MICROSHIFT_VERSION to _output/rpmbuild/SRPMS/version.txt. This is copied to /tmp/ at line 11, then moved to the final RPMs directory at line 39. The rpmbuild invocation at line 29 does not create its own version.txt, so this move is not redundant.

Comment thread packaging/rpm.Containerfile Outdated
Copy link
Copy Markdown

@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

♻️ Duplicate comments (2)
Makefile (2)

74-85: Nice: rpm: srpm enforces the intended build order; trap reduces mount leaks.
Two follow-ups: (1) consider mkdir -p "$$outdir" before cp; (2) avoid fully silencing podman image umount failures—emit at least a warning so cleanup issues aren’t hidden.


98-102: Same srpm mount/unmount observability gap as rpm.
Trap is a good step, but >/dev/null hides unmount failures—prefer warning-on-failure so CI flakes don’t silently accumulate mounts.

🧹 Nitpick comments (1)
.github/actions/build-deb/action.yaml (1)

42-45: Consider quoting USHIFT_GITREF/OKD_VERSION_TAG for consistency/robustness.
This file now correctly passes RPM_OUTDIR, but unlike .github/actions/build/action.yaml it leaves the values unquoted.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 71960a9 and 3134b57.

📒 Files selected for processing (4)
  • .github/actions/build-deb/action.yaml (1 hunks)
  • .github/actions/build/action.yaml (1 hunks)
  • Makefile (1 hunks)
  • packaging/rpm.Containerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packaging/rpm.Containerfile
🧰 Additional context used
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/deb/**|**/*.sh|Makefile : DEB package conversion should use make rpm-to-deb RPM_OUTDIR=/path/to/rpms after RPM build completion

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Clone MicroShift from upstream repository at specified USHIFT_GITREF (default: main) and replace component images with OKD references via src/image/prebuild.sh during SRPM build

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-10-17T10:53:08.461Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: .github/workflows/builders.yaml:75-84
Timestamp: 2025-10-17T10:53:08.461Z
Learning: In the microshift repository, the RPM-to-Debian conversion workflow follows this pattern: `convert.sh` receives an RPM directory as input and outputs .deb files to a `deb/` subdirectory within that directory. The `install.sh` script expects to receive the parent RPM directory (not the deb subdirectory) and uses recursive `find` commands to locate the .deb files in subdirectories.

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Versioning scheme format: MICROSHIFT-VERSION_gMICROSHIFT-GIT-COMMIT_OKD-VERSION; timestamps are included for tag builds but not for branch builds

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Always build SRPM before RPM, and RPM before bootc image - maintain sequential build dependency order

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to .github/workflows/**/*.{yaml,yml} : GitHub Actions workflows should be used for CI/CD: builders.yaml for pre-submit tests, installers.yaml for quickstart tests, release.yaml for manual releases, and release-okd.yaml for daily OKD ARM builds

Applied to files:

  • .github/actions/build-deb/action.yaml
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to src/image/**/*.sh : Image build scripts in src/image/ should use prebuild.sh to replace OKD images and postbuild.sh to configure

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Build artifacts are temporary by default; specify output directories (SRPM_WORKDIR, RPM_OUTDIR) to preserve build artifacts

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to Makefile|**/*.sh|**/*.mk : Use OKD_VERSION_TAG to specify OKD release version; auto-detects latest if unset

Applied to files:

  • .github/actions/build-deb/action.yaml
  • .github/actions/build/action.yaml
📚 Learning: 2025-11-26T06:46:33.353Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 137
File: src/quickrpm.sh:83-98
Timestamp: 2025-11-26T06:46:33.353Z
Learning: In the microshift-io/microshift repository, the quickrpm.sh script only supports RHEL 9 or above (and equivalent CentOS/Fedora versions), where util-linux includes the `--nooverlap` flag for losetup.

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-04T13:35:05.230Z
Learnt from: pmtk
Repo: microshift-io/microshift PR: 151
File: docs/workflows.md:74-76
Timestamp: 2025-12-04T13:35:05.230Z
Learning: The COPR group microshift-io/microshift exists at https://copr.fedorainfracloud.org/coprs/g/microshift-io/microshift/ and is used for publishing MicroShift RPM packages in the microshift-io/microshift repository.

Applied to files:

  • .github/actions/build-deb/action.yaml
  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-10-17T10:31:57.408Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 57
File: src/debian/install.sh:12-0
Timestamp: 2025-10-17T10:31:57.408Z
Learning: In the MicroShift project, the Ubuntu version in src/debian/install.sh is intentionally hardcoded to "xUbuntu_20.04" because CRI-O builds are not available for all the latest Ubuntu versions. This should not be changed to dynamic detection.

Applied to files:

  • .github/actions/build-deb/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to packaging/** : Containerfiles for SRPM, RPM, and bootc builds should be organized in packaging/ directory

Applied to files:

  • Makefile
📚 Learning: 2025-10-17T07:44:32.742Z
Learnt from: ggiguash
Repo: microshift-io/microshift PR: 92
File: .github/workflows/release.yaml:44-50
Timestamp: 2025-10-17T07:44:32.742Z
Learning: When Podman builds an image without a registry prefix (e.g., `podman build -t microshift-okd`), it automatically adds the `localhost/` prefix and `:latest` tag, resulting in `localhost/microshift-okd:latest`. This means the Makefile in microshift-io/microshift building with `-t microshift-okd` produces `localhost/microshift-okd:latest` without explicit retagging.

Applied to files:

  • Makefile
  • .github/actions/build/action.yaml
📚 Learning: 2025-12-12T15:02:26.025Z
Learnt from: CR
Repo: microshift-io/microshift PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-12T15:02:26.025Z
Learning: Applies to **/*.sh|**/*.mk|Makefile : Architecture is automatically detected via uname -m; OKD release images differ by arch - use quay.io/okd/scos-release for x86_64 and ghcr.io/microshift-io/okd/okd-release-arm64 for aarch64

Applied to files:

  • Makefile
  • .github/actions/build/action.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04-arm)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04)
  • GitHub Check: quick-rpm-and-clean (ubuntu-24.04)
  • GitHub Check: quick-start-and-clean (ubuntu-24.04-arm)
  • GitHub Check: fedora-bootc (ubuntu-24.04)
  • GitHub Check: isolated-network (kindnet, ubuntu-24.04, 0)
  • GitHub Check: centos10-bootc
  • GitHub Check: fedora-bootc (ubuntu-24.04-arm)
  • GitHub Check: isolated-network (ovnk, ubuntu-24.04, 1)
  • GitHub Check: centos9-bootc
  • GitHub Check: ubuntu-rpm2deb
🔇 Additional comments (1)
.github/actions/build/action.yaml (1)

53-56: Multiline make rpm arg passing looks fixed and consistent.
USHIFT_GITREF, OKD_VERSION_TAG, and RPM_OUTDIR are now all passed to the same make rpm invocation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants