feat(root): prefer Aspect markers over Bazel markers when discovering project root#1122
Open
gregmagolan wants to merge 1 commit into
Open
feat(root): prefer Aspect markers over Bazel markers when discovering project root#1122gregmagolan wants to merge 1 commit into
gregmagolan wants to merge 1 commit into
Conversation
… project root Two-pass walk over ancestors of the current working directory: 1. Pick the deepest ancestor containing `MODULE.aspect` or `.aspect/version.axl`. 2. If none found, fall back to scanning for Bazel markers (`MODULE.bazel`, `MODULE.bazel.lock`, `REPO.bazel`, `WORKSPACE`, `WORKSPACE.bazel`). 3. If still none found, use the current working directory. This lets a nested Aspect workspace inside a Bazel monorepo (e.g. `/mono/proj/.aspect/version.axl` under `/mono/MODULE.bazel`) opt out of the surrounding Bazel root. Applies to both the launcher (which reads `<root>/.aspect/version.axl` to pick the CLI version) and the CLI (which loads `<root>/.aspect/*.axl` after spawn). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✨ Aspect Workflows Tasks📅 Sun May 24 07:52:36 UTC 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.
Two-pass walk over the ancestors of the current working directory when discovering the project root:
MODULE.aspector.aspect/version.axl.MODULE.bazel,MODULE.bazel.lock,REPO.bazel,WORKSPACE,WORKSPACE.bazel).Lets a nested Aspect workspace inside a Bazel monorepo opt out of the surrounding Bazel root:
Applies symmetrically to the launcher (aspect-launcher/src/config.rs::autoconf) — which reads
<root>/.aspect/version.axlto pick the CLI binary version — and the spawned CLI (aspect-cli/src/helpers.rs::find_repo_root) — which loads<root>/.aspect/*.axlafter spawn.Changes are visible to end-users: yes
Suggested release notes:
MODULE.aspector.aspect/version.axl) now resolves to itself as the project root instead of the outer Bazel root.Test plan
MODULE.aspectrecognition, Bazel-marker fallback, no-markers fallback tocwd./$TMP/MODULE.bazel+/$TMP/proj/.aspect/version.axl+/$TMP/proj/.aspect/smoke.axl(defining aaspect-root-smoketask), then ranaspect --helpfrom/$TMP/proj/src/. The task appears, confirming root resolved toproj/. Removingproj/.aspect/from the same tree drops the task from--help, confirming the Bazel-only fallback path still works.