Skip to content

Fix/selective install#52

Merged
danielmeppiel merged 4 commits into
mainfrom
fix/selective-install
Dec 9, 2025
Merged

Fix/selective install#52
danielmeppiel merged 4 commits into
mainfrom
fix/selective-install

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

This pull request fixes a bug where running apm install <package> would incorrectly install all packages from apm.yml instead of just the specified package. Now, apm install <package> only installs the requested package(s), while apm install without arguments continues to install all packages. The update also includes new tests to ensure the selective installation logic works as intended.

- Added only_packages filter to _install_apm_dependencies()
- Uses endswith() matching to handle host prefix differences
- Uses builtins.list/set to avoid Click command shadowing
- apm install (no args) still installs all from apm.yml
Tests cover the filter matching logic that ensures:
- apm install <package> only installs that specific package
- Filter correctly handles host prefix mismatch (github.com/owner/repo vs owner/repo)
- Virtual packages with subdirectory paths match correctly
- Non-matching packages are correctly excluded

The test_real_bug_case_mcp_builder_vs_design_guidelines test directly
covers the bug where installing mcp-builder also installed design-guidelines.
apm install <package> now only installs the specified package.
apm install (no args) continues to install all from apm.yml.

- Added only_packages filter to _install_apm_dependencies()
- Uses endswith() matching to handle host prefix differences
- Added unit tests for filter matching logic
- Bumped version to 0.6.3
Copilot AI review requested due to automatic review settings December 9, 2025 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a critical bug where apm install <package> was incorrectly installing all packages from apm.yml instead of only the specified package(s). The fix introduces selective installation by passing the requested packages as a filter to the _install_apm_dependencies function.

Key Changes:

  • Added only_packages parameter to _install_apm_dependencies() to enable selective filtering
  • Implemented filtering logic to match user-specified packages against resolved dependencies
  • Added comprehensive unit tests for the filter matching logic covering various edge cases

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/apm_cli/cli.py Added only_pkgs parameter passing and filtering logic in _install_apm_dependencies() to install only specified packages; fixed return values to always return tuple
tests/unit/test_selective_install.py New test suite with 12 test cases covering filter matching logic including host prefixes, virtual packages, Azure DevOps, and edge cases
pyproject.toml Version bump from 0.6.2 to 0.6.3
CHANGELOG.md Added entry documenting the selective install fix

Comment thread tests/unit/test_selective_install.py
Comment thread src/apm_cli/cli.py Outdated
Comment thread tests/unit/test_selective_install.py
Comment thread src/apm_cli/cli.py
Comment thread tests/unit/test_selective_install.py Outdated
Comment thread tests/unit/test_selective_install.py Outdated
Code review fixes:
- Fixed substring owner bug: 'prefix-owner/repo' no longer matches 'owner/repo'
- Changed endswith(pkg) to endswith(f'/{pkg}') for path boundary matching
- Added test for substring owner names
- Removed unused pytest import
- Updated docs/cli-reference.md to clarify selective install behavior

CI fix:
- Added _git/ normalization for ADO URLs in filter matching
- User passes: dev.azure.com/org/proj/_git/repo
- Dep string is: dev.azure.com/org/proj/repo (normalized)
- Filter now normalizes _git/ before comparing
- Added test for ADO _git/ normalization
@danielmeppiel danielmeppiel merged commit 57f96a8 into main Dec 9, 2025
22 checks passed
@danielmeppiel danielmeppiel deleted the fix/selective-install branch February 27, 2026 09:41
sergio-sisternes-epam pushed a commit that referenced this pull request May 19, 2026
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