Skip to content

Make repository refresh policy explicit - #52

Merged
jhuntwork merged 2 commits into
mainfrom
repository-sync-policy
Aug 23, 2026
Merged

Make repository refresh policy explicit#52
jhuntwork merged 2 commits into
mainfrom
repository-sync-policy

Conversation

@jhuntwork

Copy link
Copy Markdown
Owner

Repository-dependent commands currently disagree about when signed metadata is refreshed: search does not apply the configured interval, normal operations cannot suppress refresh precisely, and there is no strict operation for callers that need refresh failure to be observable. Review should establish one durable synchronization contract rather than judge command-specific fixes.

This change keeps automatic interval-based refresh as the rolling-release default and applies it consistently to install, upgrade, uninstall, and search. --sync forces an attempt while ordinary commands retain verified-cache fallback; --no-sync suppresses metadata refresh without preventing package archive downloads. The two flags are mutually exclusive.

mere sync [repositories...] is the strict form. It refreshes all enabled or named repositories, reports each failure, preserves the prior verified cache, and exits nonzero when any requested source fails. Search warns and returns partial results when at least one verified repository remains usable.

Refresh check, download, verification, and atomic publication are serialized per repository, so unrelated repositories do not share a global lock and concurrent writers cannot collide on staging paths. Future last-sync timestamps no longer suppress refresh indefinitely.

Configuration now writes and documents sync-interval; existing sync-ttl input remains readable as a compatibility alias because elapsed time triggers an attempt rather than invalidating verified metadata.

Proof is inspectable in workflow run a951a1d3-f57e-438a-9213-3b99342bf7cd: 762 tests passed with 2 skipped, the -Dcpu=baseline build passed, and the built CLI describe smoke passed.

Repository-dependent commands now share one visible refresh contract instead of resolving against metadata according to command-specific behavior. Automatic interval refresh remains the rolling-release default, while forced and suppressed refresh are explicit and standalone sync is strict.

Verified cached metadata remains available when ordinary refresh attempts fail, search can preserve partial results, and per-repository publication prevents concurrent refreshes from colliding. The sync-ttl spelling remains readable for compatibility, but sync-interval is the durable name because elapsed time triggers refresh rather than invalidating a cache.
Repository selection, refresh policy, verification, and outcomes now have one owner shared by package resolution, search, and standalone sync. This prevents command-specific semantics from drifting while preserving availability-first cached fallback and strict explicit synchronization.

CLI commands now parse common flags, establish transfer adapters, and render structured core outcomes rather than owning repository policy.
@jhuntwork
jhuntwork merged commit 95540c1 into main Aug 23, 2026
2 checks passed
@jhuntwork
jhuntwork deleted the repository-sync-policy branch August 23, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant