Commit accc536
committed
fix(offline): honor OFFLINE_WORK in git-ref2info and memoize TTL
Fixes #6439.
memoized_git_ref_to_info() unconditionally ran 'git ls-remote' against the
upstream source even with OFFLINE_WORK=yes; when the remote was unreachable
the build aborted with a misleading network error.
Two coordinated guards:
* memoize-cached.sh: when OFFLINE_WORK=yes, serve the cache file regardless
of TTL (alternative is a network call that will fail). The "stale cache
served" event is logged.
* git-ref2info.sh: early offline guard before the ls-remote loop. For
ref_type=commit the SHA1 is taken from the ref itself (no network); for
branch/tag we look up a pinned SHA1 in config/sources/git_sources.json.
If neither is available, exit_with_error with a clear message instead
of letting curl/ls-remote surface as 502.
Same guard applied to the include_makefile_body block (curl to git host)
since there is no local-bare fallback in scope here.
Behaviour matrix unchanged for OFFLINE_WORK=no (default).
Assisted-by: Claude:claude-opus-4.71 parent 4a09ca3 commit accc536
2 files changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
228 | 248 | | |
229 | 249 | | |
230 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
231 | 259 | | |
232 | 260 | | |
233 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
0 commit comments