Repository navigation
fix(config): resolve PROJECT_ROOT to the checkout when no .env exists (#13572, #13149) - #13646
Merged
Merged
Conversation
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Applied Black, isort, and autoflake to match code-quality checks. Triggered by workflow auto-fix-formatting.yml.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 5, 2026
Merged
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.
Thinking Path
This is the last remaining failure on the base branch. Run
31014724462on30ed84612has 5 shards green and exactly one red, withLEAK lines: 0,FIXED lines: 0and a single failing test:_find_project_root()walks up for a.envand, finding none, returns the packaged install location..envis git-ignored, so every fresh clone, container build and CI job takes that branch and setsPROJECT_ROOTto a directory that does not exist there. That also points the ~20env_file=str(PROJECT_ROOT / ".env")declarations in this module at production configuration from a source tree.This is why it could not land before. Nineteen JSON-Schema defaults derived from
PROJECT_ROOT, so correcting the resolver made the published contract carry the runner's checkout path and turnedverify-generated-typesred — it was implemented, verified, and then reverted. #13572 converted those to factories, so the contract no longer moves whenPROJECT_ROOTdoes. That is what unblocks this.What Changed
A checkout-root step between the
.envwalk and the install fallback. The.envwalk is untouched and still first: a configured deployment stays authoritative.Detection requires both
.gitandautobot_sharedat the same directory. Either alone is insufficient —.gitalone would match an unrelated repository this package had been vendored into, andautobot_sharedalone matches ordinary parent directories in some layouts..gitis tested withexists(), notis_dir(). In agit worktreeit is a file pointing at the real git directory, and this repository's entire workflow runs from worktrees, so anis_dir()check would have excluded every one of them.Verification
The gate that forced the previous revert now passes with the resolver corrected — this is the evidence that the two changes compose:
Marker logic checked against all four shapes rather than the happy path only:
autobot_shared/as a whole has a pre-existing collection error inauth/test_slm_permission_parity.py(TypeError: metaclass…). Confirmed identical onDev_new_guiwith none of these changes, so it is excluded from the figure above rather than attributed here.Refs #13572, #13149
Model Used
Claude Opus 5