microsoft / microsoft/amplifier

sources.bundles setting exists in settings API but isn't wired into bundle discovery

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
261
Avg merge
3h 28m
Merged PRs (30d)
13

Description

Description

The AppSettings.get_bundle_sources() method exists in amplifier_app_cli/lib/settings.py and allows users to configure bundle source overrides via settings.yaml:

sources:
  bundles:
    workspaces: "file://.amplifier"

However, this setting is never used by bundle discovery. The AppBundleDiscovery.find() method in amplifier_app_cli/lib/bundle_loader/discovery.py only checks:

  1. Registry (well-known bundles, user registry)
  2. Filesystem search paths

It never calls get_bundle_sources() to check for source overrides.

Impact

  • Users cannot use sources.bundles in project settings.yaml to make bundles self-contained
  • The amplifier source add <bundle> <path> command for bundles does not actually affect bundle resolution
  • amplifier source list shows bundle sources but they do not do anything

Expected Behavior

sources.bundles overrides should be checked during bundle discovery, similar to how sources.modules works for module resolution.

Reproduction

  1. Create .amplifier/settings.yaml with:
    bundle:
      active: workspaces
    sources:
      bundles:
        workspaces: "file://.amplifier"
    
  2. Run amplifier bundle show workspaces
  3. Error: "No handler for URI: workspaces"

Workaround

Use a URI directly in bundle.active:

bundle:
  active: "file://.amplifier"

Affected Component

amplifier-app-cli - amplifier_app_cli/lib/bundle_loader/discovery.py

Suggested Fix

In AppBundleDiscovery.find(), check AppSettings().get_bundle_sources() before falling back to filesystem search paths:

def find(self, name: str) -> str | None:
    # Check registry first
    uri = self._registry.find(name)
    if uri:
        return uri
    
    # Check settings source overrides (NEW)
    from ..lib.settings import AppSettings
    bundle_sources = AppSettings().get_bundle_sources()
    if name in bundle_sources:
        return bundle_sources[name]
    
    # Search filesystem paths
    ...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read amplifier_app_cli/lib/settings.py and amplifier_app_cli/lib/bundle_loader/discovery.py, then reproduce the issue with amplifier bundle show workspaces using the settings.yaml example. Compare bundle discovery with the existing sources.modules behavior. Done means a sources.bundles override resolves the named bundle and amplifier source list entries affect bundle resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.