Repository navigation
feat(mock): scope build environments to configuration directories - #19368
Tobias Brick (tobiasb-ms) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Distro-wide environment identity changes and destructive cleanup guidance warrant human review, particularly for untested custom placements and shared caches.
0 open findings
What changed in this PR
Scopes mock environments to canonical configuration directories, preventing independent worktrees from sharing build resources unintentionally.
Changes:
- Adds shared root naming with readable path labels, a digest, and directory-mismatch checks.
- Applies the naming scheme across all three build stages.
- Documents approval-based cleanup and diagnostic preservation before worktree removal.
| File | Description |
|---|---|
| distro/mock/azl4/stage2/azurelinux-4.0.tpl | Uses shared naming for stage2. |
| distro/mock/azl4/stage2-prod/azurelinux-4.0.tpl | Uses shared naming for production stage2. |
| distro/mock/azl4/stage1/azurelinux-4.0.tpl | Uses shared naming for stage1. |
| distro/mock/azl4/config-directory-root.tpl | Defines directory-scoped root identities and validation. |
| AGENTS.md | Adds worktree cleanup discovery and requirements. |
| .agents/skills/azldev-worktree-cleanup/SKILL.md | Documents inventory, preservation, targeted cleanup, and recovery limits. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Generate stable root names from a sanitized canonical configuration path and a short digest so separate worktrees can build concurrently. Reject mismatched configuration/include directories and apply shared naming logic after prod/preview selection in all four architecture configs, preserving upstream channel settings and repositories. Add agent guidance for inventorying and retiring worktree-associated roots and caches while preserving shared resources and diagnostics. Suppress cache allocation only during discovery queries and require approval and exclusive use before targeted cleanup. Treat orphan recovery as unvalidated rather than automatic cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 796d7df5-e235-425f-8a0c-74dbd8b9beab
a9f4bca to
33f1a8d
Compare
|
/azp run |
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. |
Dan Streetman (ddstreetmicrosoft)
left a comment
There was a problem hiding this comment.
I don't think this is a good approach, I'd much rather see us completely eliminate all mock configuration from our repo - it should not be there because we should be using the standard mock config that we get upstream into mock-core-configs. I do not think adding this complexity is a good idea.
Would the standard mock config from Also, while we may decide to eliminate custom mock config sometime in the future, I don't see that happening any time soon. We shouldn't let a theoretical future design goal prevent changes that help alleviate real developer pain. |
I don't think the mock config has anything to do with it...i think anyone using mock directly can simply use the |
I'd like to remove it asap...by GA, or very soon after. |
|
Tobias Brick (@tobiasb-ms) PTAL at this |
Scope mock roots and caches to the selected configuration directory so separate worktrees can build concurrently. A shared helper appends a readable path label and short digest after prod/preview selection, preserving channel and architecture separation.
Adds agent guidance for preserving diagnostics and safely cleaning up associated roots and caches before removing a worktree. No automatic garbage collection.
Validated with overlapping OpenSSL builds from two worktrees and targeted cleanup with artifact preservation.