-
Notifications
You must be signed in to change notification settings - Fork 0
Add gapp refresh to sync local cache from GitHub + GCP #3
Copy link
Copy link
Open
Description
Summary
Add a gapp refresh command that bulk-syncs the local solutions cache from GitHub and GCP, replacing gapp list --available as the primary discovery mechanism. Move solutions.yaml from ~/.config/gapp/ (XDG_CONFIG) to ~/.cache/gapp/ (XDG_CACHE) to reflect its true nature — reconstructable, machine-specific, potentially stale.
What it does
- Query GitHub for all repos with
gapp-solutiontopic - For each solution, discover the GCP project via labels (
gapp-{name}=default) - Write everything to
~/.cache/gapp/solutions.yaml - Warn if refresh has never been run (e.g., on
gapp statuswhen the cache file doesn't exist)
After refresh, gapp status project suggestions become instant (local read), gapp list shows everything without --available, and project ID resolution works for solutions that haven't been touched locally.
Why XDG_CACHE
solutions.yamlis fully reconstructable from GitHub + GCP — it's a cache, not configurationrepo_pathis machine-specific and shouldn't be assumed portable across machines- Deletable without data loss — just re-run
gapp refresh - Communicates staleness to the user — cache semantics set the right expectations
Implications not fully thought through
- Solutions without local clones: After refresh, solutions appear in the cache with
repo_path: null.resolve_solution(name)already handles this.gapp setupwould work (only needs project_id).gapp deploycurrently requires a local repo forgit archive HEAD— but could potentially work remotely (see below). - Remote deploy without clone: If
gapp deploycouldgit archivefrom a GitHub remote (viaghor git clone --bare into a temp dir), you could deploy any refreshed solution without cloning it locally. This would makegapp refresh+gapp deploy <name>a full remote workflow. Not implemented yet — needs design. - Clone on demand:
gapp refreshcould enable a lightweightgapp clone <name>that knows where to clone from (GitHub repo is in the cache). Orgapp deploycould auto-clone to a temp dir whenrepo_pathis null. - Cache invalidation: How stale is too stale? Should
gapp statuswarn if the cache is older than N days? Should certain commands auto-refresh? - Migration: Existing
~/.config/gapp/solutions.yamlusers need a migration path. Could auto-migrate on first run. - CI interactions:
gapp ci triggeralready works by name without a local repo. After refresh, the cache would have the project_id populated, making CI commands work more reliably on fresh machines.
Replaces
gapp list --available(the--availableflag queries GitHub on every call; refresh does it once and caches)
Related
This would improve gapp status project suggestions (#3 pending) by having more solutions and project IDs in the local cache without requiring each solution to have been gapp init'd on this machine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels