Repository navigation
chore: migrate CI to kalbasit/gh-actions reusable workflow - #1235
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Warning Review limit reached
Your plan currently allows 5 reviews/hour. Refill in 5 minutes and 44 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThree workflow files are refactored to call external reusable workflows from kalbasit/gh-actions. CI is restructured with a shared reusable job, a conditional Ent code-generation job, a simplified docs build step, and an explicit ci-gate; the releases build job now uses the external build workflow contract. ChangesWorkflow Migration to External Reusable Jobs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)
24-38: ⚡ Quick winTrack the branch ref for pinning to a release tag.
The reusable workflow is pinned to a feature branch (
@feat-add-reusable-ci-workflows). As noted in the PR description, this should be repinned to@v0.1.0(or a commit SHA) once the tag is created to avoid supply-chain risks from branch mutations.Consider opening an issue or adding a
TODO(v0.1.0)comment in the file to ensure this doesn't slip through.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 24 - 38, The workflow is currently using a feature branch ref for the reusable workflow (uses: kalbasit/gh-actions/.github/workflows/ci.yml@feat-add-reusable-ci-workflows); update the ref to a stable tag or commit SHA (e.g., `@v0.1.0` or a specific commit SHA) to pin the dependency and remove the branch name, and add a TODO comment (e.g., TODO(v0.1.0)) above the shared uses entry to remind maintainers to repin once the release tag exists.
99-100: 💤 Low valueSimplify the command invocation.
The
bash -cwrapper is unnecessary here.nix develop --commandalready executes the command in the dev shell.Suggested simplification
- name: Build docs - run: nix develop --command bash -c trilium-build-docs + run: nix develop --command trilium-build-docs🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 99 - 100, The CI step named "Build docs" currently wraps the command with an unnecessary shell invocation (`nix develop --command bash -c trilium-build-docs`); replace that with a direct command invocation by removing the `bash -c` wrapper so the step runs `nix develop --command trilium-build-docs`, leaving the step name and intent unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 24-38: The workflow is currently using a feature branch ref for
the reusable workflow (uses:
kalbasit/gh-actions/.github/workflows/ci.yml@feat-add-reusable-ci-workflows);
update the ref to a stable tag or commit SHA (e.g., `@v0.1.0` or a specific commit
SHA) to pin the dependency and remove the branch name, and add a TODO comment
(e.g., TODO(v0.1.0)) above the shared uses entry to remind maintainers to repin
once the release tag exists.
- Around line 99-100: The CI step named "Build docs" currently wraps the command
with an unnecessary shell invocation (`nix develop --command bash -c
trilium-build-docs`); replace that with a direct command invocation by removing
the `bash -c` wrapper so the step runs `nix develop --command
trilium-build-docs`, leaving the step name and intent unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2c0fc49d-8221-4a7e-b60d-c23f456cb1d3
📒 Files selected for processing (3)
.github/workflows/build.yml.github/workflows/ci.yml.github/workflows/releases.yml
💤 Files with no reviewable changes (1)
- .github/workflows/build.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1235 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace per-repo CI plumbing (filter, generate, build, multi-arch manifest, codecov, final gate) with a thin caller of the shared reusable workflow at kalbasit/gh-actions/.github/workflows/ci.yml@feat-add-reusable-ci-workflows. Delete the per-repo build.yml; the shared workflow handles flake-check, coverage, codecov upload, multi-arch OCI image build/ push, and manifest creation. ncps-specific work (sqlc database codegen and Cloudflare Pages docs deploy) stays in this file as sibling jobs because it doesn't generalize across the other consumers. The sibling jobs run their own dorny/paths-filter since the reusable workflow doesn't (today) re-expose filter outputs to the caller. A local final-gate job wraps both the shared workflow and the sibling jobs so branch protection only needs to require one check. Net diff: -245 / +68. No behavior change expected; will repin to @v0.1.0 once kalbasit/gh-actions tags it.
releases.yml was still calling ./.github/workflows/build.yml, the per-repo workflow this branch just deleted. That broke actionlint via the flake's treefmt check, which is exactly what surfaced the issue on the ncps CI PR: .github/workflows/releases.yml:11:11: could not read reusable workflow file for "./.github/workflows/build.yml": open /build/project/.github/workflows/build.yml: no such file or directory [workflow-call] Repoint releases.yml at the shared kalbasit/gh-actions/.github/workflows/build.yml@feat-add-reusable-ci-workflows with the renamed inputs (push_images -> push_oci, plus the new cachix_cache and primary_package inputs the shared workflow requires). Will repin to @v0.1.0 once gh-actions tags it.
gh-actions renamed the build.yml input `images` to `dockerhub_image` when making each registry independently opt-in. Update both ci.yml and releases.yml here to match. Pin is still @main so this will pick up the new input shape on next push. Behavior unchanged: ncps continues pushing to both kalbasit/ncps on Docker Hub and ghcr.io/<repo> by default.
Feature branch testing succeeded; gh-actions has merged to main. Switch both ci.yml and releases.yml pins back to @main now that the feat branch is no longer needed.
gh-actions/generate.yml renamed `packages` to `targets` and removed the implicit nix/packages/<pkg>/default.nix convention. Update the caller to the new shape with TWO targets: - ncps -> nix/packages/ncps/default.nix - checks.x86_64-linux.ent-codegen-drift-check -> nix/checks/flake-module.nix The second target couldn't be expressed under the old convention, which is why generate-database had been duplicating the verify-then-sed recipe locally. Delete those local "Update vendor hash for ..." steps and their go_deps-gated auto-commit — the shared workflow now handles both. Also drop the unused `go_deps` filter output and trim the generate-database job's outer `if` to only trigger on Ent changes. generate-database is now Ent-codegen-only. The shared workflow's generate job handles all Go vendor hashes. No more race on nix/packages/ncps/default.nix. Temporarily pin both ci.yml and releases.yml to @feat-generate-configurable-targets; will repin to @main once that PR merges.
781f4d0 to
bffbecc
Compare
The previous commit pinned both ci.yml and releases.yml to a non-existent branch @feat-generate-configurable-targets. The actual gh-actions branch holding this work is @user/wnasreddine/ci-jobs.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 57-59: The upload filter for the generate-database CI job is too
narrow (currently only "ent/schema/**" and "ent/generate.go"); update the
generate-database job's path filter (the ent: list in the workflow) to also
include Ent generator/tooling input files so changes to generator inputs trigger
the job—either replace the two entries with a broader "ent/**" or add the
specific generator input paths your repo uses (for example "ent/entc/**",
"ent/gqlgen/**", "ent/generator/**" or other generator-related files) so the
generate-database job will run when those inputs change.
- Around line 8-15: The CI workflow currently triggers on both pull_request and
push for branches including "release-*", which violates the stacked-PR rule;
update the pull_request and push triggers to only include branches: - main
(remove "release-*") so both the pull_request and push sections list only main,
ensuring branches is restricted to "main" for the pull_request and push triggers
(look for the pull_request, push, and branches entries in the CI YAML).
- Line 25: The workflow uses mutable refs for external actions
(`kalbasit/gh-actions/.github/workflows/ci.yml@feat-generate-configurable-targets`
and `stefanzweifel/git-auto-commit-action@v7`); update each `uses:` entry to
reference the corresponding immutable commit SHA instead of the branch or tag
(retrieve the current commit SHA for `kalbasit/gh-actions` and for
`stefanzweifel/git-auto-commit-action` from their repos and replace the `@...`
suffix with `@<commit-sha>`), then commit the updated ci.yml so CI runs are
pinned to those exact revisions.
- Around line 52-53: The actions/checkout@v6 step in the filter job currently
persists the runner auth token; update the checkout step used alongside
dorny/paths-filter@v4 to set persist-credentials: false so no credentials are
written to runner git config. Locate the checkout step (actions/checkout@v6) in
the filter job and add the persist-credentials: false input, keeping the rest of
the step unchanged.
In @.github/workflows/releases.yml:
- Line 11: Update the reusable workflow reference used by jobs.build so it no
longer points to the mutable branch ref
(kalbasit/gh-actions/.github/workflows/build.yml@user/wnasreddine/ci-jobs);
replace that branch ref with the exact immutable commit SHA for the target
commit so the workflow invocation is pinned to a specific commit SHA rather than
a branch name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8fd7824-871c-4e65-baf5-526bb18566c4
📒 Files selected for processing (3)
.github/workflows/build.yml.github/workflows/ci.yml.github/workflows/releases.yml
💤 Files with no reviewable changes (1)
- .github/workflows/build.yml
gh-actions PR #6 merged to main.
- Remove release-* from ci.yml triggers (PR #1235 PRRT_kwDONV6tZs6EVXg7): CLAUDE.md mandates main-only CI to keep stacked-PR workflows efficient. - Pin stefanzweifel/git-auto-commit-action to commit SHA 04702edda… (v7) (PR #1223 PRRT_kwDONV6tZs6EUFjb): prevents supply-chain mutation via mutable tag. - Add go.mod/go.sum to ent paths-filter (PR #1235 PRRT_kwDONV6tZs6EVXhI): Ent version bumps also require codegen re-run. - Update tasks.md 13.6 (PR #1223 PRRT_kwDONV6tZs6EUFjd): remove stale "no edits expected" note. - Replace wget healthcheck with /garage status (PR #1240 PRRT_kwDONV6tZs6EReph): wget absent in distroless image. - Remove mkdir -p with undefined vars (PR #1240 PRRT_kwDONV6tZs6ERepn): start-garage.sh already creates the dirs after deriving GARAGE_DATA_DIR/META_DIR. - Update D6 credential format (PR #1240 PRRT_kwDONV6tZs6ERepq): reflect actual GK-prefix key ID and 64-char hex secret used in implementation. - Fix profile-tests.sh to .py in design.md (PR #1246 PRRT_kwDONV6tZs6EViwJ): profiler is Python, not shell. - Remove redundant "when run locally" in spec.md (PR #1246 PRRT_kwDONV6tZs6EViwK): scenario heading already scopes to local execution. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
PR #1235 thread PRRT_kwDONV6tZs6EVXhB and PR #1235 thread PRRT_kwDONV6tZs6EVXhJ: pin every external 'uses:' in ci.yml and releases.yml to an immutable commit SHA (tag kept as comment) to prevent supply-chain mutation via mutable tag refs. Pinned: - actions/checkout@v6 → de0fac2e - dorny/paths-filter@v4 → fbd0ab8f - cachix/install-nix-action@v31 → b97f05dc - cachix/cachix-action@v17 → 02b16339 - cloudflare/wrangler-action@v4 → ebbaa158 - actions/github-script@v9 → 373c709c - softprops/action-gh-release@v3 → b4309332 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…1251) ## Summary Consolidation branch addressing unresolved reviewer threads left open across merged PRs #1179–#1246. Each fix has its own atomic commit referencing the source PR and thread ID; all threads are resolved on GitHub after each change. ### Bug fixes - **cache:** touch `nar_file` by fetched row ID, not by narURL fields — `getNarFileFromDB` can return a `compression=none` fallback whose key differs from `narURL`, causing stale `last_accessed_at` and LRU regressions (#1206) - **cache:** fail fast on `nil` eager-loaded chunk edges in `streamCompleteChunks` and `streamProgressiveChunks` instead of silently `continue`-ing, which caused count mismatches or infinite re-streaming (#1207) - **cache:** include `narURLsToRemove` in the LRU early-return guard so orphaned `NarFile` blobs are passed to `parallelDeleteFromStores` instead of being silently leaked in storage (#1215) - **cache:** log a warning when LRU candidate fetch hits the `maxFetchRows` cap so operators know eviction scanned only a partial window (#1206) - **cache/relink:** lower `relinkBatchSize` from 500 → 499 to stay under SQLite's 999-placeholder limit (500 rows × 2 binds = 1000 > 999) (#1208) - **database:** close `*sql.DB` in `Open()` when `NewClient` fails (#1208) - **migrate/adopt:** use `ErrUnknownState` (not `ErrUnknownDialect`) for unrecognised `State` values — fixes false-positive `errors.Is` checks (#1188) - **generate-migrations:** `parseSkip` validates dialect names, returning an error on unknown values like `"myslq"` instead of silently skipping them (#1187) - **generate-migrations:** `--sql-only` path now calls `ensureAtlasSum` after writing the stub so `atlas.sum` stays in sync (#1187) - **generate-migrations:** `runDialect` now returns the generated file path and prints it to stdout; `main()` warns when a second boundary falls between dialect runs so callers know to re-run for a consistent timestamp set (#1215) - **generate-migrations:** add `"empty"` to `validateName` reject list (#1185) - **nix/ent-lint-check:** add `set -o pipefail` so `ent-lint | tee` propagates a non-zero exit through the pipeline (#1221) - **e2e:** fix docstring path (`var/ncps/e2e-results/` → `.e2e-results/`); `mc mb` and `redis-cli flushall` now use `check=True` so reset failures abort the test immediately (#1233) - **e2e:** `stop_ncps` now verifies the port closes within timeout; `wait_ready` exits early if the child process dies before becoming ready (#1233) - **run.py:** guard `dbmate` usage with a `shutil.which` check so a missing binary fails fast with a clear message instead of an obscure error (#1234) - **CI:** pin all external GitHub Action refs to immutable commit SHAs to prevent supply-chain mutation (#1223) - **CI:** remove `release-*` from pull_request/push triggers; add `go.mod` and `go.sum` to the ent paths-filter (#1235) - **docs:** replace distroless-incompatible `wget` healthcheck in Docker Compose example with `garage status` (#1223) ### Test fixes - Replace non-fatal `assert.Len` → `require.Len` before indexing `stamps[0..2]` in `generate-migrations` tests (#1185) - Add 60 s timeout to the one-time `go build` in the test setup (#1241) - Fix `cache_prefetch_test.go` to look up `nar_file` by `(hash, compression, query)` instead of hard-coded `id=1` (#1218) - Apply `NarSize` fallback when `FileSize == 0` in `testhelper/sqlite.go` to avoid impossible `file_size=0` fixture rows for `compression=none` narinfos (#1218) - Increase `chunkingDelay` from 500 ms → 1 s in `cdc_test.go` to reduce flakiness on slow CI machines (#1217) - Replace `Lock`-with-timeout with `TryLock` in `cache_distributed_test.go` to avoid spurious failures when the lock-hold window is tight (#1217) ### Docs / skills - Quote PostgreSQL DSNs in shell-command examples to prevent `?`-glob expansion by shells (#1234) - `migrate-new/SKILL.md`: ent-lint checks A1, A2, A4 — not all five invariants as previously stated (#1225) - `migrate-down/SKILL.md`: clarify that `DROP COLUMN` is sensitive/forbidden DDL per the migration spec and is only permissible as the terminal expand-contract step; add the missing "deploy code that always writes non-null" step to the NOT NULL recipe (#1225) - `openspec/changes/archive/2026-05-23-less-tests/`: fix stale paths, add `bash` fence tag, replace "branch coverage" with "statement/block coverage" (#1245) - `openspec/specs/test-suite-efficiency/spec.md`: same coverage terminology fix (#1245) - `openspec/changes/archive/2026-05-21-migrate-to-ent-and-atlas/design.md`: add language tag to decision-tree fence block; fix grammar (#1186) - `openspec/changes/archive/2026-05-21-migrate-to-ent-and-atlas/tasks.md`: update §10.1/§11.1 notes to reflect that `*database.Client` threading was completed in §11, not deferred (#1191, #1192) ## Test plan - [x] `nix flake check` (includes all unit + integration tests, lint, ent-lint, atlas-sum, helm-unittest, schema-equivalence) - [x] `go test -race ./...` locally with `eval "$(enable-integration-tests)"` - [x] Verify all referenced GitHub threads are marked resolved 🤖 Generated with [Claude Code](https://claude.ai/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Replace per-repo CI plumbing (filter, generate, build, multi-arch
manifest, codecov, final gate) with a thin caller of the shared
reusable workflow at
kalbasit/gh-actions/.github/workflows/ci.yml@feat-add-reusable-ci-workflows.
Delete the per-repo build.yml; the shared workflow handles
flake-check, coverage, codecov upload, multi-arch OCI image build/
push, and manifest creation.
ncps-specific work (sqlc database codegen and Cloudflare Pages docs
deploy) stays in this file as sibling jobs because it doesn't
generalize across the other consumers. The sibling jobs run their
own dorny/paths-filter since the reusable workflow doesn't (today)
re-expose filter outputs to the caller.
A local final-gate job wraps both the shared workflow and the
sibling jobs so branch protection only needs to require one check.
Net diff: -245 / +68. No behavior change expected; will repin to
@v0.1.0 once kalbasit/gh-actions tags it.