Repository navigation
Conversation
On a plane, behind an air gap or on a flaky link, every avocado command still opens sockets before doing local work: the background release check, and the feed preflight that probes each feed the command's stages use. With no network the preflight fails the command even when every package is already in the SDK, so there is no way to work from what is installed. I add a global --offline flag, with AVOCADO_OFFLINE=1 (or true/yes, the spellings AVOCADO_REPO_INSECURE accepts) as the environment equivalent, resolved once in main into a process-wide flag that every network caller reads. This commit wires the two callers that run on every command: the release check is not spawned, and preflight_feeds_once returns before probing or recording anything, so a later online call in the same process still probes the stages it needs. The skip is announced once, like the --runs-on skip. The preflight tests that read the flag now share the offline serial key, so a test flipping it cannot make another skip its probes. Signed-off-by: Javier Tia <javier@peridio.com>
With the preflight skipped, two feed steps still dial out under --offline. check_addons fetches targets.json to confirm each add-on feed exists for the target, and resolve_connect_credentials mints a Connect feed token over HTTPS. The first turns an offline run into a network failure for no gain, and the second fails deep inside the mint with a connection error that never says offline was the cause. The add-on check is skipped offline, leaving dnf to report a real miss, the same way it already does when the index cannot be read. The mint refuses before any socket opens and names the Connect feeds that need a token, because a short-lived token cannot be replaced by anything recorded locally. A stage that uses no Connect feed still returns early and is unaffected. connect_feed_stores_the_rewrite_decision mints a token, so it now reads the flag and joins the offline serial key. Signed-off-by: Javier Tia <javier@peridio.com>
Snapshot pinning talks to the feed on every feed-touching command: it confirms the locked pin still exists, looks for a newer snapshot, and with no pin fetches the channel's latest and records it. Under --offline each of those is a request that cannot succeed, so a project with a perfectly good pin in avocado.lock could still not build. Offline, a matching pin is exported as-is and a line says which pin is in use and that no newer-snapshot check was made, printed once per run so a stale pin is never silent and never repeated per install task. With no pin, the default avocado feed is refused with a message naming `avocado update`, because that feed always publishes snapshots and the missing pin is a gap one online run fills. A custom feed proceeds unpinned with a one-time note, since a feed that serves no snapshots can never have a pin and refusing would make offline unusable there. `avocado update` refuses offline before any request, but only after the override and missing-release checks, which need no network and still return their usual answer. Signed-off-by: Javier Tia <javier@peridio.com>
--offline changes what several commands do without the network, and two of those changes are easy to misread: a locked pin is used however old it is, and the package manager inside the SDK container is not made offline at all. Without a page, a user reads the flag as "builds work without a network" and is surprised by both. docs/offline.md states what the CLI skips, what happens with no locked pin on the default feed versus another repository, which commands still need the network and fail naming --offline, and what the flag leaves to dnf. The CHANGELOG entry summarises the same and points at the page. Signed-off-by: Javier Tia <javier@peridio.com>
cargo audit reports a spin loop in quinn-udp 0.5.14 after a truncated datagram, and the pre-push hook refuses every push of a branch built on main while the lockfile still pins it. A lockfile-only bump to 0.5.16, the patched release inside the same semver range. It becomes a no-op on rebase once main carries the same bump. Signed-off-by: Javier Tia <javier@peridio.com>
Bring the stack base's latest main merge into the offline-flag branch so the PR stops conflicting. CHANGELOG.md collided in the Unreleased/Added list: the offline entry and the feed index and package-scriptlet entries were all added at the same spot, so both sides are kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a plane or behind an air gap, every avocado command still dials out before local work: the release check, the feed preflight, the snapshot pin checks, add-on lookups and Connect token minting. With no network the command fails even when the SDK already holds everything.
I add a global
--offlineflag, orAVOCADO_OFFLINEset to1,trueoryes. With it, avocado skips those requests and uses the locked pin, printing it once. With no pin on the default feed it stops and namesavocado update. Commands that truly need the network fail naming--offline. dnf inside the SDK is unchanged; seedocs/offline.md.This PR is stacked on #394, because it changes the preflight code that PR reworks (
preflight_feeds_oncenow takes the stages it probes). The last commit is a lockfile-onlyquinn-udpbump for the pre-push audit hook.With
strace -f -e trace=connect, the sameinstallmade two inet connections online and none with--offline.