Files
copr-publish/README.md
rob thijssen 95973e731b fix: stop waiting past the runner's step limit and calling it a failure
The verdict logic was right; the waiting was impossible. Gitea's runner kills
a step at ~15 minutes. monsoon runs 56 and 60 stopped producing output at
14m29s and 14m30s after step start — within one second of each other, with
perfectly regular 31s heartbeats right up to the cut — while their COPR builds
carried on and succeeded at 10:15:20 and 11:34:55. The job was then marked
failed by a reaper ticking at :05:50/:20:50/:35:50/:50:50.

So the step was never going to survive a ~25 minute build, and every fix so
far addressed a real defect that was not this one.

Default the wait budget to 720s, comfortably inside the limit, and change what
expiry means: a build still running is reported with its URL and exits 0,
because it has not failed. A build that reaches failed or canceled inside the
budget still fails the job, which catches the early failures that make up most
build breakage. Skip the artifact download entirely when the build has not
finished, since there is nothing to fetch and no time to spend.

The trade is explicit: a build that fails after the budget will not be caught
by CI. That is strictly better than the previous behaviour of failing every
successful build and blocking dependent jobs.
2026-08-07 14:49:09 +03:00

3.2 KiB

copr-publish

Gitea composite action that submits a source RPM to Fedora COPR, watches the build, and dumps each chroot's builder-live.log into the CI output as collapsible groups.

Why use this

copr-cli build by itself only prints status transitions (pending / importing / running / succeeded). When a build fails you have to click through to the COPR web UI to see the actual log. This action:

  • Submits with --nowait and captures the build ID.
  • Prints a clickable https://copr.fedorainfracloud.org/coprs/build/... link so you can follow live.
  • Streams status transitions from copr-cli watch-build while polling COPR for the build's actual state, so the job's verdict comes from the build rather than from the health of a long-lived connection.
  • On completion, fetches each chroot's builder-live.log via copr-cli download-build and emits them as ::group:: blocks.
  • Fails CI if the build fails. A build merely still running when the wait budget expires is reported, not failed.
  • Returns within COPR_WAIT_BUDGET whatever happens, so the step finishes before a CI runner's step limit kills it.

Environment overrides

Variable Default Purpose
COPR_WAIT_BUDGET 720 Seconds to wait for the build before returning. A build still running at expiry is reported as such and the step exits 0 — CI runners commonly kill a step long before a large build finishes.
COPR_POLL_INTERVAL 30 Seconds between build-state polls.

Requirements

The runner must already have:

  • copr-cli on PATH (provided by the copr-cli RPM on Fedora runners).
  • grep -P (PCRE, default on Fedora).

Inputs

Input Required Description
project yes COPR project in the form <owner>/<project>, e.g. helexa/cortex.
srpm yes Path or glob to the source RPM(s) to submit, e.g. *.src.rpm.
copr-config yes Contents of ~/.config/copr. Fetch from https://copr.fedorainfracloud.org/api/ and store as a repo or org secret.

Usage

jobs:
  publish:
    runs-on: fedora
    steps:
      - uses: actions/download-artifact@v3
        with:
          name: my-srpm

      - name: Publish to COPR
        uses: https://git.lair.cafe/actions/copr-publish@v1
        with:
          project: helexa/cortex
          srpm: '*.src.rpm'
          copr-config: ${{ secrets.COPR_CONFIG }}

Note the fully-qualified URL in uses: — the Gitea instance's DEFAULT_ACTIONS_URL points at github.com, so internal actions must be referenced by absolute URL.

Versioning

Pin to a major version tag (@v1) for automatic patch/minor updates. Pin to an exact tag (@v1.0.3) to freeze.

Obtaining COPR_CONFIG

  1. Log in to https://copr.fedorainfracloud.org/.
  2. Visit https://copr.fedorainfracloud.org/api/.
  3. Copy the entire [copr-cli] config block.
  4. Save as a Gitea secret named COPR_CONFIG in the consuming repo (or at org level to share across all org repos).