refactor: drop dead BUILD_WORKSPACE_DIRECTORY fallback in needlinks - #723
Draft
a-zw wants to merge 1 commit into
Draft
refactor: drop dead BUILD_WORKSPACE_DIRECTORY fallback in needlinks#723a-zw wants to merge 1 commit into
a-zw wants to merge 1 commit into
Conversation
a-zw
requested review from
AlexanderLanin,
MaximilianSoerenPollak,
dcalavrezo-qorix and
nradakovic
as code owners
August 18, 2026 07:20
Contributor
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //src:license-checkStatus: Click to expand output |
There was a problem hiding this comment.
Pull request overview
This PR removes the BUILD_WORKSPACE_DIRECTORY-based path resolution fallback from needlinks JSON loaders and updates the related unit tests to reflect the simplified “load from provided path” behavior.
Changes:
- Removed
BUILD_WORKSPACE_DIRECTORYenvironment-variable fallback logic fromload_source_code_links_jsonandload_source_code_links_with_metadata_json. - Updated codelink tests to load caches via explicit absolute paths instead of relying on env-var-based resolution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/extensions/score_source_code_linker/needlinks.py |
Drops workspace-env fallback logic and documents expected Bazel path behavior. |
src/extensions/score_source_code_linker/tests/test_codelink.py |
Refactors path-resolution tests to use absolute paths directly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ): | ||
| """Test if relative path is resolved using BUILD_WORKSPACE_DIRECTORY""" | ||
| def test_load_resolves_absolute_path(tmp_path: Path): | ||
| """Absolute paths (as emitted by Bazel via ``$(location)``) load directly.""" |
Comment on lines
+180
to
+182
| # Bazel passes an absolute path (``$(location :sourcelinks_json)`` under | ||
| # ``bazel run``) or an execroot-relative path (sandbox, where CWD *is* the | ||
| # execroot); both are usable as ``Path(file)`` directly. |
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.
📌 Description
🚨 Impact Analysis
✅ Checklist