Skip to content

feat(mock): scope build environments to configuration directories - #19368

Closed
Tobias Brick (tobiasb-ms) wants to merge 1 commit into
microsoft:4.0from
tobiasb-ms:tobiasb-ms/config-directory-mock-roots
Closed

Tobias Brick (tobiasb-ms) wants to merge 1 commit into
microsoft:4.0from
tobiasb-ms:tobiasb-ms/config-directory-mock-roots

Conversation

@tobiasb-ms

@tobiasb-ms Tobias Brick (tobiasb-ms) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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
@tobiasb-ms
Tobias Brick (tobiasb-ms) force-pushed the tobiasb-ms/config-directory-mock-roots branch from a9f4bca to 33f1a8d Compare October 16, 2026 03:18
Copilot AI balanced review requested due to automatic review settings October 16, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Root/cache identity changes and destructive cleanup guidance warrant human review despite the reported validation and absence of concrete findings.

0 open findings

🧠 Review effort: Balanced

@tobiasb-ms
Tobias Brick (tobiasb-ms) marked this pull request as ready for review October 16, 2026 03:24
@tobiasb-ms
Tobias Brick (tobiasb-ms) requested a review from a team as a code owner October 16, 2026 03:24
@tobiasb-ms

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tobiasb-ms

Copy link
Copy Markdown
Contributor Author

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 mock-core-configs enable multiple simultaneous package builds? That's a real bottleneck people currently face, so I want to remove that bottleneck no matter how we do it.

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.

@ddstreetmicrosoft

Copy link
Copy Markdown
Contributor

Would the standard mock config from mock-core-configs enable multiple simultaneous package builds

I don't think the mock config has anything to do with it...i think anyone using mock directly can simply use the --uniqueext= mock parameter. azldev should also be able to use that parameter.

@ddstreetmicrosoft

Copy link
Copy Markdown
Contributor

don't see that happening any time soon

I'd like to remove it asap...by GA, or very soon after.

@ddstreetmicrosoft

Copy link
Copy Markdown
Contributor

Tobias Brick (@tobiasb-ms) PTAL at this azldev update to use the mock --uniqueext: microsoft/azure-linux-dev-tools#400

@tobiasb-ms
Tobias Brick (tobiasb-ms) deleted the tobiasb-ms/config-directory-mock-roots branch October 31, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants