[FEATURE] Docs: producer guide for ref inheritance (git: parent / relative path) in monorepo bundles so #branch is not required
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 60/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python, yaml
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu bằng việc xác nhận hành vi của expand_parent_repo_decl trong src/apm_cli/deps/apm_resolver.py, sau đó đọc producer/repo-shapes.md (Monorepo-hybrid) và producer/source-vs-installed.md. Hoàn thành khi có một mục con Monorepo-hybrid với các ví dụ apm.yml trước và sau khi thay đổi, một ghi chú rằng #ref ở cấp cao nhất không lan truyền đến các phụ thuộc git: bắc cầu, một liên kết chéo từ source-vs-installed và một liên kết quay lại tài liệu tham chiếu schema. Hãy xác nhận phạm vi với maintainer trước, vì issue đang chờ phê duyệt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
I maintain a monorepo with a bundle and several plugins/skills (the "monorepo-hybrid" shape from [Repo shapes](https://microsoft.github.io/apm/producer/repo-shapes/)). The bundle's apm.yml referenced its sibling plugins with full git: coordinates:
dependencies:
apm:
- git: acme/ai-monorepo
path: plugins/plugin-a
- git: acme/ai-monorepo
path: skills/skill-b
When a change is on a feature branch and I ask a colleague to review it, they run:
apm install acme/ai-monorepo/bundles/my-bundle#feature-x
The bundle itself resolves from feature-x, but every plugin/skill listed in its apm.yml resolves from the repository's default branch, because the #ref given at the top level is not propagated to transitive git: dependencies that carry their own full coordinates.
The only workaround we found was to add ref: feature-x to every entry, then remove those lines again before merging. The manifest that was reviewed is therefore not the one that gets merged, which is poor practice and easy to get wrong.
After reading the resolver source, I found that APM already supports the required behaviour: expand_parent_repo_decl in src/apm_cli/deps/apm_resolver.py inherits the parent's resolved ref when a child uses git: parent, and same-repo relative path: entries are expanded to the parent's host/repo/ref as well.
Rewriting the bundle as:
dependencies:
apm:
- git: parent
path: plugins/plugin-a
- git: parent
path: skills/skill-b
means apm install .../my-bundle#feature-x pulls everything from feature-x, and apm install .../my-bundle after the merge pulls everything from main, with no edits to apm.yml in between.
The problem is discoverability. Searching the docs for git: parent finds it in only three places:
- Manifest schema -- 4.1.2 object form: The only example, with the single sentence "When
refis omitted the parent's resolved ref is inherited." - Manage dependencies: One sentence listing the accepted keys.
- The OpenAPM v0.1 specification.
Nothing under producer/ mentions it. In particular:
- Repo shapes -- Monorepo-hybrid shows
plugins/plugin-a/apm.ymlandplugins/plugin-b/apm.ymlside by side but never shows how one package in that repo should declare a dependency on a sibling. - Source vs installed tells authors to declare
git:+ref: v1.4.0and "update the declaredref:" when the source changes, which for same-repo siblings is exactly the pattern that causes the edit-before-merge churn described above. - No page explicitly states that a top-level
#refdoes not flow down to transitive dependencies that have their own fullgit:coordinates, so authors assume it does and are surprised whenmainis installed.
Proposed documentation change
Add a short, task-oriented section to the producer docs (I think producer/repo-shapes.md under Monorepo-hybrid is the natural home, with a cross-link from producer/source-vs-installed.md) covering:
-
Ref inheritance: The
#refpassed toapm install(orref:on a top-level dependency) applies to that dependency only. Transitive dependencies with fullgit:coordinates resolve their own ref (default branch when omitted). -
Same-repository dependencies: For same-repo siblings, use
git: parent+path:(or a relativepath:that stays inside the repo) so the child inherits the parent's resolved ref. Include the before/afterapm.ymlexamples above. -
Feature-branch workflow: Review a feature branch with
apm install owner/repo/bundles/x#branch, merge, then consumers runapm install owner/repo/bundles/x, with no change toapm.ymlbetween the two. Explain that the lockfile records the expanded concrete coordinates, so reproducibility is unaffected. -
Limitations and compatibility: This only works within one repository; a dependency in a different repository still needs an explicit
ref:to track a non-default branch. Document the versions in which each form became available (git: parentin 0.13.0, remote relativepath:in 0.20.0) for users on older releases.
Acceptance criteria: A reader following the monorepo-hybrid walkthrough can find how to make a bundle's sibling dependencies follow the install-time ref without reading the schema reference, and the manifest-schema entry links back to that guidance.
Alternatives considered
- Propagating the top-level
#refto all transitive dependencies: This would override deliberate pins in third-party packages.git: parentalready expresses the intended inheritance behaviour precisely. This is a documentation gap, not a behaviour gap. - Relying exclusively on the schema reference: The reference is complete, but it is a normative field table and not where a producer looks when setting up a monorepo or a review workflow.
Additional context
git: parentwas introduced in 0.13.0 (#1149); remote relativepath:expansion in 0.20.0 (#1732).- Related resolver issues in the same area that readers may hit: #3071 (transitive git+path monorepo regression), #3392 (stale parent manifest on
apm update). - Suggested labels:
type/docs,area/package-authoring,area/docs-site. - I am happy to write the docs PR once scope is approved.
- Ngôn ngữ chính
- Python
- Star
- 4.3k
- Fork
- 415
- Merge trung bình
- 3 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 120
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/apm
-
[BUG] HTTP lifecycle dispatch treats a NO_PROXY-only environment as corporate egress and skips the resolve-and-pinned sessionCó thể đã có người làm @bodapatisaikrishna đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/automation type/performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/cli type/automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/automation type/performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Global Codex instruction compilation ignores CODEX_HOMECó thể đã có người làm @xubenqiang đã nhận 5 ngày trước. Đang mởstatus/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/apm#3483 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/apm
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
comp/desktop P3 type/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#154285 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: qualify copied and custom kubectl debug policy notesCó thể đã có người làm @nym01 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubescape/cel-admission-library#166 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
SACGF/variantgrid#2804 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[integration]: NoMacSandboxĐang mởexternal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
langchain-ai/docs#7652 ·
Maintainer thường phản hồi trong vòng 1 ngày