Skip to content

ci: align the CI workflow with the other repos - #180

Merged
uniqueg merged 5 commits into
devfrom
ci-align-checks
Nov 3, 2026
Merged

uniqueg merged 5 commits into
devfrom
ci-align-checks

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #166

Summary

Aligns ci.yml with cloud-registry-ui, using the shared actions of elixir-cloud-aai/.github at the same pin (v1.0.0).

  • Test: new job; runs Vitest with coverage and uploads it to Codecov with CODECOV_TOKEN, with the model's settings. The tests moved out of Build.
  • Audit: new job, npm audit --omit=dev --audit-level=high, the npm equivalent of the model's bun audit --prod --audit-level=high. It covers production dependencies only, so the dismissed minimatch alert (dev tools) doesn't count.
  • Build image: renamed from docker / Docker to image. It now hands the image to the next job as an artifact.
  • Scan build: new job; scans exactly that image with the shared scan-image action.
  • Gate: needs: [title, test, build, audit, image, scan].
  • Existing jobs: timeouts, persist-credentials: false and named steps, as in the model.
  • Pins: the actions in deploy.yml were not pinned (@v7, @v4, …), so this PR pins them, with the same commits as ci.yml and ci: add a calendar-version release workflow #173.
  • Docs: a "Checks" section and a Coverage badge in the README.

Choices

  • Job name Scan build: cloud-registry-ui doesn't name its CI job differently: it uses Scan image in CI and Scan release image in release.yml. ci: add a calendar-version release workflow #173's release job is Scan image and names must be unique, so this uses the agreed fallback, which differs from the Scan image in the issue text.
  • Coverage target: codecov.yml states 70% for project and patch, with informational: 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 in src/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, the informational lines 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:

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.yml merges cleanly, as on: and concurrency: are untouched. Whichever PR goes second has to resolve two things:

#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.yml header 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.
  • SARIF upload on Dependabot PRs: the job asks for security-events: write explicitly, which applies to Dependabot PRs too, and the expression is the model's.
  • README wording on the upload ("pushes to this repository", "the organization's secret"): it matches the behaviour here, and the org-wide token is the decided setup.
  • Allowlist for Audit: the model has none; the README says what to do when an advisory fails the job. See "Open questions".

Decisions

  • Scan build findings: six fixable high findings, all in the npm that node:26-alpine bundles, which the image doesn't use at runtime. The runner stage 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 dev in 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:

  • Add CI jobs for test coverage reporting, production dependency auditing, and vulnerability scanning of the built container image.

Enhancements:

  • Align CI workflows with the shared organization workflow model and require all validation jobs to pass before reporting CI success.
  • Transfer the built image between CI jobs so the exact build artifact is scanned before merging.
  • Remove unnecessary runtime package managers from the production image to reduce vulnerability exposure.

CI:

  • Pin previously unpinned deployment workflow actions to immutable revisions.

Documentation:

  • Document the CI checks and add a Codecov coverage badge and configuration.

Chores:

  • Add Trivy ignore configuration for reviewed, time-limited image vulnerability exceptions.

uniqueg and others added 2 commits November 3, 2026 01:05
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
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
landing-page Ready Ready Preview Nov 3, 2026 12:27am UTC

@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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 scan

sequenceDiagram
    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
Loading

Flow diagram for the expanded CI gate

flowchart 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
Loading

File-Level Changes

Change Details Files
Split validation and security checks into independent CI jobs and make the aggregate gate require every check.
  • Added Vitest coverage execution with conditional Codecov failure behavior.
  • Added production-only npm audit at high severity.
  • Updated the gate dependencies to include title, tests, build, audit, image, and scan.
  • Standardized timeouts, named steps, and checkout credential handling.
.github/workflows/ci.yml
Build the production container as an artifact and scan the exact image produced by CI.
  • Exported the Buildx image to a tar artifact without provenance or SBOM metadata.
  • Downloaded and loaded the artifact in a dependent scan job using the shared pinned scan action.
  • Added Trivy configuration for documented, expiring vulnerability exceptions.
.github/workflows/ci.yml
.trivyignore.yaml
Reduce unnecessary runtime-image vulnerabilities by removing package managers from the production stage.
  • Removed npm, npx, Corepack, and Yarn binaries and their bundled modules from the runtime image.
Dockerfile
Align deployment workflow actions with the organization’s pinned-action standard.
  • Replaced floating major-version references with reviewed commit SHAs and version comments.
.github/workflows/deploy.yml
Document the new CI checks and expose coverage status.
  • Added a README Checks section covering title validation, tests, build, audit, image scanning, and the aggregate gate.
  • Added a Codecov badge and links.
  • Configured 70% project and patch coverage targets as informational.
README.md
codecov.yml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

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 ☂️

@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

uniqueg and others added 3 commits November 3, 2026 01:25
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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/ci.yml Resolved
@uniqueg
uniqueg merged commit 3fa4893 into dev Nov 3, 2026
37 checks passed
@uniqueg
uniqueg deleted the ci-align-checks branch November 3, 2026 00:40

This branch was successfully deployed

1 active deployment
Preview – landing-page — 7f07cfa7 Deployed Nov 3, 2026 by vercel[bot]
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.

ci: align the CI workflow with the other repos

2 participants