ext: derive type: path mounts from config, drop ext-paths.json#167
Open
mobileoverlord wants to merge 1 commit into
Open
ext: derive type: path mounts from config, drop ext-paths.json#167mobileoverlord wants to merge 1 commit into
type: path mounts from config, drop ext-paths.json#167mobileoverlord wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes avocado.yaml the single source of truth for type: path extension mounts by removing the persisted .avocado/ext-paths.json state and instead deriving path mounts directly from the config at container launch, while also resolving path-based extension configs directly from their declared source.path.
Changes:
- Removed
ExtensionPathStateand stopped writing.avocado/ext-paths.json;ext fetchfortype: pathis now validation-only. - Added
SdkContainer::derive_ext_path_mountsto parse + interpolateavocado.yamland derive bindfs mounts forsource: { type: path }extensions. - Updated config composition to read a path extension’s config directly from its declared
source.pathinstead of consulting a state file; added tests for mount derivation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/utils/ext_fetch.rs | Removes persisted path-mount state and makes path-extension fetch validation-only. |
| src/utils/container.rs | Derives type: path bindfs mounts from avocado.yaml at container launch; adds tests. |
| src/utils/config.rs | Resolves path-based extension configs directly from source.path during composition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Make avocado.yaml the single source of truth for path-sourced extension
mounts. Previously `avocado ext fetch` recorded resolved path mounts in
`.avocado/ext-paths.json`, which was read both at container launch (for bindfs
mounts) and during config composition. That side-table drifted from the config
whenever an extension's `source` flipped between `package` and `path` — a stale
entry kept mounting a host path over an extension that was now a package.
Path mounts are now derived directly from the extension `source` declaration:
- container: SdkContainer::derive_ext_path_mounts() reads + interpolates
avocado.yaml and mounts every `source: { type: path }` extension (replaces
load_ext_path_mounts / the state file read)
- config: merge_installed_remote_extensions resolves a path-based extension's
config from its declared `source.path` instead of ext-paths.json
- ext_fetch: remove ExtensionPathState entirely; `ext fetch` for a path
extension is now validation-only (no state written)
Flipping package<->path now takes effect immediately with nothing to reconcile.
34b3572 to
eb3803e
Compare
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.
Summary
Makes
avocado.yamlthe single source of truth fortype: pathextensionmounts. Previously
avocado ext fetchrecorded resolved mounts in.avocado/ext-paths.json, which was read both at container launch (for bindfsmounts) and during config composition. That side-table could drift from the
config whenever an extension's
sourceflipped betweenpackageandpath—a stale entry kept mounting a host path over an extension that was now a
package.
Details
SdkContainer::derive_ext_path_mountsreads + interpolatesavocado.yamlandmounts every
source: { type: path }extension (replaces the state-file readat container launch).
declared
source.pathinstead of the state file.ExtensionPathStateentirely;ext fetchfor a path extension is nowvalidation-only (nothing is written).
Flipping an extension between
packageandpathnow takes effect immediatelywith nothing to reconcile.
Follow-up (out of scope)
A separate change will clear a previously package-populated
includes/<ext>when switching it to
path, so bindfs mounts onto a clean directory.Testing
pathsource is mounted, apackagesource is ignored; no path sources → no mounts).cargo build,cargo test, andcargo clippyare green.