Skip to content

fix(tools): validate package and branch inputs in import_rawhide - #56

Closed
castrojo wants to merge 1 commit into
mainfrom
fix/validate-import-rawhide-inputs
Closed

castrojo wants to merge 1 commit into
mainfrom
fix/validate-import-rawhide-inputs

Conversation

@castrojo

@castrojo castrojo commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Validate package and branch arguments in tools/import_rawhide.py to prevent argument injection, shell metacharacters, and path traversal. Adds unit test suite tests/test_import_rawhide.py.

Part of #48

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI root cause: every srpm job fails on a pruned packit image digest (quay.io/packit/packit@sha256:149e6e06… → manifest unknown, exit 125). One-line fix at .github/workflows/packit-srpm-pilot.yml:90: repin to sha256:8a1784251c51eed7a094820c894e2ee7f4ed4bbce4eb78eb172a04de3fae43e1 (verified live). I cannot push it — the hive App token lacks workflows permission for .github/workflows/*. Details: #74

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

CI root cause + blocker

The 84 srpm failures are all one cause: pinned packit image digest sha256:149e6e06… pruned from quay.io (manifest unknown, exit 125).

Fix exists locally as commit 3017fe3 (repin to live digest sha256:8a178425…, verified HTTP 200 on quay) but cannot be pushed: the hive GitHub App token lacks the workflows permission, so any push touching .github/workflows/packit-srpm-pilot.yml is rejected:

refusing to allow a GitHub App to create or update workflow '.github/workflows/packit-srpm-pilot.yml' without workflows permission

Human action needed: grant the App workflows scope on this repo, or push this one-line repin manually:

quay.io/packit/packit@sha256:149e6e06d3e5fb2f10d19760c8a0031c7d8825e7bb91a5f4a7ab9b927c947494
→ quay.io/packit/packit@sha256:8a1784251c51eed7a094820c894e2ee7f4ed4bbce4eb78eb172a04de3fae43e1

The rebuild* / build failures (fish %check, gcc, samba, webkitgtk, …) are pre-existing upstream Rawhide build breaks also present on main — handled per-package in #30, #57, #58.


scanner agent (ACMM L5 — hold-gated mode)

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 3017fe3

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI root cause identified: packit-srpm-pilot.yml pins a packit image digest pruned from quay.io — every srpm (*) job dies with manifest unknown (exit 125), on main as well as this branch. Fix (repin to live digest 8a178425…, verified via quay API) is ready as commit 3017fe3 but the hive App lacks the workflows permission to push workflow edits. Tracked in the issue filed on this repo; needs a human push, then rebase this branch.

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI red is systemic, two clusters: (1) all srpm jobs fail exit 125 — the pinned quay.io/packit/packit digest was pruned upstream, filed #84 (fix ground occupied by #70 which rewrites packit-srpm-pilot.yml); (2) rebuild* / build failures (samba/gpgme hummingbird dep mismatches, fish %check, firefox) are the cluster tracked by #30. No in-branch fix available without colliding with those PRs.

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] Root cause of the rebuild/srpm failures: RPM transaction conflict between ruby3.3/ruby3.4/ruby4.0 default-gems (file conflicts on /usr/share/gems/specifications/default/*). Unblocked by utah-packages#83 (exclude legacy ruby default-gems from Hummingbird repo) — after #83 merges, rebase this branch onto main and CI should clear.


scanner agent (ACMM L5 — hold-gated mode)

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.78

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The input validation and its tests are good. But half the diff is two unrelated RPM spec changes that the body does not mention, and both of them are duplicated in other open PRs.

Declared vs. actual. The body says: validate package/branch args in tools/import_rawhide.py, add tests/test_import_rawhide.py. Three-dot diff against main (54cc8d1):

 tools/import_rawhide.py         | 17 ++++--    <- declared
 tests/test_import_rawhide.py    | 28 ++++++    <- declared
 packages/dracut/dracut.spec     |  2 +-        <- NOT declared
 packages/mozjs140/mozjs140.spec |  5 +++       <- NOT declared

The mozjs140 hunk appears byte-identically in three open PRs. #56 (this one), #57, and #58 all carry:

+  %if "%{toolchain}" == "clang"
+  export CC="/work/tools/sccache clang"
+  export CXX="/work/tools/sccache clang++"
+  %else
   export CC="/work/tools/sccache gcc"
   export CXX="/work/tools/sccache g++"
+  %endif

and it is also the headline claim of #30 ("sccache wrapper now uses clang to match %global toolchain clang; gcc rejected the injected clang hardened-ld config"). None of #56, #57 or #58 mentions mozjs140 in its title or body. They do not conflict — git resolves identical hunks silently — so whichever merges first makes it vanish from the other two, and the one PR that actually explains why the change is right never gets to make its case. mozjs140 is a confirmed failure on current main (run 34571911239, job 103185436552), so this fix matters and deserves one owner.

The dracut changelog hunk is shared with #57, and unlike the mozjs140 one it has a directly citable justification that neither PR gives:

-* Mon aug 10 2026 Hans de Goede <johannes.goede@oss.qualcomm.com> - 111-2
+* Mon Aug 10 2026 Hans de Goede <johannes.goede@oss.qualcomm.com> - 111-2

From the dracut job on the latest scheduled main run (job 103175696635):

error: bad date in %changelog: Mon aug 10 2026 Hans de Goede <johannes.goede@oss.qualcomm.com> - 111-2

That is a real rpmbuild error emitted on every dracut build. It is a good one-line fix and it should land — just not silently, in two PRs, under titles about import_rawhide and anaconda-live. Note dracut is also touched by #58 (a different hunk, the %bcond_with doc switch), so three open PRs currently edit packages/dracut/dracut.spec.

The declared change itself looks sound. tools/import_rawhide.py takes package and branch straight into subprocess/URL construction, so validating them against an allowlist pattern before use is the right call, and 27 subtests is real coverage rather than a smoke test. Merged into main locally, everything CI runs stays green and the suite grows as expected:

PR#56 fc=0 val=0 pytest=0 | validated 193 source RPMs | 76 passed, 27 subtests passed in 0.71s
PR#56 quoting=0 runtime_contract=0 unittest=0 | validated runtime contract: 72 packages

(baseline on unmodified main is 72 passed.)

What I would ask for: drop the two spec hunks from this branch. Let one PR own the mozjs140 clang fix with its reasoning intact, and land the dracut changelog fix on its own with the bad date log line as justification. Then this becomes a clean, well-tested security fix that can merge on its own merits — which is what it deserves to be.


Generated by Claude Code

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] CI root cause: both failure classes here are systemic, not from this PR.

  1. srpm jobs fail with docker: manifest unknown (exit 125) — the pinned quay.io/packit/packit@sha256:149e6e06... digest was garbage-collected upstream when latest was republished. Fix already open: ci: repin Packit image to live digest #87 (repins to the live digest 8a178425..., verified still current as of 2026-09-12).
  2. rebuild jobs fail on ruby3.3-default-gems / ruby3.4-default-gems / ruby4.0-default-gems file conflicts in the Hummingbird repo transaction. Fix already open: fix(buildroot): exclude legacy ruby default-gems from Hummingbird repo #83 (excludes the legacy default-gems from the Hummingbird repo).

Once #83 and #87 merge and this branch is rebased, CI should validate this PRs actual changes. Note: the hive App token currently lacks the workflows permission, so agent-authored pushes touching .github/workflows/ are rejected — the repin must land via a human-pushed PR (#87).


scanner agent (ACMM L5 — hold-gated mode)

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 860e512

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.78

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] Root-cause triage of the red checks — none are caused by this PR's diff:

  1. All srpm (*) jobs: the workflow pins quay.io/packit/packit@sha256:149e6e06…, which upstream has deleted (manifest unknown, HTTP 404 — verified against quay.io). Every srpm job dies at docker run with exit 125. Fix already open and green: ci: repin Packit SRPM image to live digest #85 / ci: repin Packit image to live digest #87 (repin to 8a178425…, verified live). Note ci: repin Packit SRPM image to live digest #85 and ci: repin Packit image to live digest #87 are duplicates — one should be closed.
  2. rebuild* / build failures (firefox, gjs, webkitgtk, samba, dracut, …): two distinct repo-content bugs in the Hummingbird repo — (a) buildroot transactions pull in BOTH ruby3.4 and ruby4.0 default-gems and the rpm transaction conflicts (fix open: fix(buildroot): exclude legacy ruby default-gems from Hummingbird repo #83), (b) missing closure members like libwebrtc-audio-processing-2.so.1 for pipewire-devel (closure fixes open: feat: add Utah's unique @multimedia closure members (PackageKit, alsa-utils, ffmpegthumbnailer, gstreamer1 plugins) #81, ci: publish factory repositories atomically after closure validation #89). The dead srpm lane (1) also blocks republishing fixed packages.

Merging #85+#83+#81 and re-running should clear this PR without changes here.

🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.78

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@castrojo
castrojo force-pushed the fix/validate-import-rawhide-inputs branch from 860e512 to bd5a030 Compare September 13, 2026 20:13
castrojo added a commit that referenced this pull request Sep 13, 2026
…e import, and contract (#71, #72, #56, #57) (#92)

* test(quality): unit coverage for validate.py and recalculate_hummingbird_gaps.py

* fix(ci): verify cosign binary sha256 checksum in rebuild-rpms

Verify the downloaded cosign v2.4.1 binary against its release SHA-256
checksum prior to installation and keyless signing.

Closes #46
Closes #66
Closes #68

* fix(tools): validate package and branch inputs in import_rawhide (#56)

* fix(contract): exclude anaconda-live from runtime transaction (#57)

---------

Co-authored-by: castrojo <castrojo@users.noreply.github.com>
@castrojo castrojo closed this in #92 Sep 13, 2026
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