Add describe changed command to check if a package needs rebuild#339
Add describe changed command to check if a package needs rebuild#339
describe changed command to check if a package needs rebuild#339Conversation
Adds a new subcommand that checks whether a package's current version exists in the local or remote cache. Exits 0 if cached (unchanged), 1 if not (needs rebuild). Intended for CI branching decisions. Co-authored-by: Ona <no-reply@ona.com>
WVerlaek
left a comment
There was a problem hiding this comment.
Ona also had some other comments that I think make sense, will post them below
cmd/describe-changed.go
Outdated
| return | ||
| } | ||
| if pkg == nil { | ||
| log.Fatal("changed requires a package, not a component") |
There was a problem hiding this comment.
How would you differentiate a fatal error like this from "changed"? Both exit with code 1
PR Review:
|
Addresses review feedback: errors now exit with code 2 so CI scripts can distinguish 'package changed' (exit 1) from 'something went wrong' (exit 2). Co-authored-by: Ona <no-reply@ona.com>
|
Addressed in 19c4551 — exit codes are now:
Errors within the command's own logic (version computation, cache setup, remote cache check) now use Note: |
Description
Adds
leeway describe changed <package>— a lightweight command that checks whether a package's current version hash exists in the local or remote cache.Exit codes:
This enables CI branching decisions without running a full
build --dry-runacross the entire workspace:The command reuses the existing
LocalCache.Location()andRemoteCache.ExistingPackages()infrastructure, so it respects the sameLEEWAY_CACHE_DIR,LEEWAY_REMOTE_CACHE_BUCKET, andLEEWAY_REMOTE_CACHE_STORAGEconfiguration asleeway build.Output is a tab-separated line:
<package>\t<version>\t<status>where status is one ofcached locally,cached remotely, orchanged.Related Issue(s)
Fixes CORE-
How to test