rob thijssen 3701a483af fix: take the build verdict from COPR, not from watch-build
`copr-cli watch-build` holds a long-lived connection to COPR and can stop
responding while the build carries on and finishes normally. The script
treated its exit status as the build's outcome, so a watcher that lost its
connection was reported as a failed build.

Seen in monsoon run 48: COPR build 10835047 succeeded at 08:30:30, the
watcher went silent after 08:09:11, and the runner killed the step at
08:35:50. The job was marked failed even though the RPM built and published
fine, and that false failure also blocked the dependent version-bump job
from running at all.

Keep watch-build for its progress stream, but move it to the background,
bound it with a timeout, and ignore its exit code. Poll `copr-cli status`
for the authoritative state and derive the exit code from that. Polling also
means the script returns as soon as the build settles instead of waiting on
the watcher to notice.

succeeded and skipped (already built) pass; failed and canceled fail; and
never reaching a terminal state within COPR_BUILD_TIMEOUT is reported as a
timeout rather than silently as a build failure.

Adds tests/test-copr-build.sh, which drives the script against a stub
copr-cli. The regression case — hung watcher, successful build — fails
against the previous script by hanging until killed, which is the production
symptom.
2026-08-07 11:57:44 +03:00

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, but always dumps logs first.
  • Gives up after COPR_BUILD_TIMEOUT (default 7200s) and says so, rather than hanging until the runner kills the job.

Environment overrides

Variable Default Purpose
COPR_BUILD_TIMEOUT 7200 Seconds to wait for a build to reach a terminal state.
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).
Description
No description provided
Readme 102 KiB
Languages
Shell 100%