Skip to content

microshift-io/microshift-nightly COPR: RPM with rhocp-mirror-beta config & CNIs#203

Open
pmtk wants to merge 5 commits intomicroshift-io:mainfrom
pmtk:copr-deps-2
Open

microshift-io/microshift-nightly COPR: RPM with rhocp-mirror-beta config & CNIs#203
pmtk wants to merge 5 commits intomicroshift-io:mainfrom
pmtk:copr-deps-2

Conversation

@pmtk
Copy link
Contributor

@pmtk pmtk commented Feb 15, 2026

Addresses: #165

Summary by CodeRabbit

  • New Features

    • Added workflow dispatch input to specify custom COPR repository names for builds.
    • Automated building and publishing of CNI plugins and MicroShift dependencies packages.
  • Documentation

    • Updated installation instructions to use simplified dependency repository setup via package manager instead of previous mirror configuration approach.
  • Chores

    • Enhanced build automation infrastructure for COPR package management.

@pmtk pmtk requested a review from a team as a code owner February 15, 2026 18:49
@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

📝 Walkthrough

Walkthrough

This PR automates the building and publishing of MicroShift dependencies and CNI plugins RPMs through COPR, introduces a new parameterized GitHub workflow to support dynamic COPR repository selection, and updates the installation process to use a dedicated dependency repository package instead of repository creation scripts.

Changes

Cohort / File(s) Summary
Workflow orchestration
.github/workflows/nightly-copr.yaml
Added workflow_dispatch input for dynamic COPR repository name selection and introduced build-dependencies-rpm job that builds dependencies and CNI plugins RPMs using detected OKD version tags and COPR integration.
CNI plugins build
src/copr/cni/build.sh, src/copr/cni/containernetworking-plugins.spec
New scripts to fetch containernetworking-plugins releases, package prebuilt binaries for amd64/arm64 architectures, and publish RPMs to COPR with automated repository regeneration.
Dependencies package
src/copr/microshift-io-dependencies.sh
New script that dynamically generates RPM spec files for MicroShift dependencies by extracting OKD version, querying RHOCp versions, and publishing to COPR with package existence checks.
COPR infrastructure
src/copr/copr.mk, src/copr/copr-cli.Containerfile, src/copr/create-build.sh
Added copr-dependencies and copr-cni Makefile targets; updated Containerfile to install jq and rpmbuild and copy build scripts; refactored COPR CLI invocations to use secret mounting with target paths.
Installation and documentation
docs/run.md, src/quickrpm.sh
Replaced repository creation script invocation with direct dnf installation of microshift-io-dependencies-repo package; removed COPR mirror setup guidance and cleanup commands.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ggiguash
  • pacevedom
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: adding RPM packages for rhocp-mirror-beta configuration and CNI plugins to the COPR workflow.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

🤖 Fix all issues with AI agents
In `@docs/run.md`:
- Around line 44-47: Replace the incorrect package name
"microshift-io-dependencies-repo" in the installation command with the correct
package "microshift-io-dependencies" so the docs match the spec and quickrpm.sh
usage; update the line that currently runs sudo dnf install -y
microshift-io-dependencies-repo to sudo dnf install -y
microshift-io-dependencies in docs/run.md.

In `@src/copr/cni/build.sh`:
- Around line 50-59: The unquoted ${version} variable is used in several path
constructions (mkdir, tar -C, cp, tar czf, mv) in build.sh and triggers
shellcheck SC2086; update every occurrence to use quoted expansions like
"${version}" (e.g., containernetworking-plugins-"${version}"/x86_64) so paths
with spaces or glob chars are safe, and ensure all related commands (mkdir, tar
-C, cp, tar czf, mv) reference the quoted form consistently.

In `@src/copr/copr-cli.Containerfile`:
- Around line 3-7: The RUN installation line installs the wrong package name
"rpmbuild"; replace it with the correct Fedora package "rpm-build" in the RUN
command that installs "copr-cli jq rpmbuild" (so the token "rpmbuild" in that
RUN should be changed to "rpm-build") and keep the rest of the flags and cleanup
unchanged.

In `@src/copr/copr.mk`:
- Around line 120-126: The copr-cni make target is missing a .PHONY declaration,
uses the interactive -ti flags in the podman run, and the file lacks a final
newline; update the Makefile to add copr-cni to the .PHONY list (alongside other
phony targets), remove the -ti flags from the podman run invocation in the
copr-cni recipe so it runs non-interactively, and ensure the file ends with a
trailing newline character so POSIX tools behave correctly.
- Around line 112-118: Add a .PHONY declaration for the copr-dependencies
target, remove the interactive TTY flags (-ti) from the podman run invocation
(use --rm only, or gate -t behind a tty check if colored output is needed), and
document or provide a default for OKD_VERSION_TAG in the Makefile variables/help
section so the copr-dependencies target has a defined value; update references
to COPR_SECRET_NAME and COPR_CLI_IMAGE only as needed to match the existing
variable names.

In `@src/copr/microshift-io-dependencies.sh`:
- Around line 26-37: The if condition incorrectly uses command substitution
causing SC2091 (if $(...) executes stdout rather than the pipeline exit status);
change the condition to test the pipeline directly—invoke the pipeline starting
with copr-cli list-packages "${COPR_REPO_NAME}" | jq -r '.[].name' | grep -q
"${_package_name}" in the if statement (without $()), so the exit code controls
the branch; keep the inner logic that sets existing_package_version (from
copr-cli get-package ... | jq -r
'.latest_succeeded_build.source_package.version') and compares it to
"${pkg_version}-1" as before.
- Around line 88-91: The script currently calls copr-cli build with a local
.spec path (copr-cli build "${COPR_REPO_NAME}" "${dest}/${_package_name}.spec"),
but copr-cli expects an SRPM or URL; change the flow to create an SRPM from the
spec (e.g., run rpmbuild -ba /path/to/"${_package_name}.spec" or the project's
SRPM build command to produce an .src.rpm) and then call copr-cli build with
that SRPM path (copr-cli build "${COPR_REPO_NAME}"
"/path/to/${_package_name}-*.src.rpm"); keep the subsequent copr-cli
regenerate-repos call the same. Ensure variables (COPR_REPO_NAME, dest,
_package_name) are used to locate the produced SRPM.
🧹 Nitpick comments (3)
src/copr/copr-cli.Containerfile (1)

9-10: containernetworking-plugins.spec is copied to both / and /cni/.

Line 9 copies the spec to / and line 10 copies it again to /cni/. The build.sh script references it relative to its own directory ($_scriptdir), which is /cni/. The copy to / on line 9 appears redundant.

Proposed fix
-COPY create-build.sh microshift-io-dependencies.sh cni/containernetworking-plugins.spec /
+COPY create-build.sh microshift-io-dependencies.sh /
 COPY cni/build.sh cni/containernetworking-plugins.spec /cni/
src/copr/microshift-io-dependencies.sh (1)

73-74: gpgcheck=0 disables signature verification on the repo.

The generated .repo files disable GPG checking. If this is intentional for beta mirrors, consider adding a comment in the spec explaining why.

src/copr/cni/build.sh (1)

41-42: No cleanup trap for temp_dir on early exit.

If the script fails between mktemp and the final rm -rf, the temp directory persists. Not critical in CI containers, but a trap would be more robust.

Suggested addition after line 41
 temp_dir="$(mktemp -d "/tmp/containernetworking-plugins-${version}.XXXXXX")"
+trap 'rm -rf "${temp_dir}"' EXIT
 cp "${_scriptdir}/containernetworking-plugins.spec" "${temp_dir}/"

Comment on lines +44 to 47
# microshift-io-dependencies must be installed
# before microshift in order to setup dependencies repositories.
sudo dnf install -y microshift-io-dependencies-repo
sudo dnf install -y microshift microshift-kindnet
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, check the current state of docs/run.md around lines 44-47
head -n 50 docs/run.md | tail -n 20

Repository: microshift-io/microshift

Length of output: 680


🏁 Script executed:

# Search for microshift-io-dependencies references across the codebase
rg "microshift-io-dependencies" -n --max-count=20

Repository: microshift-io/microshift

Length of output: 565


🏁 Script executed:

# Check quickrpm.sh for the package name being installed
rg -A 5 -B 5 "microshift-io-dependencies" src/quickrpm.sh

Repository: microshift-io/microshift

Length of output: 288


🏁 Script executed:

# Look for any -repo suffix variants
rg "microshift-io-dependencies-repo" -n

Repository: microshift-io/microshift

Length of output: 134


Fix package name in installation command.

Line 46 references microshift-io-dependencies-repo, but the actual package is microshift-io-dependencies (as defined in the spec and used in quickrpm.sh line 101).

Change required
-sudo dnf install -y microshift-io-dependencies-repo
+sudo dnf install -y microshift-io-dependencies
📝 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
# microshift-io-dependencies must be installed
# before microshift in order to setup dependencies repositories.
sudo dnf install -y microshift-io-dependencies-repo
sudo dnf install -y microshift microshift-kindnet
# microshift-io-dependencies must be installed
# before microshift in order to setup dependencies repositories.
sudo dnf install -y microshift-io-dependencies
sudo dnf install -y microshift microshift-kindnet
🤖 Prompt for AI Agents
In `@docs/run.md` around lines 44 - 47, Replace the incorrect package name
"microshift-io-dependencies-repo" in the installation command with the correct
package "microshift-io-dependencies" so the docs match the spec and quickrpm.sh
usage; update the line that currently runs sudo dnf install -y
microshift-io-dependencies-repo to sudo dnf install -y
microshift-io-dependencies in docs/run.md.

Comment on lines +50 to +59
mkdir -p containernetworking-plugins-${version}/{x86_64,aarch64}

tar xf amd64.tgz -C containernetworking-plugins-${version}/x86_64
tar xf arm64.tgz -C containernetworking-plugins-${version}/aarch64
cp containernetworking-plugins-${version}/x86_64/LICENSE containernetworking-plugins-${version}/x86_64/README.md containernetworking-plugins-${version}/

tar czf containernetworking-plugins-${version}.tar.gz -C containernetworking-plugins-${version} .

mkdir -p buildroot/{RPMS,SRPMS,SOURCES,SPECS,BUILD}
mv containernetworking-plugins-${version}.tar.gz buildroot/SOURCES/
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

Quote ${version} to fix SC2086 shellcheck warnings.

Multiple unquoted uses of ${version} in path constructions.

Proposed fix
-mkdir -p containernetworking-plugins-${version}/{x86_64,aarch64}
+mkdir -p "containernetworking-plugins-${version}"/{x86_64,aarch64}
 
-tar xf amd64.tgz -C containernetworking-plugins-${version}/x86_64
-tar xf arm64.tgz -C containernetworking-plugins-${version}/aarch64
-cp containernetworking-plugins-${version}/x86_64/LICENSE containernetworking-plugins-${version}/x86_64/README.md containernetworking-plugins-${version}/
+tar xf amd64.tgz -C "containernetworking-plugins-${version}/x86_64"
+tar xf arm64.tgz -C "containernetworking-plugins-${version}/aarch64"
+cp "containernetworking-plugins-${version}/x86_64/LICENSE" "containernetworking-plugins-${version}/x86_64/README.md" "containernetworking-plugins-${version}/"
 
-tar czf containernetworking-plugins-${version}.tar.gz -C containernetworking-plugins-${version} .
+tar czf "containernetworking-plugins-${version}.tar.gz" -C "containernetworking-plugins-${version}" .
 
 mkdir -p buildroot/{RPMS,SRPMS,SOURCES,SPECS,BUILD}
-mv containernetworking-plugins-${version}.tar.gz buildroot/SOURCES/
+mv "containernetworking-plugins-${version}.tar.gz" buildroot/SOURCES/

As per coding guidelines, shell scripts should pass linting with shellcheck.

📝 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
mkdir -p containernetworking-plugins-${version}/{x86_64,aarch64}
tar xf amd64.tgz -C containernetworking-plugins-${version}/x86_64
tar xf arm64.tgz -C containernetworking-plugins-${version}/aarch64
cp containernetworking-plugins-${version}/x86_64/LICENSE containernetworking-plugins-${version}/x86_64/README.md containernetworking-plugins-${version}/
tar czf containernetworking-plugins-${version}.tar.gz -C containernetworking-plugins-${version} .
mkdir -p buildroot/{RPMS,SRPMS,SOURCES,SPECS,BUILD}
mv containernetworking-plugins-${version}.tar.gz buildroot/SOURCES/
mkdir -p "containernetworking-plugins-${version}"/{x86_64,aarch64}
tar xf amd64.tgz -C "containernetworking-plugins-${version}/x86_64"
tar xf arm64.tgz -C "containernetworking-plugins-${version}/aarch64"
cp "containernetworking-plugins-${version}/x86_64/LICENSE" "containernetworking-plugins-${version}/x86_64/README.md" "containernetworking-plugins-${version}/"
tar czf "containernetworking-plugins-${version}.tar.gz" -C "containernetworking-plugins-${version}" .
mkdir -p buildroot/{RPMS,SRPMS,SOURCES,SPECS,BUILD}
mv "containernetworking-plugins-${version}.tar.gz" buildroot/SOURCES/
🧰 Tools
🪛 GitHub Actions: linters

[warning] 50-50: SC2086: Double quote to prevent globbing and word splitting.


[warning] 52-52: SC2086: Double quote to prevent globbing and word splitting.


[warning] 53-53: SC2086: Double quote to prevent globbing and word splitting.


[warning] 54-54: SC2086: Double quote to prevent globbing and word splitting.


[warning] 54-54: SC2086: Double quote to prevent globbing and word splitting.


[warning] 56-56: SC2086: Double quote to prevent globbing and word splitting.


[warning] 56-56: SC2086: Double quote to prevent globbing and word splitting.


[warning] 59-59: SC2086: Double quote to prevent globbing and word splitting.

🤖 Prompt for AI Agents
In `@src/copr/cni/build.sh` around lines 50 - 59, The unquoted ${version} variable
is used in several path constructions (mkdir, tar -C, cp, tar czf, mv) in
build.sh and triggers shellcheck SC2086; update every occurrence to use quoted
expansions like "${version}" (e.g.,
containernetworking-plugins-"${version}"/x86_64) so paths with spaces or glob
chars are safe, and ensure all related commands (mkdir, tar -C, cp, tar czf, mv)
reference the quoted form consistently.

Comment on lines +3 to +7
RUN dnf install \
--setopt=install_weak_deps=False \
-y \
copr-cli jq rpmbuild \
&& dnf clean all
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Fedora dnf package rpmbuild rpm-build

💡 Result:

On Fedora, the rpmbuild command is provided by the rpm-build package. [1]

sudo dnf install rpm-build

To confirm on your system:

dnf provides '*/rpmbuild'

Use rpm-build instead of rpmbuild.

On Fedora, the rpmbuild binary is provided by the rpm-build package. dnf install rpmbuild will fail.

Proposed fix
 RUN dnf install \
         --setopt=install_weak_deps=False \
         -y \
-        copr-cli jq rpmbuild \
+        copr-cli jq rpm-build \
     && dnf clean all
📝 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
RUN dnf install \
--setopt=install_weak_deps=False \
-y \
copr-cli jq rpmbuild \
&& dnf clean all
RUN dnf install \
--setopt=install_weak_deps=False \
-y \
copr-cli jq rpm-build \
&& dnf clean all
🤖 Prompt for AI Agents
In `@src/copr/copr-cli.Containerfile` around lines 3 - 7, The RUN installation
line installs the wrong package name "rpmbuild"; replace it with the correct
Fedora package "rpm-build" in the RUN command that installs "copr-cli jq
rpmbuild" (so the token "rpmbuild" in that RUN should be changed to "rpm-build")
and keep the rest of the flags and cleanup unchanged.

Comment on lines +112 to +118
copr-dependencies: copr-cfg-ensure-podman-secret copr-cli
@echo "Building RPM with MicroShift dependencies repositories configuration"
sudo podman run \
--rm -ti \
--secret ${COPR_SECRET_NAME},target=/root/.config/copr \
"${COPR_CLI_IMAGE}" \
/microshift-io-dependencies.sh "${OKD_VERSION_TAG}" "${COPR_REPO_NAME}"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Missing .PHONY and -ti will break in CI.

  1. Add .PHONY: copr-dependencies — every other target in this file declares it.
  2. -ti allocates a TTY + interactive stdin. GitHub Actions runners have no TTY, so this will fail or emit warnings. The other targets in this file use only --rm. Drop -ti (or use -t only if truly needed for colored output, gated on [ -t 0 ]).
  3. OKD_VERSION_TAG is undocumented in the help target and has no default — consider adding it to the variables section.
Proposed fix
+.PHONY: copr-dependencies
 copr-dependencies: copr-cfg-ensure-podman-secret copr-cli
 	`@echo` "Building RPM with MicroShift dependencies repositories configuration"
 	sudo podman run \
-		--rm -ti \
+		--rm \
 		--secret ${COPR_SECRET_NAME},target=/root/.config/copr \
 		"${COPR_CLI_IMAGE}" \
 		/microshift-io-dependencies.sh "${OKD_VERSION_TAG}" "${COPR_REPO_NAME}"
🤖 Prompt for AI Agents
In `@src/copr/copr.mk` around lines 112 - 118, Add a .PHONY declaration for the
copr-dependencies target, remove the interactive TTY flags (-ti) from the podman
run invocation (use --rm only, or gate -t behind a tty check if colored output
is needed), and document or provide a default for OKD_VERSION_TAG in the
Makefile variables/help section so the copr-dependencies target has a defined
value; update references to COPR_SECRET_NAME and COPR_CLI_IMAGE only as needed
to match the existing variable names.

Comment on lines +120 to +126
copr-cni: copr-cfg-ensure-podman-secret copr-cli
@echo "Building RPM with CNI plugins"
sudo podman run \
--rm -ti \
--secret ${COPR_SECRET_NAME},target=/root/.config/copr \
"${COPR_CLI_IMAGE}" \
/cni/build.sh "${COPR_REPO_NAME}"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Same issues: missing .PHONY and -ti; also no trailing newline.

Same fixes as copr-dependencies above. Additionally, the file lacks a final newline which can cause POSIX tools to misbehave.

Proposed fix
+.PHONY: copr-cni
 copr-cni: copr-cfg-ensure-podman-secret copr-cli
 	`@echo` "Building RPM with CNI plugins"
 	sudo podman run \
-		--rm -ti \
+		--rm \
 		--secret ${COPR_SECRET_NAME},target=/root/.config/copr \
 		"${COPR_CLI_IMAGE}" \
 		/cni/build.sh "${COPR_REPO_NAME}"
+
🤖 Prompt for AI Agents
In `@src/copr/copr.mk` around lines 120 - 126, The copr-cni make target is missing
a .PHONY declaration, uses the interactive -ti flags in the podman run, and the
file lacks a final newline; update the Makefile to add copr-cni to the .PHONY
list (alongside other phony targets), remove the -ti flags from the podman run
invocation in the copr-cni recipe so it runs non-interactively, and ensure the
file ends with a trailing newline character so POSIX tools behave correctly.

Comment on lines +26 to +37
if $(copr-cli list-packages "${COPR_REPO_NAME}" | jq -r '.[].name' | grep -q "${_package_name}"); then
existing_package_version=$(copr-cli get-package \
--name "${_package_name}" \
--with-latest-succeeded-build \
"${COPR_REPO_NAME}" \
| jq -r '.latest_succeeded_build.source_package.version')

if [[ "${existing_package_version}" == "${pkg_version}-1" ]]; then
echo "Package ${_package_name} ${pkg_version} already exists in the COPR repository"
exit 0
fi
fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Bug: if $(...) always evaluates to true (SC2091).

The $() captures stdout (empty from grep -q) and tries to execute it as a command. An empty command succeeds, so this if is always true — the version-existence check never gates anything.

Remove the $() wrapper so if tests the pipeline's exit code directly:

Proposed fix
-if $(copr-cli list-packages "${COPR_REPO_NAME}" | jq -r '.[].name' | grep -q "${_package_name}"); then
+if copr-cli list-packages "${COPR_REPO_NAME}" | jq -r '.[].name' | grep -q "${_package_name}"; then

As per coding guidelines, shell scripts should pass linting with shellcheck.

🧰 Tools
🪛 GitHub Actions: linters

[warning] 26-26: SC2091: Remove surrounding $() to avoid executing output (or use eval if intentional).

🤖 Prompt for AI Agents
In `@src/copr/microshift-io-dependencies.sh` around lines 26 - 37, The if
condition incorrectly uses command substitution causing SC2091 (if $(...)
executes stdout rather than the pipeline exit status); change the condition to
test the pipeline directly—invoke the pipeline starting with copr-cli
list-packages "${COPR_REPO_NAME}" | jq -r '.[].name' | grep -q
"${_package_name}" in the if statement (without $()), so the exit code controls
the branch; keep the inner logic that sets existing_package_version (from
copr-cli get-package ... | jq -r
'.latest_succeeded_build.source_package.version') and compares it to
"${pkg_version}-1" as before.

Comment on lines +88 to +91
if copr-cli build "${COPR_REPO_NAME}" "${dest}/${_package_name}.spec"; then
copr-cli regenerate-repos "${COPR_REPO_NAME}"
else
exit 1
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

copr-cli build .spec file SRPM input format documentation

💡 Result:

copr-cli build primarily takes an SRPM as its input (either a local file path or an HTTP(S) URL): copr-cli build <project> <path-or-url-to>.src.rpm. [1]

For a .spec file, COPR supports it as a build source too:

  • URL to a .spec file: you can pass a public HTTPS URL to a .spec; COPR will then download the referenced sources (from public HTTPS locations) and build an SRPM first, then build RPMs from that SRPM. [2]
  • Direct upload of a local .spec: COPR also supports uploading a local .spec (or SRPM) via copr-cli / web UI (“Direct Upload” source type). [2]

If what you actually have is a Git repo with the spec+sources, use the SCM source type (build from Git/SVN/DistGit and have COPR generate the SRPM using rpkg/tito/make srpm). [2]

Docs to read (most relevant sections):

  • Fedora Developer Portal “Copr command line interface” (shows copr-cli build with SRPM path/URL). [1]
  • COPR “User Documentation → Build Source Types” (URLs / Direct Upload / SCM; includes .spec via URL and local .spec upload). [2]

Sources: [1] [2]


🏁 Script executed:

# Check the context around line 88-91 in the file
sed -n '80,100p' src/copr/microshift-io-dependencies.sh

Repository: microshift-io/microshift

Length of output: 426


🏁 Script executed:

# Check if there's any SRPM generation earlier in the script
head -n 87 src/copr/microshift-io-dependencies.sh | tail -n 20

Repository: microshift-io/microshift

Length of output: 602


copr-cli build cannot accept a local .spec file directly.

According to COPR documentation, copr-cli build expects an SRPM (local path or HTTP(S) URL), not a raw .spec file. Passing a local .spec file path will fail at runtime. Either build an SRPM first and pass that, or provide a URL to the .spec file so COPR can download sources and generate the SRPM itself.

🤖 Prompt for AI Agents
In `@src/copr/microshift-io-dependencies.sh` around lines 88 - 91, The script
currently calls copr-cli build with a local .spec path (copr-cli build
"${COPR_REPO_NAME}" "${dest}/${_package_name}.spec"), but copr-cli expects an
SRPM or URL; change the flow to create an SRPM from the spec (e.g., run rpmbuild
-ba /path/to/"${_package_name}.spec" or the project's SRPM build command to
produce an .src.rpm) and then call copr-cli build with that SRPM path (copr-cli
build "${COPR_REPO_NAME}" "/path/to/${_package_name}-*.src.rpm"); keep the
subsequent copr-cli regenerate-repos call the same. Ensure variables
(COPR_REPO_NAME, dest, _package_name) are used to locate the produced SRPM.

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.

1 participant