Repository navigation
ci: make CI pass in forks - #547
Conversation
Forks have neither the Codecov token nor the Docker Hub secrets, so a push to a fork's `dev` failed the Codecov upload and the `push` job, and with them the `CI passed` gate, although all checks passed. - Codecov upload errors fail CI only in this repository. - `push` and `publish` run only on pushes that publish images: to this repository, or to a fork that sets `DOCKERHUB_ORG` (as documented). - Otherwise `scan` builds and scans the images locally, as for pull requests, and uploads to code scanning only where images are published (or for same-repository pull requests here). - The gate allows `push` and `publish` to be skipped whenever the run doesn't publish. Closes #546 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `scan` runs if `push` passed or was skipped (it is skipped only by its own condition), instead of repeating that condition negated. - Code scanning uploads only in the upstream repository, independent of the opt-in to publishing. - Comments and docs: Codecov behaviour of fork PRs, the upstream marker, line wrapping. Refs #546 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe workflow now distinguishes runs that can publish images from fork runs without credentials: publishing jobs are conditionally skipped, local image builds and vulnerability scans still gate CI, uploads requiring upstream permissions are restricted, and the gate fails closed for unexpected results. Documentation and an expiring Trivy exception complete the fork-CI changes. Sequence diagram for fork CI execution without publishing credentialssequenceDiagram
participant GitHub as GitHub Actions
participant Push as Push image
participant Scan as Scan image
participant Gate as CI passed
GitHub->>Push: Evaluate publish condition
Push-->>GitHub: skipped when PUBLISH is false
GitHub->>Scan: Run because push result is skipped
Scan->>Scan: Build image locally
Scan->>Scan: Run Trivy scan
Scan-->>Gate: success or failure
Gate->>Gate: Allow only intentional push/publish skips
Flow diagram for fork-aware CI publishing and scanningflowchart TD
Start[CI run] --> PublishCheck{PUBLISH is true}
PublishCheck -->|Yes| Push[Push image by digest]
Push --> Scan[Scan image]
PublishCheck -->|No| LocalBuild[Build image locally]
LocalBuild --> Scan
Scan --> ScanResult{Scan passed}
ScanResult -->|Yes and publishing| Publish[Publish image]
ScanResult -->|Yes without publishing| Gate[CI passed]
Publish --> Gate
ScanResult -->|No| Failed[CI failed]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #547 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 55 55
Lines 6667 6667
=========================================
Hits 6667 6667
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CVE-2026-114613 (HIGH, memory leak in map deserialization) affects msgpack 1.1.2, which pip 26.2.2, the latest release, vendors. It failed the image scans on `dev` and every pull request. pip runs only at build time, so the app is not affected; the entry expires like the other pip-vendored ones. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Forks often lack the upstream repository's later tags, so the release readiness check took released versions for unreleased ones and could fail pushes in forks; its findings are now warnings there, as on pull requests. The gate also allows the `push`/`publish` skips only if `PUBLISH` is exactly "false", so that it fails closed. Refs #546 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. The security scan did not finish, and the new Trivy exception can let an image containing the flagged msgpack version pass the vulnerability gate and be published; reverting restores the finding, but does not retract images already pushed or tagged. The CI fork changes otherwise gate publishing on pushes and a configured Docker Hub organization.
Summary
Makes CI pass in forks exactly when the code is good. Forks have neither the Codecov token nor the Docker Hub secrets, so a push to a fork's
devfailed the Codecov upload and thepushjob (Docker Hub login), and with them theCI passedgate.fail_ci_if_erroronly in this repository (github.repository_owner == 'elixir-cloud-aai'); the upload is still attempted everywhere. Pull requests from forks to this repository upload tokenless and still fail on errors, as before.push/publish: only where the run publishes (PUBLISH, workflow env): pushes to this repository, or to a fork that sets the repository variableDOCKERHUB_ORG, whichdocs/contributing.mdalready documented as the way forks publish to their own organization.scan: runs ifpushpassed or was skipped; where nothing is published, it builds and scans the images locally, as for pull requests, so the scan still gates. Code scanning uploads only in this repository.CI passed:push/publishmay be skipped wheneverPUBLISHis not "true"; any failed, cancelled or other skipped job still fails it.docs/contributing.mddescribes the fork behaviour.Unchanged: job names and IDs, all tests, coverage threshold (
fail_under = 100), linters, builds, and every upstream path. Audit of the other workflows (release.yml,release-chart.yml,scan.yml): tag/schedule-triggered; in a fork they fail safely at the first credential (as a release dry run in a fork expects), see #546.Closes #546
Verification
fork-ci-checkinuniqueg/foca(this branch plus a fork-only commit adding the branch to the push trigger, as the fork'sdevis its default branch): run 40637344704 (push) passed: all lint, test, integration, chart, readiness and scan jobs green,Push image/Publish imageskipped and allowed byCI passed; the Codecov step logsToken required - not valid tokenless uploadwithout failing the job. The first fork run (40634429332) failed only on the scans, on the msgpack finding below, the same as upstream: the scan still gates in forks.Full review (adversarial-reviewer + quality-reviewer, two rounds): round 1 found one medium (the publish condition repeated, also negated in
scan'sif:), fixed by simplifyingscan's condition; lows fixed (code scanning uploads decoupled from the publishing opt-in, comments and docs wording, wrapping). Round 2: no high or medium findings.Unrelated fixes
build: accept pip's vendored msgpack CVE: CVE-2026-114613 (HIGH) in msgpack 1.1.2, vendored by pip 26.2.2 (the latest release; pip's main branch has 1.2.3), failed every image scan, also ondevsince 2026-10-28. Accepted in.trivyignore.yamllike the other pip-vendored findings (pip runs only at build time), expiring 2027-01-31.Later commits
ci: warn on release readiness in forks: found by the proTES review (CI fails in forks (Codecov, image push) protes#327): forks often lack upstream's later tags, so released versions looked unreleased and could fail fork pushes; findings are now warnings there. The gate also fails closed (PUBLISHmust be exactly "false" to allow the skips). Reviewed by me only, as the two review rounds were used up.Declined review findings
planjob that outputspublishto remove the remaining copies of the condition (inPUBLISHand thepushandpublishif:lines): it adds a job, a runner start and a check name for an expression that is now repeated only in two identical job conditions next to its env definition.fail_ci_if_errorfor pull requests from forks to this repository: they upload tokenless, which Codecov supports for public repositories; this keeps upstream strict, as before.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Make CI pass reliably in forks without credentials while preserving the upstream publishing, scanning, and quality gates.
Bug Fixes:
Enhancements:
Build:
Documentation: