Repository navigation
feat: configurable run log retention, plus exec and Makefile parsing fixes - #511
Conversation
tuikit capped the log archive at 50 files while run records are kept forever, so after 50 runs older history entries pointed at logs that no longer existed and failures could not be diagnosed. Add a logRetention user config (maxAge, maxSizeMB, maxCount) and a `flow config set log-retention` command, and pass the resulting policy to tuikit's archive. Unset fields default to 30 days, 500 MB, and 1000 logs; 0 removes a limit. pkg/logger takes the policy as an optional InitOptions field so embedders keep tuikit's default until they opt in. go.mod pins tuikit to the unreleased retention commit; bump it to the release before merging.
The refusal said the executable belonged to another workspace, which reads like a lookup bug. The real reason is its visibility. Name that, and say how to proceed: switch workspace, or make it public. Hidden executables get their own message since switching would not help.
|
Verification (local, on a04c244 with tuikit pinned to f433840):
Left to CI: |
Help comments written as '## Build the images' kept a '#' in the discovered description because only one '#' was trimmed. Trim them all, so a bare '##' separator line adds nothing.
|
Verification for 457ce70 (Makefile
Left to CI: e2e and the full |
|
Bumped tuikit from the branch pin to the v0.6.2 release, which contains #126 and has the same code as the commit pinned before. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Run log retention. tuikit capped the log archive at 50 files while run records in the store are kept forever, so after 50 runs older history entries pointed at logs that no longer existed and failed runs couldn't be diagnosed. This adds a
logRetentionuser config and passes it to tuikit's new archive retention policy (flowexec/tuikit#126, released in v0.6.2).Cross-workspace refusal. Running another workspace's executable failed with "belongs to workspace X and cannot be run from the current workspace Y", which reads like a lookup bug. The real reason is the executable's visibility, so the message now says it's private to its workspace and how to proceed. Visibility semantics are unchanged.
Makefile help comments. Discovered Makefile targets documented with
## Build the imageskept a#in their description, because the parser trimmed only one. It now strips every leading#, so a bare##separator line adds nothing.Notable Changes
logRetention: {maxAge, maxSizeMB, maxCount}in the user config schema (types regenerated). Unset fields use the defaults below;0removes that limit; negatives fail validation.flow config set log-retention [--max-age DURATION] [--max-size-mb N] [--max-count N]changes only the flags passed.flow config getshows the effective limits.pkg/logger.InitOptions.ArchiveRetentionis an optional*io.RetentionPolicy. Nil keeps tuikit's default (50 files), so embedders ofpkg/loggerdon't change behavior until they pass a policy;main.gopassescfg.LogRetentionPolicy().executable '<ref>' is private to workspace '<ws>' and cannot be run from workspace '<current>'. Switch to it with 'flow workspace switch <ws>', or set 'visibility: public' in its flow file. Hidden executables are refused even from their own workspace, so they get their own message.Defaults (tune as needed)
maxAge720h)maxSizeMBmaxCountAny limit that's exceeded prunes the oldest logs first.
Not done: keeping failed runs' logs over successful ones. Logs are pruned when the logger starts, before the store is opened, and the store keeps every record forever. Preferring failed runs would mean reading the whole run history on every executable invocation and coupling logger startup to the store. The new defaults keep far more history than before, so I left it out. If it's wanted, a cheap version would be a keep-predicate on the tuikit policy, fed from the run records.