feat: improve version pinning guidance and CLI visibility#340
Merged
danielmeppiel merged 7 commits intomainfrom Mar 17, 2026
Merged
feat: improve version pinning guidance and CLI visibility#340danielmeppiel merged 7 commits intomainfrom
danielmeppiel merged 7 commits intomainfrom
Conversation
- Show resolved ref in install output (e.g. 'owner/repo @ main (a1b2c3d4)') - Add one-time info hint when unversioned deps are installed - Update docs and templates to show pinned examples (#v1.0.0) - Tag microsoft/apm-sample-package with v1.0.0 Closes #336 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves version pinning guidance and visibility by updating docs/templates to use pinned dependency examples and enhancing CLI install output to display resolved refs plus a helpful tip when unpinned dependencies are present.
Changes:
- Update docs and the hello-world template to use
#v1.0.0pinned dependency examples. - Update CLI install output to include the resolved ref next to the package name.
- Add an informational tip at the end of install when any dependency lacks an explicit ref.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/hello-world/apm.yml | Pins the default sample dependency to #v1.0.0 in the template. |
| src/apm_cli/commands/install.py | Adds resolved-ref display in install output and prints a tip when deps are unpinned. |
| docs/src/content/docs/reference/manifest-schema.md | Updates schema examples/comments to show pinned refs and “latest” semantics. |
| docs/src/content/docs/guides/dependencies.md | Pins prominent dependency examples to #v1.0.0. |
| docs/src/content/docs/getting-started/quick-start.md | Pins install command and manifest examples to #v1.0.0. |
| README.md | Pins the main install and manifest examples to #v1.0.0. |
- Cached path now shows resolved commit SHA from lockfile (consistent with fresh installs) - Consistent spacing: all ref output uses ' @ ref' format - Replace hasattr() with idiomatic getattr(..., None) - Clarify branch refs are mutable in manifest-schema docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The @ separator is for aliases, not branch refs (per the ABNF grammar: shorthand = [...] ["#" ref] ["@" alias]). The old example 'repo@standards' was silently parsed as alias='standards' with no ref, not as a branch checkout. Replace with correct syntax: - repo#main → branch ref - repo#v1.0.0@standards → pinned tag with local alias Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The @ separator conflicted with conventions in npm (@scope), Go (@Version), and Cargo (@Version), causing real confusion — our own docs had a bug where @standards was intended as a branch ref. The feature had zero real-world usage (0 YAML fixtures, 0 production examples, 0 guide mentions). The dict format alias: field remains available for edge cases. - Remove @ alias parsing from DependencyReference.parse() - Remove @ from ABNF grammar and shorthand field table - Remove @alias from all doc examples (manifest-schema, dependencies, primitive-types) - Update tests: shorthand @alias now rejected, dict alias: still works - CHANGELOG entry under Removed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves dependency version pinning guidance by updating docs/templates to use pinned examples and enhancing apm install output to show the resolved ref/commit for better reproducibility visibility.
Changes:
- Update
apm installoutput to display the resolved git ref (and short SHA) and emit a one-time tip when any dependency is unpinned. - Remove shorthand
@aliasparsing from dependency strings (keeping dict-formalias:), and update tests accordingly. - Update docs/templates/README examples to use
#v1.0.0pinned dependencies and adjust reference docs for the updated grammar.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/commands/install.py |
Shows resolved ref in install output and adds a one-time pinning tip. |
src/apm_cli/models/dependency.py |
Removes @alias from string canonicalization/stringification and tightens dict alias validation. |
tests/unit/test_package_identity.py |
Updates parsing expectations to reflect removal of shorthand @alias. |
tests/unit/test_generic_git_urls.py |
Updates URL parsing tests to reject shorthand @alias. |
tests/unit/test_canonicalization.py |
Updates canonicalization/identity tests for new alias behavior. |
tests/test_apm_package_models.py |
Updates model parsing/string tests to reflect alias shorthand removal and dict alias support. |
tests/test_enhanced_discovery.py |
Updates expected dependency order now that shorthand alias isn’t used. |
docs/src/content/docs/getting-started/quick-start.md |
Pins the sample dependency in install and apm.yml examples. |
docs/src/content/docs/guides/dependencies.md |
Pins prominent examples and updates object-form description (but currently drops alias mention). |
docs/src/content/docs/reference/manifest-schema.md |
Removes @alias from shorthand grammar and pins examples. |
docs/src/content/docs/reference/primitive-types.md |
Removes alias-based example and updates resulting directory layout illustration. |
templates/hello-world/apm.yml |
Pins microsoft/apm-sample-package to #v1.0.0. |
README.md |
Pins sample dependency usage in the quick examples. |
CHANGELOG.md |
Adds Unreleased entries for install output/tip and notes shorthand alias removal. |
Comments suppressed due to low confidence (1)
docs/src/content/docs/guides/dependencies.md:141
- This line claims the object format is only for
git,path, andref, but the schema/code still accept an optionalaliasfield for object dependencies. Update the field list to includealias(and a short constraint) or removealiassupport from the implementation for consistency.
Fields: `git` (required), `path`, `ref` (all optional). The `git` value is any HTTPS or SSH clone URL.
- Re-add alias to object-format docs in dependencies.md (dict alias: field is still supported, only shorthand @alias was removed) - Add 11 unit tests for install output formatting: resolved ref display, cached-path ref formatting, unpinned deps detection - Update PR description to document @alias removal scope Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 17, 2026
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
Improves version pinning guidance across CLI and documentation per community feedback. Also removes the confusing
@aliasshorthand syntax.Closes #336
Changes
CLI — resolved ref visibility
✓ microsoft/apm-sample-package @ main (a1b2c3d4)instead of just✓ microsoft/apm-sample-packageTip: Pin versions with #tag or #sha for reproducible installsDocumentation — pinned examples
Updated all prominent examples to show
#v1.0.0pinned form:README.md— install command and apm.yml examplequick-start.md— install command and dependency listingdependencies.md— Quick Start and Real-World Example sectionsmanifest-schema.md— clarified comments, pinned appendix exampletemplates/hello-world/apm.yml— default templateapm-sample-package
microsoft/apm-sample-packagewithv1.0.0so docs reference a real versionRemoved:
@aliasshorthand syntaxThe
@separator in shorthand strings (e.g.owner/repo@my-alias) conflicted with conventions in npm (@scope), Go (@version), and Cargo (@version), causing real confusion — our own docs had a bug where@standardswas intended as a branch ref.The shorthand
@aliashad zero real-world usage (0 YAML fixtures, 0 production examples, 0 guide mentions). Changes:@alias parsing fromDependencyReference.parse()shorthand form["@" alias]from ABNF grammaralias:field is preserved — it's unambiguous and still documented in object-format sectionsDesign principles (per issue #336)
Tests
All 2440 unit tests passing.