Skip to content

Conversation

@pmtk
Copy link
Contributor

@pmtk pmtk commented Jan 29, 2026

Closes #195

Summary by CodeRabbit

  • New Features

    • Support for installing nightly MicroShift RPMs from COPR and a configurable RPM source selection.
  • Documentation

    • Quick Start and install docs updated with COPR nightly link, explicit nightly installation examples, and preserved non-nightly instructions.
    • Clarified that either microshift-kindnet or microshift-networking is required for networking.

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

@pmtk pmtk requested a review from a team as a code owner January 29, 2026 15:58
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds COPR/nightly RPM installation support: new RPM_SOURCE and COPR_REPO env vars, refactors quickrpm.sh to fetch helper scripts and branch install flows (github vs copr-nightly), and extends repo creation tooling with create_rhocp_repo and create_local_microshift_repo; updates docs to document COPR/nightly installs and networking requirements. (49 words)

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/run.md
Add COPR nightly link and explicit example for RPM_SOURCE=copr-nightly; replace prior local/releases RPM install flow in docs with COPR-based nightly workflow; note that microshift-kindnet/microshift-networking are mandatory.
Installer script
src/quickrpm.sh
Introduce public env vars RPM_SOURCE (default github) and COPR_REPO; add download_script(), install_microshift_packages(), install_rpms_copr(), install_rpms(); conditional tag resolution and case-based install flow for github vs copr-nightly.
Repo creation
src/rpm/create_repos.sh
Add create_rhocp_repo() and create_local_microshift_repo(); parameterize repo file naming via variables; add -rhocp-mirror option and refactor create/delete flows to preserve COPR/RHOC P repo handling.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Quick as quickrpm.sh
    participant Downloader as download_script()
    participant Repos as create_repos.sh
    participant COPR as COPR
    participant DNF as dnf

    User->>Quick: RPM_SOURCE=copr-nightly ./quickrpm.sh
    Quick->>Downloader: fetch create_repos.sh
    Downloader-->>Quick: provide create_repos.sh
    Quick->>Downloader: fetch postinstall.sh
    Downloader-->>Quick: provide postinstall.sh
    Quick->>Repos: request enable COPR / create RHOC P mirror (-rhocp-mirror)
    Repos->>COPR: query nightly repo/version metadata
    COPR-->>Repos: return metadata
    Repos-->>Quick: repo files created
    Quick->>DNF: install microshift packages from COPR
    DNF-->>Quick: install results
    Quick->>Quick: run postinstall.sh / start service
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • ggiguash
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly and concisely summarizes the main change: updating documentation and scripts to support COPR-based installation.
Linked Issues check ✅ Passed PR addresses issue #195 by documenting COPR installation workflow with dependency handling via RHOCP mirror and COPR-specific installation steps.
Out of Scope Changes check ✅ Passed All changes directly support COPR installation: documentation updates, script refactoring for RPM source selection, and repository management functions.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

Copy link

@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

🤖 Fix all issues with AI agents
In `@src/quickrpm.sh`:
- Line 79: Fix the typo in the comment: replace the misspelled word "greeboot"
with "greenboot" in src/quickrpm.sh (the comment line containing "# Fedora
doesn't have old packages - downgrading greeboot is not possible."). Ensure the
corrected comment reads "# Fedora doesn't have old packages - downgrading
greenboot is not possible." so it's clear and accurate.

docs/run.md Outdated
```bash
sudo dnf copr enable -y @microshift-io/microshift-nightly
XY=$(sudo dnf repoquery --repo='copr*microshift-nightly' --qf '%{VERSION}' microshift --latest-limit=1 2>/dev/null | cut -d. -f1,2)
sudo ./src/rpm/create_repos.sh -rhocp-mirror "${XY}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of exposing this logic, can we add -copr command line which does this inside the create_repos.sh script?

Copy link

@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

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 53-57: The README's installation snippet uses "sudo
RPM_SOURCE=copr-nightly bash" which can lose the RPM_SOURCE env var under sudo;
update the command in the README to use "sudo env RPM_SOURCE=copr-nightly bash"
so the RPM_SOURCE is preserved when invoking the quickrpm.sh script (update the
code block that currently contains "curl -s
https://microshift-io.github.io/microshift/quickrpm.sh | sudo
RPM_SOURCE=copr-nightly bash" to the env-preserving form).

In `@src/quickrpm.sh`:
- Around line 62-78: The download_script function uses an undefined variable
scriptdir when copying the local RPM script which breaks under set -u; update
the local-copy cp invocation to use the already-defined curscriptdir (i.e.,
replace "${scriptdir}/../${scriptpath}" with "${curscriptdir}/../${scriptpath}")
so the local path check and copy succeed.

Copy link

@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

🧹 Nitpick comments (1)
src/rpm/create_repos.sh (1)

74-81: Consider preserving stderr for debugging failed queries.

Redirecting stderr to /dev/null on line 75 hides potential dnf errors that could help diagnose why version detection fails.

♻️ Suggested improvement
--rhocp-mirror)
-    repo_version=$(dnf repoquery --qf '%{VERSION}' --latest-limit=1 microshift 2>/dev/null | cut -d. -f1,2)
+    repo_version=$(dnf repoquery --qf '%{VERSION}' --latest-limit=1 microshift | cut -d. -f1,2)
     if [ -z "${repo_version}" ] ; then
         echo "ERROR: Failed to find version of MicroShift available in the repositories"
         usage

Comment on lines +13 to +25
function create_rhocp_repo() {
local -r repo_version=$1

cat > "${USHIFT_LOCAL_REPO_FILE}" <<EOF
[microshift-local]
name=MicroShift Local Repository
baseurl=${repo_path}
local -r file="${YUM_REPOS_D}/${OCP_MIRROR_REPO_FILE_PREFIX}-${repo_version}.repo"
cat > "${file}" <<EOF
[openshift-mirror-beta]
name=OpenShift Mirror Beta Repository
baseurl=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/dependencies/rpms/${repo_version}-el9-beta/
enabled=1
gpgcheck=0
skip_if_unavailable=0
EOF
}
Copy link

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:

# First, find README and documentation about OS requirements
find . -type f \( -name "README*" -o -name "*.md" \) | head -20

Repository: microshift-io/microshift

Length of output: 328


🏁 Script executed:

# Search for references to OS version or RHEL/CentOS requirements
rg -i "RHEL|CentOS|Fedora|OS.version|el[0-9]" --type md --type txt | head -20

Repository: microshift-io/microshift

Length of output: 1307


🏁 Script executed:

# Check for other el9-beta references
rg "el9-beta" --type sh

Repository: microshift-io/microshift

Length of output: 357


🏁 Script executed:

# Check the context of create_repos.sh - where is it used?
rg "create_repos\.sh|create_rhocp_repo" --type sh

Repository: microshift-io/microshift

Length of output: 493


🏁 Script executed:

# Look for OS version detection in build scripts
rg "uname|version_id|os.release" --type sh -A 2 | head -30

Repository: microshift-io/microshift

Length of output: 1290


Hardcoded el9-beta will break on CentOS 10 and Fedora.

The baseurl hardcodes el9-beta, but README.md lists CentOS 10 and Fedora as supported platforms. CentOS 10 would require el10-beta, and other versions have different suffixes. Derive the OS suffix dynamically (similar to how quickrpm.sh detects OS versions via /etc/os-release) or constrain this script to RHEL 9/CentOS 9 only.

Note: The same issue exists in ansible/roles/microshift-okd-bootc/files/create_repos.sh.

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.

Document RPM installation from COPR

2 participants