Commit 426bee8
feat: add required cache-key input, native GC, and server-driven config for v2 (#108)
* feat: add required cache-key input for v2
Replace the hardcoded GITHUB_REPO_NAME sticky disk key with a required
cache-key input. Users must explicitly declare which cache entity their
build targets, preventing cache thrashing in multi-target repos.
The cache-key is saved to action state and passed through to the commit
phase so the same key is used for both expose and commit RPCs.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: replace manual pruning with buildkit native gc
Remove max-cache-size-mb input and manual buildctl prune from the post
phase. Enable BuildKit's native garbage collection with a time-based
policy (keepDuration=192h / 8 days). Layers unused for longer than the
retention period are automatically cleaned up; active layers survive
indefinitely regardless of total cache size.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: add server-driven config infrastructure for GC and pre-commit hooks
Add BuildkitdConfig and PreCommitHook interfaces (server-config.ts) that
define the contract for server-driven cache lifecycle management. The
action reads BuildkitdConfig from the GetStickyDisk RPC response (with
hardcoded fallback for Phase 1) and runs pre-commit hooks from the
PrepareCommit RPC response before committing.
Refactor writeBuildkitdTomlFile to accept a BuildkitdConfig parameter
instead of hardcoding GC policy values. This makes it trivial to switch
from hardcoded defaults to server-provided config when the proto is
updated (Phase 2).
Add runPreCommitHooks dispatcher that executes an ordered list of opaque
shell commands with timeout and failure mode handling. The commit flow
now goes through prepareCommit -> runHooks -> conditionalCommit, with
Phase 1 returning unconditional commit + empty hooks.
Phase 1 (now): hardcoded gc=true, keepDuration=192h, no hooks
Phase 2: server returns BuildkitdConfig in GetStickyDiskResponse
Phase 3: server returns hooks via PrepareCommit RPC
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* chore: remove unused rollup build artifacts
Remove rollup.config.js and rollup devDependencies (@rollup/plugin-node-resolve,
@rollup/plugin-typescript, rollup). The repo switched to ncc for bundling in
commit 2ffcb3d; rollup artifacts were never cleaned up. The dist/main.bundle.mjs
file was already deleted in a prior commit.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent ab5c1da commit 426bee8
12 files changed
Lines changed: 175 additions & 1134 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments