Skip to content

ci: check PRs and publish images - #60

Merged
AnonymousXC merged 42 commits into
stagingfrom
ci/50-check-and-publish
Nov 13, 2026
Merged

AnonymousXC merged 42 commits into
stagingfrom
ci/50-check-and-publish

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

One CI workflow checks every pull request to staging and dev. Pushes to either branch publish signed, attested images to the org registry. The OpenShift deployment and the personal Docker Hub image are removed.

Base: staging. This PR now targets staging, which holds the Next.js/Bun app (#61). origin/staging is merged into the branch (no rebase). Its tree was identical to the head of #56 that this branch was stacked on, so the merge took this branch's side throughout. The diff against staging is now only this PR's 13 files. This PR changes no app code.

  • .github/workflows/ci.yml (CI): runs on push and pull_request to staging and dev. Adapted from cloud-registry (push, scan and publish jobs) and cloud-registry-ui (lint, build, audit and image jobs).
    • PR title, Lint (Biome; also checks that the Bun images in the Dockerfile match packageManager and are pinned by digest), Type check (next typegen + tsc --noEmit), Build (next build), Audit (bun audit --prod --audit-level=high).
    • Build image: builds the image and smoke-tests it as non-root with --read-only --tmpfs /tmp, checking the login page, the start-page redirect and a write by the image optimizer to /tmp/next-cache.
    • Scan image: Trivy via the shared scan-image action. For pull requests, it scans the image from Build image. For pushes, it scans exactly the pushed digest. The job has no credentials and fails on fixable CRITICAL/HIGH findings.
    • Pushes only: Push image (by digest, with SBOM and provenance mode=max, environment dev-images), then Publish image (build provenance attestation, cosign keyless signature, then the tags <branch> (staging or dev) and sha-<commit>, only while the commit is still the branch head). The version label is <version>-<branch>+<commit>. CI never sets latest.
    • Gate CI passed (shared gate action). Allowed skips: title (on pushes and for Dependabot), push and publish (on pull requests).
    • permissions: contents: read by default, a timeout on every job, persist-credentials: false, actions pinned by SHA with # vX.Y.Z, per-ref concurrency as in cloud-registry.
    • Image: docker.io/${{ vars.DOCKERHUB_ORG || 'elixircloud' }}/krini. No third-party publish actions hold Docker Hub secrets.
  • Dockerfile: multi-stage build. The runtime stage holds only the Next.js standalone server (NEXT_OUTPUT=standalone, set in next.config.ts only when that variable is set, so bun run start still works), owned by root and run as bun (UID 1000). .next/cache is a link to /tmp/next-cache, so a read-only root file system with a writable /tmp works. Both stages use oven/bun:1.4.4 pinned by digest (packageManager set to [email protected] to match). OS packages are upgraded, OCI labels added, the version is passed as a build arg, and the image has a health check.
  • Removed: checks.yml and open-shift-deployment.yml (OpenShift rollout with insecure_skip_tls_verify, anurag1201/krini:latest), and .github/ISSUE_TEMPLATE/ (the org's .github repo provides the templates).
  • .github/dependabot.yml: covers Bun, GitHub Actions and Docker, monthly, targeting staging, with the label type: dependencies. (Security updates always go to the default branch, currently dev.)
  • .trivyignore.yaml: empty list of accepted findings, in the org format.
  • Docs: a "Container Image" section in docs/deployment.md (tags for staging and dev, running the image, read-only root file system, verifying with cosign and gh attestation verify, building, publishing from a fork). The README link to the deployment guide now uses the file's actual case (docs/deployment.md).
  • .dockerignore and .gitignore are left as on staging, which already keeps .env* (except .env.example), *.pem and *.key out of images and git.

Not included:

Closes #50

Overlaps with other open work

Verification

Earlier, on the head of #56 (whose tree equals staging), all checks were run locally in containers:

  • docker build .: passed. bun install --frozen-lockfile works with Bun 1.4.4 and the existing bun.lock.
  • docker run --read-only --tmpfs /tmp: the container runs as UID 1000. / returns 307 to /dashboard, /auth/login returns 200 and /_next/image?... returns 200. The image optimizer writes to /tmp/next-cache/images, and the health check reports healthy.
  • Trivy 0.75.0 (--severity CRITICAL,HIGH --ignore-unfixed --exit-code 1): exit code 0.
  • bun run lint, bunx next typegen && bunx tsc --noEmit, bun run build, bun audit --prod --audit-level=high: passed.
  • actionlint 1.7.7 and zizmor 1.14.2 (--offline): no findings.

After the merge of staging:

  • git diff origin/staging...HEAD: only this PR's 13 files; the merge resolution is identical to the previous branch head (git diff d9c57c5 <merge> is empty).
  • The workflow and Dependabot YAML parse. actionlint/zizmor were not rerun locally for the last commit (only trigger, tag and comment changes); CI covers the workflow.
  • CI (run 43222640106, head 6f8c603): every job passed and CI passed is green. Push image and Publish image were skipped as intended on a PR. Trivy code scanning passed with no open alerts, and Vercel – krini passed.

No image was pushed and no tag was created from my machine.

Lane

Full review (release-adjacent: image publishing, signing, credentials). The earlier commits were reviewed before the first push; the staging commit was reviewed with adversarial-reviewer and quality-reviewer.

Fixed after review of the staging changes:

  • A commit pushed to both branches gets two images (version label and provenance name the branch). sha-<commit> no longer follows the last run: it is created only if it doesn't exist yet, and lookup errors other than "not found" (e.g. rate limits) fail the step instead of moving the tag. Checked with a stubbed docker for the three cases (exists, not found, 429).
  • The deployment guide documents the version label <version>-<branch>+<commit>, which identity to use in cosign verify for staging, dev and sha-<commit> tags, and that the environment name dev-images is kept.
  • The Dependabot comment says the file only takes effect on the default branch.

Fixed after Sourcery's review (6f8c603):

  • Publish image creates and verifies sha-<commit> before the branch tag, so a failure leaves the branch tag where it was.
  • The smoke test requires 200 from /auth/login (curl -f also accepted a redirect).

Declined review findings

  • .trivyignore.yaml may not be read (medium). It is read: the shared scan-image action at v1.0.0 passes trivyignores: .trivyignore.yaml to every Trivy step. The action also needs the file to exist.
  • Runtime stage uses the full oven/bun image instead of -slim, and runs apt-get upgrade (medium). Both are kept for parity with cloud-registry-ui, the org's Next.js template. Moving every Bun app to -slim should happen for all of them at once.
  • A pending publish cancelled by a newer push turns CI passed red on the intermediate commit (low). Same behaviour as cloud-registry's shared pattern, and no wrong image is published.
  • Heavy jobs also run on edits that leave the title unchanged (low). Kept as in the org template: a run that skipped the checks would report CI passed for the commit.
  • The sha-<commit> check and create aren't atomic across the staging and dev runs (low). If the same commit is pushed to both branches at the same moment, both runs can create the tag (the last one wins), or the verify step of one run can fail. The window is seconds, dev will be replaced by staging, and a repo-wide publish group would let one branch cancel the other's pending publish. Accepted as is.
  • Environment name dev-images now also serves staging (low). Kept, so that existing settings and forks don't need a new environment; documented, and can be renamed when dev is dropped.
  • Sourcery: the tag check reads .digest from .Manifest (high). False positive: in imagetools inspect --format, .Manifest is the descriptor and has digest; cloud-registry's push runs pass the same check.
  • Sourcery: an older run can move the branch tag after the head check (medium). Publishes of a branch are serialised (cancel-in-progress: false), so the newer commit's publish tags after it; the org's shared pattern.
  • Sourcery: a PR can change ci.yml and fake CI passed (medium). Inherent to required checks; maintainers review workflow changes, and publishing only runs after merge with branch-limited environment secrets.
  • Sourcery: Dependabot PRs fail the SARIF upload (medium). The job asks for security-events: write, which Dependabot runs may raise; cloud-registry-ui's Dependabot PRs pass Scan image with the same condition.
  • Sourcery: Dependabot Bun image updates fail lint (medium). On purpose, as in cloud-registry-ui: a version bump must also bump packageManager, which the maintainer adds; digest-only updates pass.
  • Sourcery: emptyDir at /tmp not writable by UID 1000 (medium). Kubernetes creates emptyDir with mode 0777.
  • Sourcery: Test, Chart and release jobs missing; Dependabot should target dev (medium). Deferred by ci: check PRs and publish images #50 itself (test: add unit and end-to-end tests #51, feat: add a Helm chart and document deployment #52) or decided (PRs target staging); see "Not included".
  • Dependabot reads dependabot.yml only from the default branch (dev) (medium). Not fixable in this PR: version updates start once the file reaches the default branch, or once staging becomes the default branch. Security updates target the default branch. See open questions.

Questions for the maintainer (not blocking)

  1. Release workflow. Add a release.yml (the only workflow that sets latest, with signed tags and pre-releases until 1.0.0) in a follow-up issue together with CITATION.cff and release notes, or in this PR?
  2. Default branch. Dependabot and security updates follow the default branch, still dev. Should the default branch switch to staging once this is merged (then also only staging needs a ruleset requiring CI passed)?
  3. Vercel. Vercel – krini passes now. Is it still wanted next to the published images?

Before and after merge (maintainer)

These steps need repository settings that this PR can't change. The first two must be done before this PR is merged, because the first push to staging then runs Push image:

  1. Create the environment dev-images with a deployment branch policy for staging and dev only, and give it DOCKERHUB_LOGIN and DOCKERHUB_TOKEN (a token that can push to elixircloud/krini) unless the org secrets apply. GitHub would otherwise create dev-images on the first run with no protection.
  2. Create the Docker Hub repository elixircloud/krini as public. Build image and Scan image pull the pushed digest without logging in, so a private repository fails them.
  3. Remove the old secrets DOCKERHUB_LOGIN/DOCKERHUB_TOKEN of the personal account (if they are repository secrets), OPENSHIFT_SERVER and OPENSHIFT_TOKEN, and the environment production if nothing else uses it.
  4. Switch the rulesets of staging and dev to require only CI passed (source: GitHub Actions), then update open PR branches.
  5. Optionally, retire the image anurag1201/krini on Docker Hub and the OpenShift deployment that pulled it.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV

Summary by Sourcery

Establish branch-gated CI and secure, verifiable container image publishing for the staging and dev branches.

New Features:

  • Add a unified CI workflow that validates pull requests and builds, scans, signs, attests, and publishes images for the staging and dev branches.
  • Provide a hardened standalone container image that runs as a non-root user with read-only filesystem support and health checks.
  • Add Dependabot coverage for Bun, GitHub Actions, and Docker dependencies.

Bug Fixes:

  • Remove the obsolete OpenShift deployment and personal Docker Hub image publishing paths.

Enhancements:

  • Replace the previous checks workflow with a gated CI pipeline covering linting, type checks, builds, dependency audits, image smoke tests, and vulnerability scanning.
  • Pin the Bun runtime and Docker base images, and align the project package manager version with the container build.
  • Document container image tags, verification, local usage, building, and fork publishing.

CI:

  • Run CI on pull requests and pushes to staging and dev, with the CI passed gate as the required status check.

Deployment:

  • Transition deployment artifacts from OpenShift and personal Docker Hub publishing to signed, attested images in the organization registry.

Documentation:

  • Correct the deployment guide link and add comprehensive container image documentation.

Chores:

  • Remove repository-local issue templates in favor of organization-provided templates.
  • Add an empty Trivy ignore policy file for explicitly managed future exceptions.

AnonymousXC and others added 30 commits October 30, 2026 07:54
Build the Next.js standalone server (NEXT_OUTPUT=standalone) and run
only it, its static files and public/ in the runtime stage, owned by
root and run as the user bun. Next.js caches go to /tmp/next-cache, so
the image works with a read-only root file system and a writable /tmp.
Both stages use the Bun image of packageManager (now [email protected]), pinned
by digest; OS packages are upgraded; the version comes in as a build
argument (OCI label); a health check requests the start page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
uniqueg and others added 4 commits November 11, 2026 16:45
Document the image tags that CI publishes, how to run the image (port,
non-root, read-only root file system with a writable /tmp), how to
verify its signature and provenance, and how to build it. Fix the case
of the link to the deployment guide in the README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
On pushes, the image job now pulls and checks exactly the digest that
push pushed, in a job without credentials, so that the published image
is the checked one (publish already needs image). Pull requests still
build the image locally. The trap is set before docker run, and the
comment names the asset that the image optimizer check depends on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Say which commits get the dev and sha-<commit> tags, that the smoke test
and the scan check the pushed digest, what the health check needs, and
what a fork needs to publish and verify its own images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
krini Ready Ready Preview Nov 13, 2026 4:28pm UTC

@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Replace the old checks and OpenShift deployment workflows with a gated CI pipeline that tests pull requests and publishes, scans, attests, signs, and tags images on branch pushes.

  • .github/workflows/ci.yml L1-515
  • .github/workflows/checks.yml (deleted)
  • .github/workflows/open-shift-deployment.yml (deleted)

Build a standalone, non-root Docker image that supports a read-only root filesystem, and align its Bun version with the package manager version CI checks.

  • Dockerfile L1-50, L56-62
  • next.config.ts L14-16
  • package.json L46

Configure monthly Dependabot updates for Bun, GitHub Actions, and Docker, and provide the empty Trivy ignore list expected by the image scan.

  • .github/dependabot.yml L1-57
  • .trivyignore.yaml L1-15

Remove repository-local issue templates now that the organization provides shared templates.

  • .github/ISSUE_TEMPLATE/bug_report.md (deleted)
  • .github/ISSUE_TEMPLATE/custom.md (deleted)
  • .github/ISSUE_TEMPLATE/feature_request.md (deleted)

Documentation

Document the published image’s tags, runtime requirements, verification, build process, and fork publishing setup, and correct the deployment-guide link in the README.

  • README.md L102-103
  • docs/deployment.md L5-105

Other changes

Files not grouped.

  • Dockerfile L63

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

@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 4 commits November 12, 2026 12:51
…blish

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/ISSUE_TEMPLATE/custom.md
#	.github/ISSUE_TEMPLATE/feature_request.md
#	.github/workflows/checks.yml
#	.github/workflows/open-shift-deployment.yml
#	Dockerfile
#	README.md
#	docs/deployment.md
#	next.config.ts
#	package.json
Krini's pull requests now target `staging`, which will later replace
`dev`. CI runs on pull requests and pushes to both branches. Pushes tag
the image with the branch name (`staging` or `dev`) and `sha-<commit>`,
and the version label says which branch it came from. Dependabot
targets `staging`. The deployment guide uses `staging` in its examples.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
A commit pushed to both `staging` and `dev` gets two images, as the
version label and provenance name the branch. `sha-<commit>` now stays
on the image published first instead of following the last run. The
deployment guide documents this and the version label, and its cosign
example accepts signatures from both branches. The Dependabot comment
says that the file takes effect only on the default branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Only a "not found" answer adds `sha-<commit>`; other lookup errors
(e.g. rate limits) fail the step, so that a short registry error can't
move the tag. The cosign example checks `staging` images against the
`staging` branch only, and says what to use for `dev` and
`sha-<commit>` tags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
@vercel
vercel Bot temporarily deployed to Preview – krini November 12, 2026 12:38 Inactive
@uniqueg
uniqueg marked this pull request as ready for review November 12, 2026 12:44
@sourcery-ai

sourcery-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 998e789

#50 ci: check PRs and publish images · 6 of 11 met · 2 to check by hand

# Requirement Status Notes
1 Run CI on PRs and pushes to dev, with lint, type check, build, image scan and a single CI passed gate. ✅ Met ci.yml includes dev triggers, the requested checks, and the passed gate; it also runs on staging.
2 Add a Test job once #51 exists. ✅ Met The PR says the test script does not exist yet, so this conditional job is deferred.
3 Every PR to dev runs chart checks. 🟡 Partly met The workflow has no Chart job; the PR defers it because the chart does not exist yet.
4 Publish dev and sha- images by digest, scan the published digest without credentials, and attest and sign the image; CI must not set latest. ✅ Met Push, scan and publish implement this flow for dev; staging is also supported, and CI does not set latest.
5 Set latest only from signed vX.Y.Z releases, with GitHub pre-releases until 1.0.0 and release notes in the org format. ❌ Not addressed There is no release workflow; the PR defers it until release prerequisites are added.
6 Build a standalone, non-root Docker image that supports a read-only root file system with writable /tmp, OCI labels, a version build arg, and digest-pinned base images. ✅ Met The Dockerfile and next.config.ts implement the standalone image, and CI checks the Bun version and digest pins.
7 Remove the OpenShift deployment, personal registry use, and deployment secrets. ✅ Met The OpenShift workflow is deleted and the new workflow publishes only to the configured org namespace; repository-level secret cleanup needs separate verification.
8 Remove the repository-level issue templates. ✅ Met The three template files are deleted.
9 Configure Dependabot for Bun/npm, Docker and GitHub Actions, targeting dev. 🟡 Partly met All three ecosystems are configured, but their version updates target staging rather than dev.
10 Configure the org registry environment and secrets, and make CI passed the required check. 👀 Check by hand (external system) Verify the repository environment, its secrets and branch policy, and the ruleset's required check in GitHub settings.
11 Remove the old personal Docker Hub and OpenShift secrets. 👀 Check by hand (external system) Verify in GitHub settings that the old personal Docker Hub and OpenShift secrets have been removed.

@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 13 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yml" line_range="481" />
<code_context>
+          for tag in "${tags[@]}"; do
+            docker buildx imagetools create --tag "${tag}" "${IMAGE_NAME}@${DIGEST}"
+            actual="$(docker buildx imagetools inspect "${tag}" \
+              --format '{{ json .Manifest }}' | jq -r .digest)"
+            if [[ "${actual}" != "${DIGEST}" ]]; then
+              echo "::error::${tag} points to ${actual}, expected ${DIGEST}"
</code_context>
<issue_to_address>
**Every image publish fails**

When a push reaches the tag-verification loop, `docker buildx imagetools inspect --format '{{ json .Manifest }}'` outputs the manifest, which has no top-level `digest`; `jq -r .digest` returns `null`, so the comparison fails after the branch tag is created and the SHA tag is not created.

Read the inspected image digest from the inspect output instead of querying `.digest` from `.Manifest`.
</issue_to_address>

### Comment 2
<location path=".github/workflows/ci.yml" line_range="417" />
<code_context>
+          REF: ${{ github.ref }}
+          SHA: ${{ github.sha }}
+        run: |
+          head=$(git ls-remote "https://github.com/${REPOSITORY}.git" "${REF}" | cut -f1)
+          [ -n "${head}" ] || { echo "::error::Could not look up ${REF}"; exit 1; }
+          if [ "${head}" = "${SHA}" ]; then
</code_context>
<issue_to_address>
**Older runs overwrite current branch tags**

When the branch advances after the head lookup but before the tag step, `publish` keeps `current=true` and tags the older digest, so deployments pulling the branch tag get stale code.

Recheck the ref immediately before tagging and skip the branch-tag update if the run's commit is no longer current.

Also at `.github/workflows/ci.yml:479`.
</issue_to_address>

### Comment 3
<location path=".github/workflows/ci.yml" line_range="493" />
<code_context>
+  # (except the intended skips: `title` on pushes and for Dependabot, `push`
+  # and `publish` on pull requests) and on missing results. Add every new
+  # job to `needs`
+  passed:
+    name: CI passed
+    runs-on: ubuntu-latest
</code_context>
<issue_to_address>
**PRs can bypass the CI gate**

When a contributor’s pull request changes `.github/workflows/ci.yml` and retains or recreates the required `CI passed` check, gitHub runs the pull request’s workflow definition, so the contributor can remove the validation jobs or replace the gate action with a successful job using the same `CI passed` name. The required check then goes green without the intended checks, allowing unvalidated code to be merged and later published.

Require an independently enforced review for workflow changes or make the required gate come from a trusted workflow that pull requests cannot replace.
</issue_to_address>

### Comment 4
<location path=".github/workflows/ci.yml" line_range="479" />
<code_context>
+            exit 1
+          fi
+          for tag in "${tags[@]}"; do
+            docker buildx imagetools create --tag "${tag}" "${IMAGE_NAME}@${DIGEST}"
+            actual="$(docker buildx imagetools inspect "${tag}" \
+              --format '{{ json .Manifest }}' | jq -r .digest)"
</code_context>
<issue_to_address>
**Branch and SHA tags diverge**

When the branch-tag operation succeeds but creating or verifying the SHA tag fails, the tag loop updates the branch tag first, then fails on the SHA tag, leaving the branch tag updated and the SHA tag missing while the publish gate fails.

Complete and verify the SHA-tag operation before updating the branch tag.
</issue_to_address>

### Comment 5
<location path=".github/workflows/ci.yml" line_range="479" />
<code_context>
+            exit 1
+          fi
+          for tag in "${tags[@]}"; do
+            docker buildx imagetools create --tag "${tag}" "${IMAGE_NAME}@${DIGEST}"
+            actual="$(docker buildx imagetools inspect "${tag}" \
+              --format '{{ json .Manifest }}' | jq -r .digest)"
</code_context>
<issue_to_address>
**Commit tag can be overwritten**

When the same commit is published to `staging` and `dev` concurrently and both look up the SHA tag before either creates it, both `publish` jobs can observe `sha-${SHA}` as absent, then each `docker buildx imagetools create` retags it to its branch-specific digest. The tag ends up pointing to whichever job writes last, rather than reliably staying on the first-published image; a job can also fail verification after the other job retags it.

Serialize the SHA-tag check-and-create across branches, or use a registry operation that atomically creates the tag only if absent.

Also at `.github/workflows/ci.yml:404-405`.
</issue_to_address>

### Comment 6
<location path=".github/workflows/ci.yml" line_range="381" />
<code_context>
+        with:
+          image: ${{ steps.image.outputs.image }}
+          category: image
+          upload: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
+
+  # Attests the build provenance of the scanned digest (GitHub artifact
</code_context>
<issue_to_address>
**Dependabot scans fail SARIF upload**

When a Dependabot PR has its head branch in this repository, the scan step sets `upload` to true for same-repository pull requests, including Dependabot PRs. GitHub gives Dependabot-triggered workflows a read-only token, so the shared scan action's code-scanning upload is denied and the scan job fails, leaving `CI passed` red for dependency PRs.

Set `upload` to false for Dependabot PRs, as well as for fork PRs.
</issue_to_address>

### Comment 7
<location path=".github/dependabot.yml" line_range="46" />
<code_context>
+  # Images in the `Dockerfile` (Bun, pinned by digest); pull requests that
+  # bump its version must also bump `packageManager` in `package.json`,
+  # which CI's `lint` job checks
+  - package-ecosystem: docker
+    directory: /
+    schedule:
</code_context>
<issue_to_address>
**Bun update PRs fail lint**

When dependabot proposes a Docker image update to a newer Bun version, dependabot updates the Dockerfile image version but not `packageManager` in `package.json`, so lint rejects the mismatch and the update PR cannot pass CI.

Configure the update flow to change `packageManager` alongside the Dockerfile's Bun version.

Also at `.github/workflows/ci.yml:104-105`.
</issue_to_address>

### Comment 8
<location path=".github/workflows/ci.yml" line_range="228" />
<code_context>
+            # the start page redirects to the dashboard; the login page is
+            # served without settings; an optimized image is written to
+            # `.next/cache` (a link to `/tmp`)
+            if curl -fs -o /dev/null http://127.0.0.1:3000/auth/login; then
+              status="$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000/)"
+              if [[ "${status}" != 307 ]]; then
</code_context>
<issue_to_address>
**Redirected login pages pass smoke test**

When `/auth/login` returns a redirect instead of serving the page, `curl -f` treats a 3xx response as successful, so the smoke test does not verify that the login page was served and CI can publish an image with a broken login flow.

Make the smoke test fail when `/auth/login` redirects instead of serving the page.
</issue_to_address>

### Comment 9
<location path="docs/deployment.md" line_range="51-53" />
<code_context>
+  `LISTEN_HOSTNAME` (e.g. `::` for IPv6) to change the interface.
+- It runs as the non-root user `bun` (UID 1000) and can't change its own
+  code.
+- It works with a read-only root file system: only `/tmp` must be
+  writable (e.g. an `emptyDir` volume in Kubernetes). Next.js caches, such
+  as optimized images, go to `/tmp/next-cache`.
+- The image has a health check that requests the start page on
+  `127.0.0.1`; with a `LISTEN_HOSTNAME` that doesn't include the loopback
</code_context>
<issue_to_address>
**Kubernetes emptyDir prevents startup**

When a Kubernetes deployment mounts a default root-owned `emptyDir` at `/tmp` without setting `fsGroup` or otherwise granting UID 1000 write access, the container runs as UID 1000, so `mkdir -p /tmp/next-cache` fails with `EACCES` when the documented `emptyDir` is mounted without write permissions for that UID; the container never starts.

Document that the mounted volume must be writable by UID 1000, for example by configuring an appropriate `fsGroup`.
</issue_to_address>

### Comment 10
<location path=".github/workflows/ci.yml" line_range="498" />
<code_context>
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+    if: always()
+    needs: [title, lint, typecheck, build, audit, image, push, scan, publish]
+    permissions: {}
+    steps:
</code_context>
<issue_to_address>
**Add the deferred test job**

The issue calls for a Test job once #51 exists. The workflow has no Test job, and the PR description defers this work to the test changes.
</issue_to_address>

### Comment 11
<location path=".github/workflows/ci.yml" line_range="498" />
<code_context>
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+    if: always()
+    needs: [title, lint, typecheck, build, audit, image, push, scan, publish]
+    permissions: {}
+    steps:
</code_context>
<issue_to_address>
**Add the deferred chart job**

The issue calls for a Chart job once the chart exists. The workflow has no Chart job, and the PR description defers it to #52.
</issue_to_address>

### Comment 12
<location path=".github/workflows/ci.yml" line_range="392" />
<code_context>
+        if: ${{ github.event_name != 'push' }}
+        run: docker build -t "${IMAGE_NAME}:scan" .
+      - name: Pull the pushed image
+        if: ${{ github.event_name == 'push' }}
+        env:
+          DIGEST: ${{ needs.push.outputs.digest }}
</code_context>
<issue_to_address>
**Add the release workflow**

The issue asks for releases to create signed version tags, pre-releases, release notes, and the latest tag. This workflow only publishes on branch pushes, and the PR defers release handling.
</issue_to_address>

### Comment 13
<location path=".github/dependabot.yml" line_range="15" />
<code_context>
+    directory: /
+    schedule:
+      interval: monthly
+    target-branch: staging
+    labels: ["type: dependencies"]
+    commit-message:
</code_context>
<issue_to_address>
**Target Dependabot at dev**

The issue asks Dependabot version updates to target dev, but this entry and the other ecosystem entries target staging.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 13 findings to address first, and a push to staging or dev can now publish, sign, and move a public image tag; deployments that consume that tag could run a faulty image. Reverting the workflow does not restore the previous tag or undo deployments that already pulled it.

Blocking findings: .github/workflows/ci.yml:481, .github/workflows/ci.yml:417, .github/workflows/ci.yml:493, .github/workflows/ci.yml:479, .github/workflows/ci.yml:479, and 8 more


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

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread docs/deployment.md Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/dependabot.yml Resolved
The publish job now creates `sha-<commit>` before the branch tag, so a
failure leaves the branch tag where it was. The smoke test requires
200 from `/auth/login`; `curl -f` also accepted a redirect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
@vercel
vercel Bot temporarily deployed to Preview – krini November 12, 2026 12:57 Inactive
@uniqueg
uniqueg requested a review from AnonymousXC November 12, 2026 13:04
@vercel
vercel Bot temporarily deployed to Preview – krini November 13, 2026 16:28 Inactive
@AnonymousXC
AnonymousXC merged commit dcdc51f into staging Nov 13, 2026
24 checks passed
@AnonymousXC
AnonymousXC deleted the ci/50-check-and-publish branch November 14, 2026 05:50
uniqueg added a commit that referenced this pull request Nov 14, 2026
Brings in the CI workflow (#60) and the env file checks (#68). The
README note on the login host keeps the wording of this PR and adds
where to set the two variables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg mentioned this pull request Nov 14, 2026
1 task

This branch was previously deployed

1 inactive deployment
Preview – krini — 998e7895 Deployed Nov 13, 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: check PRs and publish images

3 participants