Skip to content

fix(copr): remove stale pinned image digest and rebuild copr image on Dockerfile changes#9451

Merged
jdx merged 3 commits intojdx:mainfrom
bestagi:fix/copr-publish-stale-image-digest
Apr 29, 2026
Merged

fix(copr): remove stale pinned image digest and rebuild copr image on Dockerfile changes#9451
jdx merged 3 commits intojdx:mainfrom
bestagi:fix/copr-publish-stale-image-digest

Conversation

@bestagi
Copy link
Copy Markdown
Contributor

@bestagi bestagi commented Apr 28, 2026

Problem

After #9421 was merged (which fixed copr-cli installation by switching from pip3 install copr-cli to dnf install -y copr-cli), the copr-publish workflow continued to fail with the exact same error:

ModuleNotFoundError: No module named 'rich'

Seen in: https://github.com/jdx/mise/actions/runs/25053108886/job/73385917506

Root cause

The copr-publish.yml workflow uses a hardcoded image digest:

container:
  image: ghcr.io/jdx/mise:copr@sha256:da63a0fcdf21a36be340dce61394b336113ea460b93aa9de2705bd7b35e5872e

This digest points to the old image built before the packaging/copr/Dockerfile was fixed. The docker.yml workflow only rebuilds images on tag pushes or workflow_dispatch — it does not trigger on commits to main. So even though the Dockerfile was fixed in #9421, the pinned digest in the workflow still referenced the broken pip-installed image.

Fix

1. copr-publish.yml — remove stale pinned digest

Replace:

image: ghcr.io/jdx/mise:copr@sha256:da63a0fcdf21a36be340dce61394b336113ea460b93aa9de2705bd7b35e5872e

With:

image: ghcr.io/jdx/mise:copr

This ensures the workflow always uses the latest built :copr image instead of a stale pinned version.

2. docker.yml — auto-rebuild copr image on Dockerfile changes

Add a push trigger scoped to packaging/copr/Dockerfile on main so the :copr image is automatically rebuilt and the tag updated whenever the Dockerfile changes. This prevents this class of stale-digest regression in the future.

on:
  push:
    tags: ["v[0-9]*"]
    paths:
      - "packaging/copr/Dockerfile"
    branches:
      - main

Testing

Once merged, re-run the copr-publish workflow — it will pull the latest :copr image (built from the fixed Dockerfile with dnf install -y copr-cli) and the rich module error will be gone.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@jdx
Copy link
Copy Markdown
Owner

jdx commented Apr 28, 2026

@greptileai I think this needs to be added to the renovate exclusions

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

You're right. Renovate uses helpers:pinGitHubActionDigests which will automatically re-pin ghcr.io/jdx/mise:copr with a digest the next time it runs — putting you right back in the same situation.

You should add a packageRule to .github/renovate.json to exclude this image:

  "packageRules": [
    {
      "description": "AWS SDK requires MSRV 1.91.1, project is 1.88.0. Re-enable when MSRV is bumped.",
      "matchPackageNames": ["aws-config", "aws-sdk-*"],
      "matchManagers": ["cargo"],
      "enabled": false
    },
    {
      "description": "copr image is rebuilt from source on Dockerfile changes; pinning a digest would cause stale image regressions.",
      "matchPackageNames": ["ghcr.io/jdx/mise"],
      "matchCurrentValue": "copr",
      "enabled": false
    }
  ]

This targets the ghcr.io/jdx/mise package only when the tag is copr, so Renovate won't touch it while still managing other images normally.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR fixes the copr-publish workflow by removing a stale hardcoded image digest that continued pointing to the broken pre-fix image even after packaging/copr/Dockerfile was corrected in #9421. It also adds a Renovate ignore rule to prevent the digest from being re-pinned in the future, and cleans up long-commented-out dev/dev-test job blocks from docker.yml.

  • The PR title and description promise automatic :copr image rebuilds on packaging/copr/Dockerfile changes, but the on: trigger in docker.yml was not modified — the workflow still only fires on version tags and workflow_dispatch, so that prevention mechanism is not yet in place.

Confidence Score: 5/5

Safe to merge — the core regression fix is correct and the only gap is a missing future-proofing trigger described in the title but not implemented.

No P0 or P1 findings. The one P2 observation (missing auto-rebuild trigger) is a future-proofing gap, not a current breakage. The primary fix (removing the stale digest) is sound, and the Renovate rule correctly prevents re-pinning.

docker.yml — the on: section was not updated despite the PR title implying it would be.

Important Files Changed

Filename Overview
.github/workflows/copr-publish.yml Removes stale pinned digest, workflow will now always pull the latest :copr tag — this is the primary bugfix.
.github/renovate.json Adds a Renovate ignore rule for ghcr.io/jdx/mise when the current tag is copr, preventing Renovate from re-introducing a pinned digest that would cause stale-image regressions.
.github/workflows/docker.yml Only removes long-commented-out dev/dev-test jobs; the on: trigger was not updated, so the auto-rebuild-on-Dockerfile-change behaviour described in the PR title is not actually implemented.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant GHCR as ghcr.io (GHCR)
    participant COPR as COPR Build

    Note over Dev,COPR: Before this PR (broken state)
    Dev->>GH: Push fix to packaging/copr/Dockerfile
    GH-->>GHCR: No rebuild triggered (only tags/workflow_dispatch)
    GH->>COPR: copr-publish uses stale digest → ModuleNotFoundError

    Note over Dev,COPR: After this PR (fixed state)
    Dev->>GH: Push release tag
    GH->>GHCR: docker.yml rebuilds :copr image
    GH->>COPR: copr-publish pulls latest :copr tag → success

    Note over Dev,COPR: Still missing (paths trigger not added)
    Dev->>GH: Push change to packaging/copr/Dockerfile on main
    GH-->>GHCR: No rebuild triggered (paths trigger absent)
    Note over GHCR: :copr tag stays at previous build until next tag push
Loading

Reviews (5): Last reviewed commit: "fix(copr): drop docker-copr.yml per main..." | Re-trigger Greptile

Comment thread .github/workflows/docker.yml
@jdx
Copy link
Copy Markdown
Owner

jdx commented Apr 28, 2026

Thanks for digging into this! I think the scope can be trimmed — the two essential changes are dropping the @sha256: pin in copr-publish.yml and the renovate rule. Those alone fix the bug.

The new docker-copr.yml isn't needed: copr-publish.yml runs on release: published, and releases push a v* tag which already triggers docker.yml to rebuild :copr. Once the pin is gone, the next release publishes a fresh image and copr-publish pulls it. For ad-hoc rebuilds between releases, workflow_dispatch on docker.yml already works.

Could you drop the docker-copr.yml addition and keep just the two-line copr-publish.yml change plus the renovate rule? That's a tight, easy-to-review fix.

This comment was generated by an AI coding assistant.

@bestagi
Copy link
Copy Markdown
Contributor Author

bestagi commented Apr 29, 2026

Thanks for the clear feedback, @jdx! You're absolutely right — the docker-copr.yml was redundant since v* tag pushes already trigger docker.yml to rebuild :copr, and workflow_dispatch covers ad-hoc cases.

I've just dropped docker-copr.yml in the latest commit (797b5ab). The PR now contains only the two essential changes:

  • copr-publish.yml: floating ghcr.io/jdx/mise:copr tag (no stale digest)
  • .github/renovate.json: packageRule to prevent Renovate from re-pinning the :copr tag

Should be a clean, easy-to-review diff now. Let me know if anything else needs adjusting!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Want your agent to iterate on Greptile's feedback? Try greploops.

@bestagi bestagi force-pushed the fix/copr-publish-stale-image-digest branch from 797b5ab to 7a565af Compare April 29, 2026 05:00
bestagi added 3 commits April 30, 2026 01:07
… changes

The copr-publish workflow was pinned to a stale image digest
(sha256:da63a0f...) that predated the fix in jdx#9421 which switched
copr-cli installation from pip3 to dnf. As a result, every copr-publish
run after the merge still used the old broken image and failed with:

  ModuleNotFoundError: No module named 'rich'

Fixes:
- Remove the pinned digest from copr-publish.yml so the mutable
  ghcr.io/jdx/mise:copr tag is used, always pulling the latest built image.
- Add a push trigger to docker.yml scoped to packaging/copr/Dockerfile
  so the :copr image is automatically rebuilt (and tag updated) whenever
  the Dockerfile changes on main, preventing this class of stale-digest
  regression in the future.
…e exclusion

- Revert docker.yml to original state (tag-push + workflow_dispatch only)
  The paths+branches trigger was a P1: it caused dockerhub and merge jobs
  to also fire on main-branch Dockerfile pushes, overwriting :latest on
  Docker Hub and GHCR with an unreleased build.

- Add docker-copr.yml: lightweight dedicated workflow that only rebuilds
  the ghcr.io/jdx/mise:copr image when packaging/copr/Dockerfile changes
  on main. Fully isolated — no dockerhub or merge jobs involved.

- Add packageRule to renovate.json to exclude ghcr.io/jdx/mise (tag: copr)
  from digest pinning. Without this Renovate would re-pin the mutable :copr
  tag back to a stale digest on its next run, regressing the fix.
Per jdx's review feedback, the dedicated docker-copr.yml is not
needed. Releases push a v* tag which already triggers docker.yml to
rebuild :copr, and workflow_dispatch on docker.yml covers ad-hoc
rebuilds.

The two essential fixes remain:
- copr-publish.yml: floating :copr tag (no stale digest)
- renovate.json: exclude copr from digest pinning
@bestagi bestagi force-pushed the fix/copr-publish-stale-image-digest branch from 7a565af to 0271c8e Compare April 29, 2026 18:07
@jdx jdx merged commit 44e103e into jdx:main Apr 29, 2026
34 checks passed
mise-en-dev added a commit that referenced this pull request Apr 30, 2026
### 🐛 Bug Fixes

- **(copr)** remove stale pinned image digest and rebuild copr image on
Dockerfile changes by @bestagi in
[#9451](#9451)
- **(task)** avoid gix panic when cloning a remote task by commit SHA by
@jdx in [#9473](#9473)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

2 participants