Skip to content

Fix RPM version to include build datetime for correct ordering when installing from COPR#210

Merged
pmtk merged 2 commits intomicroshift-io:mainfrom
pmtk:correct-rpm-version
Mar 27, 2026
Merged

Fix RPM version to include build datetime for correct ordering when installing from COPR#210
pmtk merged 2 commits intomicroshift-io:mainfrom
pmtk:correct-rpm-version

Conversation

@pmtk
Copy link
Copy Markdown
Contributor

@pmtk pmtk commented Mar 25, 2026

Resolves: #209

Summary by CodeRabbit

  • Chores
    • Standardized GitHub Actions workflow display names across CI and build pipelines to improve naming consistency.
    • Enhanced development build version strings to include a UTC timestamp for non-tagged releases, improving build identification and tracking.

@pmtk pmtk requested a review from a team as a code owner March 25, 2026 09:20
@pmtk pmtk changed the title Correct rpm version Fix RPM version to include build datetime for correct ordering when installing from COPR Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15c26542-3e3f-49f7-bfb6-3735491e1f27

📥 Commits

Reviewing files that changed from the base of the PR and between 4e94d5a and bbe71d5.

📒 Files selected for processing (4)
  • .github/workflows/copr-build-and-test.yaml
  • .github/workflows/copr-experimental.yaml
  • .github/workflows/copr-nightly.yaml
  • src/image/build-rpms.sh
✅ Files skipped from review due to trivial changes (3)
  • .github/workflows/copr-experimental.yaml
  • .github/workflows/copr-build-and-test.yaml
  • .github/workflows/copr-nightly.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/image/build-rpms.sh

📝 Walkthrough

Walkthrough

Renames three COPR workflow display names for consistency and appends a UTC build timestamp (-YYYYMMDDHHMM) to MICROSHIFT_VERSION when building from non-tag git refs in the RPM build script; no other functional changes introduced.

Changes

Cohort / File(s) Summary
COPR workflow renames
\.github/workflows/copr-build-and-test.yaml, \.github/workflows/copr-experimental.yaml, \.github/workflows/copr-nightly.yaml
Updated top-level workflow name fields to a consistent copr-* prefix (display-name changes only; triggers and job logic unchanged).
RPM version timestamping
src/image/build-rpms.sh
When USHIFT_GITREF is not a git tag, MICROSHIFT_VERSION now includes a UTC timestamp suffix (-YYYYMMDDHHMM) immediately after the X.Y.Z portion before the existing -g${SOURCE_GIT_COMMIT}-... suffix; inline example comment updated. Review the timestamp formatting and any downstream consumers of MICROSHIFT_VERSION.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • RPMs build improvements #167: Modifies src/image/build-rpms.sh and MICROSHIFT_VERSION handling (related changes to RPM/versioning logic).
  • Multi-arch SRPM builder #159: Adjusts src/image/build-rpms.sh version handling and per-target version file writes (overlapping edits to version generation).

Suggested reviewers

  • ggiguash
  • agullon
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding build datetime to RPM version for correct ordering, matching the key code modification in src/image/build-rpms.sh.
Linked Issues check ✅ Passed The pull request satisfies issue #209 by appending an ISO-like UTC timestamp (YYYYMMDDHHMM) after the X.Y.Z version portion, ensuring correct chronological RPM ordering.
Out of Scope Changes check ✅ Passed All changes are in scope: three workflow name updates improve consistency, and the build-rpms.sh change directly addresses the RPM versioning issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

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)
src/image/build-rpms.sh (1)

56-56: Update the example to match the final transformed version string.

Line 56 shows - separators, but Line 62 converts - to _. The example is misleading during troubleshooting.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/image/build-rpms.sh` at line 56, The example comment showing the version
transformation is misleading because it shows hyphen separators in the original
but the script converts those to underscores in the final string; update the
commented example so the transformed version matches the actual output (use
underscores where the script replaces hyphens), e.g. adjust the example string
containing "4.21.0-202511271015-ga9cd00b34_4.21.0_okd_scos.ec.5" so the
post-transformation portion reflects underscores exactly as produced by the
script.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/image/build-rpms.sh`:
- Around line 51-53: The script hardcodes Makefile.version.aarch64.var when
computing MICROSHIFT_VERSION; change it to detect architecture with uname -m
(e.g., arch=$(uname -m) then map to either "aarch64" or "x86_64" if needed) and
build the filename dynamically (e.g.,
VERSION_FILE="Makefile.version.${arch}.var"), then use that variable in the
awk/sed pipeline that sets MICROSHIFT_VERSION so the correct version file is
read for both x86_64 and aarch64 builds.
- Line 53: The MICROSHIFT_VERSION assignment uses the local date command which
yields non-deterministic timestamps across time zones; update the date
invocation in the MICROSHIFT_VERSION assignment (the line setting
MICROSHIFT_VERSION) to use UTC by adding the -u flag to date so the timestamp is
generated in UTC and RPM EVR ordering is consistent across builders.

---

Nitpick comments:
In `@src/image/build-rpms.sh`:
- Line 56: The example comment showing the version transformation is misleading
because it shows hyphen separators in the original but the script converts those
to underscores in the final string; update the commented example so the
transformed version matches the actual output (use underscores where the script
replaces hyphens), e.g. adjust the example string containing
"4.21.0-202511271015-ga9cd00b34_4.21.0_okd_scos.ec.5" so the post-transformation
portion reflects underscores exactly as produced by the script.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8b612bde-20bf-4d1c-942b-c51aa1432a44

📥 Commits

Reviewing files that changed from the base of the PR and between 4eae229 and 4e94d5a.

📒 Files selected for processing (4)
  • .github/workflows/copr-build-and-test.yaml
  • .github/workflows/copr-experimental.yaml
  • .github/workflows/copr-nightly.yaml
  • src/image/build-rpms.sh

Comment thread src/image/build-rpms.sh Outdated
Comment thread src/image/build-rpms.sh Outdated
@pmtk pmtk force-pushed the correct-rpm-version branch from 4e94d5a to bbe71d5 Compare March 25, 2026 09:45
@pmtk pmtk merged commit c2e15e2 into microshift-io:main Mar 27, 2026
14 checks passed
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.

Lack of build-datetime in RPM version causes unexpected ordering

2 participants