docs(release): document the object-form apm dependency for plugin pins #236

Open
opened 2026-11-27 21:19:39 +00:00 by Claude · 1 comment
Owner

Problem

apm 0.28.0 rejects the shorthand subdirectory dependency git.rkdr.net/Mortis/Holocron/plugins/git#git-v1.3.8 with:

Failed to parse apm.yml: Invalid APM dependency ... Invalid repository path component: git

The object form works:

- git: [email protected]:Mortis/Holocron.git
  path: plugins/git
  ref: git-v1.3.8

The likely cause is in apm_cli/models/dependency/reference.py (apm-cli 0.28.0), _resolve_shorthand_to_parsed_url, at line 1462:

if not re.match(allowed_pattern, part.rstrip(".git")):
    raise ValueError(f"Invalid repository path component: {part}")

str.rstrip(".git") strips any trailing run of the characters ., g, i and t. It does not remove a .git suffix. So "git".rstrip(".git") is "", and an empty string fails the pattern. A segment made only of those letters (git, tig, …) is rejected. mattpocock passes. This looks like an apm bug. The intended call is probably removesuffix(".git").

A second point needs checking. A few lines above (around line 1427), for a non-GitHub, non-ADO host the shorthand joins all path segments into user_repo. Even with the rstrip fixed, plugins/git might be read as part of the repo path and not as a subdirectory. This is not verified.

Proposal

  1. Document the object form in the repo as the supported way for consumers to pin a plugin, for example in ADR-0033's consumer notes or the README.
  2. Check whether the shorthand works with a plugin whose name avoids the stripped characters (e.g. mattpocock). That separates the rstrip bug from the multi-segment-path question.
  3. Report upstream to apm: the rstrip(".git") bug, and the multi-segment path if it is confirmed.

Acceptance criteria

  • Consumer-facing docs show the object form for pinning a plugin at <plugin>-v<version>.
  • We have checked whether a shorthand without stripped-character segments resolves as a subdirectory on this host, and recorded the result.
  • An upstream apm issue is filed and linked here, citing reference.py:1462 (0.28.0).

Notes

  • Follow-up from #223 (see its verification comment) / PR #234; ADR-0033 (docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md).
  • Related: the Renovate follow-up depends on which dependency form consumers use.

Assisted-by: Claude Code

## Problem apm 0.28.0 rejects the shorthand subdirectory dependency `git.rkdr.net/Mortis/Holocron/plugins/git#git-v1.3.8` with: ``` Failed to parse apm.yml: Invalid APM dependency ... Invalid repository path component: git ``` The object form works: ```yaml - git: [email protected]:Mortis/Holocron.git path: plugins/git ref: git-v1.3.8 ``` The likely cause is in `apm_cli/models/dependency/reference.py` (apm-cli 0.28.0), `_resolve_shorthand_to_parsed_url`, at line 1462: ```python if not re.match(allowed_pattern, part.rstrip(".git")): raise ValueError(f"Invalid repository path component: {part}") ``` `str.rstrip(".git")` strips any trailing run of the characters `.`, `g`, `i` and `t`. It does not remove a `.git` suffix. So `"git".rstrip(".git")` is `""`, and an empty string fails the pattern. A segment made only of those letters (`git`, `tig`, …) is rejected. `mattpocock` passes. This looks like an apm bug. The intended call is probably `removesuffix(".git")`. A second point needs checking. A few lines above (around line 1427), for a non-GitHub, non-ADO host the shorthand joins *all* path segments into `user_repo`. Even with the `rstrip` fixed, `plugins/git` might be read as part of the repo path and not as a subdirectory. This is not verified. ## Proposal 1. Document the object form in the repo as the supported way for consumers to pin a plugin, for example in ADR-0033's consumer notes or the README. 2. Check whether the shorthand works with a plugin whose name avoids the stripped characters (e.g. `mattpocock`). That separates the `rstrip` bug from the multi-segment-path question. 3. Report upstream to apm: the `rstrip(".git")` bug, and the multi-segment path if it is confirmed. ## Acceptance criteria - [ ] Consumer-facing docs show the object form for pinning a plugin at `<plugin>-v<version>`. - [ ] We have checked whether a shorthand without stripped-character segments resolves as a subdirectory on this host, and recorded the result. - [ ] An upstream apm issue is filed and linked here, citing `reference.py:1462` (0.28.0). ## Notes - Follow-up from #223 (see its verification comment) / PR #234; ADR-0033 (`docs/adr/0033-plugin-releases-are-tagged-plugin-v-version.md`). - Related: the Renovate follow-up depends on which dependency form consumers use. Assisted-by: Claude Code
Claude added the Kind/BugKind/Documentation
Priority
Medium
3
Status/Needs Triage
labels 2026-11-27 21:19:39 +00:00
Author
Owner

The Renovate follow-up mentioned in Notes is #235.

The Renovate follow-up mentioned in Notes is #235.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Holocron#236