Repository navigation
fix: align update artifacts with release policy - #363
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (12)
WalkthroughThe update system now uses configurable archive and binary size policies. It validates release artifacts before extraction, reports typed size errors, supports archive checks during publishing, and records direct-binary recovery instructions for failed updates. ChangesArtifact update policy
Sequence Diagram(s)sequenceDiagram
participant User
participant UpdateCLI
participant UpdateManager
participant ReleaseArtifact
participant UpdateState
User->>UpdateCLI: Run update command
UpdateCLI->>UpdateManager: Apply release
UpdateManager->>ReleaseArtifact: Download and validate artifact sizes
ReleaseArtifact-->>UpdateManager: ArtifactSizeError
UpdateManager-->>UpdateCLI: Return typed size error
UpdateCLI->>UpdateState: Store release URL and host OS recommendation
UpdateCLI-->>User: Report failure and direct-binary instruction
Mergeability Score: ⚪ Minimal · up to The update policy and release validation changes are covered by targeted regression checks and passing verification; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: build constraints exclude all Go files in /magefiles" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| internal/update/manager_archive.go | Refactors tar inspection into shared runtime/release validation with pre-application binary-size enforcement. |
| internal/update/artifact_policy.go | Defines the shared archive and extracted-binary limits plus typed policy errors. |
| internal/cli/update.go | Maps artifact-policy failures to manual recovery and clears stale recommendations on successful terminal paths. |
| magefiles/update_archive.go | Adds the Mage entry point used to validate supported direct-update archives before publication. |
| .goreleaser.yml | Wires archive validation into the GoReleaser Pro before-publish phase. |
| internal/update/manager_apply_test.go | Adds policy regression coverage but discards a constructor error in the new binary-size test. |
Sequence Diagram
sequenceDiagram
participant Release as GoReleaser
participant Hook as UpdateArchiveCheck
participant Policy as Artifact Policy
participant CLI as compozy update
participant Manager as Update Manager
Release->>Hook: Validate built archive
Hook->>Policy: Check archive and binary sizes
Policy-->>Release: Accept or stop publication
CLI->>Manager: Apply selected release
Manager->>Policy: Check downloaded archive and extracted binary
alt Artifact accepted
Manager-->>CLI: Replace and finalize binary
CLI-->>CLI: Clear stale recommendation
else Artifact exceeds policy
Policy-->>CLI: ArtifactSizeError
CLI-->>CLI: Show manual replacement guidance
end
Reviews (1): Last reviewed commit: "fix: align update artifacts with release..." | Re-trigger Greptile
|
|
||
| verifier := &stubBundleVerifier{} | ||
| applier := &recordingBinaryApplier{} | ||
| manager, _ := newManagerWithExecutable(t, Config{ |
There was a problem hiding this comment.
Constructor error is discarded
The new oversized-binary test assigns the error from newManagerWithExecutable to _, so a setup failure can surface later as a misleading panic or assertion failure instead of identifying the constructor error.
Context Used: CLAUDE.md (source)
Closes #359.
What broke
The direct-binary updater treated the compressed archive and the extracted executable as if they had the same 128 MiB safety envelope. The official beta.13 Darwin arm64 archive is 49,342,626 bytes, but its verified
compozyentry is 135,516,530 bytes, so the runtime rejected an artifact produced by CompozyOS's own release pipeline.This was a producer/consumer contract gap: the runtime enforced a private limit, while GoReleaser had no pre-publication check proving that a release archive was consumable. Retrying could never succeed, yet the failed command still recommended another
compozy update.What changed
ArtifactSizeError.before_publishhook for the Darwin/Linuxcompozy-archiveartifacts. The Mage target validates each built archive against the runtime policy before publication can begin.Regression coverage
internal/update: rejects an archive above policy as a typed archive error; rejects an extracted binary above a configurable policy before applying it.internal/cli: converts artifact policy failures to manual recovery and never repeats the failed update command; successful updates no longer retain the pre-update recommendation.internal/config: proves the release configuration invokes the archive contract forcompozy-archiveartifacts before publication.Test placement follows the existing canonical suites: runtime policy belongs to
TestManagerApplyRelease, command behavior belongs toTestUpdateCommandFlows, and release wiring belongs toTestGoReleaserConfigPreservesTrustArtifactsAndPackageTargets.Production-like QA
clean: true; no daemon, watcher, browser, or lab process remained.Verification
make gate-full: PASS760d454386dbbe5262a5e4ce3ad886b6afc70b9bCGO_ENABLED=1 go test -race ./internal/update: PASSCGO_ENABLED=1 go test -race ./internal/cli ./internal/config -count=1: PASSgolangci-lintforinternal/update: PASSBroader auto-update audit
The whole auto-update area was explored across artifact integrity, runtime surfaces, and release production. The following adjacent gaps are deliberately not bundled into this fix because they require separate contracts:
None changes the root cause or safety of this patch; each should be handled independently rather than hidden behind compatibility or fallback code.
Compozy Impact Audit
compozy__*tool IDs, toolsets, descriptors, schemas, digests, risk flags, availability diagnostics, and capability gates; update is a CLI/runtime path and exposes no native tool contract.before_publishhook now consumes the runtime-owned artifact policy. Checked extensions, runtime hooks, capabilities, tools/resources, registries, bridge SDKs, and MCP sidecars; none use or expose self-update artifacts. Noconfig.tomlkey, default, or lifecycle changed.workspace_idpath changed.skills/compozy/references/runtime-operations.mdso agents use manual release replacement after a deterministic artifact-policy failure instead of retrying the same command.Web / docs impact
No Web route, component, hook, or site documentation contract changed. The user-visible CLI recovery behavior is covered in the official built-in skill and the tracked QA scenarios/report.
Summary by CodeRabbit