Repository navigation
ci: align the CI workflow with the other repos - #180
Conversation
Add the jobs Test (coverage to Codecov), Audit (production dependencies) and Scan build (shared Trivy action), rename Docker to Build image, and add them to the gate. Pin the actions in deploy.yml. codecov.yml states a target of 70%, informational for now. .trivyignore.yaml, which the scan action requires, matches the file in #173 so that both merge cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Say that a new advisory fails Audit without a code change and holds back deployments, how to fix it, and which secret the upload needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideThe PR brings CI and deployment workflows in line with the organization standard by pinning actions, separating tests and dependency auditing, and making the aggregate gate enforce all checks. It also builds and artifact-transfers the exact production image for Trivy scanning, removes unused package managers from the runtime image, adds time-bound Trivy ignore configuration, and documents the checks and coverage target. Sequence diagram for production image build and scansequenceDiagram
participant Image as Build image
participant Artifact as Artifact storage
participant Scan as Scan build
participant Trivy as scan-image
Image->>Image: Build image
Image->>Artifact: Upload the image
Scan->>Artifact: Download the image
Scan->>Scan: Load the image
Scan->>Trivy: Scan image
Flow diagram for the expanded CI gateflowchart TD
title[CI workflow]
title --> title_check[PR title]
title --> test[Test]
title --> build[Build]
title --> audit[Audit]
title --> image[Build image]
image --> scan[Scan build]
title_check --> gate[CI passed]
test --> gate
build --> gate
audit --> gate
image --> gate
scan --> gate
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
The site runs on node alone. The npm bundled with the Node image brings six fixable high findings, and no newer npm fixes them all yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="80" />
<code_context>
+ - name: Submit report to Codecov
+ uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ files: ./coverage/lcov.info
+ disable_search: true
</code_context>
<issue_to_address>
**Codecov credential exposed to PR code**
When a contributor able to open a same-repository pull request modifies code executed by the test or build steps, a same-repository PR can change code run by `npm run test:coverage` or the build, then access the `CODECOV_TOKEN` supplied to a later step in the same job and exfiltrate it; the token is not restricted to pushes, so the repository credential is exposed.
Do not pass the Codecov secret in a job that executes untrusted PR code; upload with the token only in a trusted push job or use a tokenless PR upload mechanism.
</issue_to_address>Linked issues
#166 ci: align the CI workflow with the other repos · 6 of 7 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add a Test job that runs the Vitest suite with coverage. | ✅ Met | The Test job runs npm run test:coverage. |
| 2 | Upload coverage to Codecov with the org-wide token, add the badge and codecov.yml, and state this repo's target. | ✅ Met | The workflow uploads with CODECOV_TOKEN; the README adds the badge, and codecov.yml sets an informational 70% project and patch target. |
| 3 | Add an Audit job as in cloud-registry-ui. | ✅ Met | The Audit job runs npm audit --omit=dev --audit-level=high. |
| 4 | Rename the Docker job to image / Build image and add Scan image with the shared scan-image action. | 🟡 Partly met | The image job is renamed and the shared scan-image action scans the built image, but the scan job is named Scan build, not the requested Scan image. |
| 5 | Add every new job to the CI passed gate's needs. | ✅ Met | The gate depends on test, build, audit, image, and scan, as well as title. |
| 6 | Pin the actions in deploy.yml if it still exists. | ✅ Met | All action references in deploy.yml are pinned to commit SHAs. |
| 7 | Describe the checks in the README. | ✅ Met | The new Checks section documents the CI jobs and their behavior. |
Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: .github/workflows/ci.yml:80
Closes #166
Summary
Aligns
ci.ymlwithcloud-registry-ui, using the shared actions ofelixir-cloud-aai/.githubat the same pin (v1.0.0).Test: new job; runs Vitest with coverage and uploads it to Codecov withCODECOV_TOKEN, with the model's settings. The tests moved out ofBuild.Audit: new job,npm audit --omit=dev --audit-level=high, the npm equivalent of the model'sbun audit --prod --audit-level=high. It covers production dependencies only, so the dismissedminimatchalert (dev tools) doesn't count.Build image: renamed fromdocker/Dockertoimage. It now hands the image to the next job as an artifact.Scan build: new job; scans exactly that image with the sharedscan-imageaction.needs: [title, test, build, audit, image, scan].persist-credentials: falseand named steps, as in the model.deploy.ymlwere not pinned (@v7,@v4, …), so this PR pins them, with the same commits asci.ymland ci: add a calendar-version release workflow #173.Choices
Scan build:cloud-registry-uidoesn't name its CI job differently: it usesScan imagein CI andScan release imageinrelease.yml. ci: add a calendar-version release workflow #173's release job isScan imageand names must be unique, so this uses the agreed fallback, which differs from theScan imagein the issue text.codecov.ymlstates 70% for project and patch, withinformational: true, so that it reports against the target without failing PRs. Coverage is 38.46% of statements and 38.7% of lines (334 of 863) now. Of the 529 uncovered lines, 353 are insrc/components/ui(3D globe, animations and the like, which gain little from tests in jsdom) and 176 elsewhere (pages, news, layout). Reaching 70% takes about 270 more lines: all of the latter and about a quarter of the former. Once 70% is reached, theinformationallines should go..trivyignore.yaml: the shared action requires the file. It is byte-identical to ci: add a calendar-version release workflow #173's, so the two don't collide; its comment names the release and weekly scans, which ci: add a calendar-version release workflow #173 adds.Verification
Local, on Node 22:
npm run test:coverage: 61 of 61 tests pass, 38.46% statements.npm audit --omit=dev --audit-level=high: 0 vulnerabilities.npx prettier --check "src/**/*.{ts,tsx,json,css}",npx tsc --noEmit,npm run build: pass.ci.ymlanddeploy.yml: no findings.git merge-treeagainstrelease-workflow(ci: add a calendar-version release workflow #173):ci.ymland.trivyignore.yamlmerge cleanly (see "Merging with ci: add a calendar-version release workflow #173").Not run locally: the image build and scan, as agents have no Docker access here. They are checked by this PR's CI.
CI on the latest commit passes:
PR title,Test,Build,Audit,Build image,Scan build,CI passed, and Codecov reports.Merging with #173
ci.ymlmerges cleanly, ason:andconcurrency:are untouched. Whichever PR goes second has to resolve two things:deploy.yml: modify/delete conflict; keep ci: add a calendar-version release workflow #173's deletion.README.md: the badge references conflict; keep both sides' additions and drop thedeployones. ci: add a calendar-version release workflow #173 already conflicts withdevin the README, independently of this PR.#173's README also says "CI doesn't scan the image yet (#166)" in its release steps: once this PR is in, that step should go or change.
Declined review findings
ci.ymlheader lists the jobs in two places: the added sentence sits at the end of the header because ci: add a calendar-version release workflow #173 rewrites its top. It can become one sentence once ci: add a calendar-version release workflow #173 is in.security-events: writeexplicitly, which applies to Dependabot PRs too, and the expression is the model's.Audit: the model has none; the README says what to do when an advisory fails the job. See "Open questions".Decisions
Scan buildfindings: six fixable high findings, all in the npm thatnode:26-alpinebundles, which the image doesn't use at runtime. Therunnerstage now removes the package managers, and the scan passes.Audit: no list of accepted advisories, as in the model. The README says what to do when an advisory fails the job.Open questions
None. The Codecov default branch still has to be set to
devin Codecov's settings, which the maintainer does there.🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Summary by Sourcery
Align CI with the organization standard by adding coverage, dependency auditing, and container scanning gates while hardening workflow and image security.
New Features:
Enhancements:
CI:
Documentation:
Chores: