fix: pass scope to deps update so -g flag works correctly#575
Closed
danielmeppiel wants to merge 1 commit intomainfrom
Closed
fix: pass scope to deps update so -g flag works correctly#575danielmeppiel wants to merge 1 commit intomainfrom
danielmeppiel wants to merge 1 commit intomainfrom
Conversation
apm deps update -g silently ignored the scope parameter, causing user-scope updates to resolve targets against Path.cwd() instead of Path.home(), deploy files to the wrong directory, and write the lockfile to the wrong location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a scope propagation bug in apm deps update so that -g/--global correctly performs a user-scope update (resolving paths and writing outputs under the user APM directory rather than the project directory).
Changes:
- Pass
scope=scopethrough to_install_apm_dependencies()from thedeps updatecommand.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/commands/deps/cli.py |
Ensures deps update forwards the computed install scope to the install engine so -g updates run in user scope. |
Copilot's findings
- Files reviewed: 1/2 changed files
- Comments generated: 1
Comment on lines
608
to
612
| logger=logger, | ||
| auth_resolver=auth_resolver, | ||
| target=target, | ||
| scope=scope, | ||
| ) |
There was a problem hiding this comment.
Add a CLI-layer unit test covering apm deps update -g to ensure scope is propagated to _install_apm_dependencies as InstallScope.USER (and not defaulting to project scope). The existing deps-update tests assert other flag wiring but currently don't exercise the global/user-scope path, so this regression could reappear unnoticed.
Collaborator
Author
|
Moving this fix into #562 which is the active architecture PR. |
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.
Description
apm deps update -gsilently ignored the scope, causing user-scope updates to resolve targets againstPath.cwd()instead ofPath.home(), deploy files to the wrong directory, and write the lockfile to the wrong location.Root cause:
deps/cli.py:601called_install_apm_dependencies()without passingscope=scope. The function defaults toInstallScope.PROJECTwhen scope is not provided.Fix: One line -- add
scope=scopeto the call.Found during architecture audit (see
WIP/scope-audit-findings.md).Type of change
Testing
deps update -g-- tracked as a test coverage gap