Skip to content

ext: derive type: path mounts from config, drop ext-paths.json#167

Open
mobileoverlord wants to merge 1 commit into
mainfrom
jschneck/derive-ext-path-mounts
Open

ext: derive type: path mounts from config, drop ext-paths.json#167
mobileoverlord wants to merge 1 commit into
mainfrom
jschneck/derive-ext-path-mounts

Conversation

@mobileoverlord

Copy link
Copy Markdown
Contributor

Summary

Makes avocado.yaml the single source of truth for type: path extension
mounts. Previously avocado ext fetch recorded resolved mounts in
.avocado/ext-paths.json, which was read both at container launch (for bindfs
mounts) and during config composition. That side-table could drift 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.

Details

  • SdkContainer::derive_ext_path_mounts reads + interpolates avocado.yaml and
    mounts every source: { type: path } extension (replaces the state-file read
    at container launch).
  • Config composition resolves a path-based extension's config directly from its
    declared source.path instead of the state file.
  • Removes ExtensionPathState entirely; ext fetch for a path extension is now
    validation-only (nothing is written).

Flipping an extension between package and path now takes effect immediately
with 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

  • Added tests for deriving mounts from config (a path source is mounted, a
    package source is ignored; no path sources → no mounts).
  • cargo build, cargo test, and cargo clippy are green.

Copilot AI review requested due to automatic review settings July 3, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ExtensionPathState and stopped writing .avocado/ext-paths.json; ext fetch for type: path is now validation-only.
  • Added SdkContainer::derive_ext_path_mounts to parse + interpolate avocado.yaml and derive bindfs mounts for source: { type: path } extensions.
  • Updated config composition to read a path extension’s config directly from its declared source.path instead 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.

Comment thread src/utils/container.rs
Comment thread src/utils/config.rs
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.
@mobileoverlord mobileoverlord force-pushed the jschneck/derive-ext-path-mounts branch from 34b3572 to eb3803e Compare July 3, 2026 16:02
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.

2 participants