Skip to content

refactor: drop dead BUILD_WORKSPACE_DIRECTORY fallback in needlinks - #723

Draft
a-zw wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:contain-bazelisms
Draft

refactor: drop dead BUILD_WORKSPACE_DIRECTORY fallback in needlinks#723
a-zw wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:contain-bazelisms

Conversation

@a-zw

@a-zw a-zw commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📌 Description

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

@github-actions

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: cc570948-7b76-4e1b-9857-a3a115c27cc6
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 5.775s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_DIRECTORY environment-variable fallback logic from load_source_code_links_json and load_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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants