Skip to content

Conversation

@a-zw
Copy link
Contributor

@a-zw a-zw commented Jan 21, 2026

📌 Description

Provides a Bazel command for source links to make source dependency explicit.
Use this target in docs() instead of implicitly scanning the git repo.
This allows to have source links even for other modules.

🚨 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

github-actions bot commented Jan 21, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 9072bd9d-4a4a-4c1c-8d52-d9f6cd2aafe5
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //src:license-check (63 packages loaded, 9 targets configured)

Analyzing: target //src:license-check (75 packages loaded, 9 targets configured)

Analyzing: target //src:license-check (129 packages loaded, 2248 targets configured)

Analyzing: target //src:license-check (135 packages loaded, 2651 targets configured)

Analyzing: target //src:license-check (140 packages loaded, 2700 targets configured)

INFO: Analyzed target //src:license-check (143 packages loaded, 4716 targets configured).
[9 / 13] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache
INFO: Found 1 target...
Target //src:license.check.license_check up-to-date:
  bazel-bin/src/license.check.license_check
  bazel-bin/src/license.check.license_check.jar
INFO: Elapsed time: 12.915s, Critical Path: 0.33s
INFO: 13 processes: 4 disk cache hit, 9 internal.
INFO: Build completed successfully, 13 total actions
INFO: Running command line: bazel-bin/src/license.check.license_check src/formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

import sys
from pathlib import Path

from src.extensions.score_source_code_linker.generate_source_code_links_json import (
Copy link
Contributor

Choose a reason for hiding this comment

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

Might need to either make this function public or make a public counterpart.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure yet. Eventually, we should be able to extract it from the Sphinx extension, because the extension shall only consume the json files.

Comment on lines +56 to +62
for file_path in args.files:
abs_file_path = file_path.resolve()
if abs_file_path.exists():
references = _extract_references_from_file(
abs_file_path.parent, Path(abs_file_path.name)
)
all_need_references.extend(references)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think due to '_extract_ref...' it will skip the 'bazel-' stuff and other things anyway?
Or was that before and we have to explicitly skip them here?
I would say it would make sense to skip them, as we don't want to go through all of those directories, binary files etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is that all source files are explicitly included via Bazel (see all the new filegroup targets). No need for filtering in Python.

Comment on lines +16 to +24
filegroup(
name = "all_sources",
srcs = glob(["*.py"]),
visibility = ["//visibility:public"],
)

py_library(
name = "score_draw_uml_funcs",
srcs = glob(
["*.py"],
),
srcs = [":all_sources"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't quiet understand this change. What's the meaning behind it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This "list of py files" is needed for py_library and also in the collection of all sources. See src/BUILD. This is why we need separate filegroup targets everywhere.

@@ -0,0 +1,72 @@
# *******************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

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

How would we best test this?

Copy link
Contributor

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Choose a reason for hiding this comment

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

Overall looks great from my side.
Script part is simple and concise.

Just had some questions regarding some of the things done as I don't understand them.

Currently, we are not using it yet, but this commit adds the Bazel
scaffolding to make the json data available.
}

scl_cache_json = get_cache_filename(
app.outdir, "score_source_code_linker_cache.json"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. There already seems to be a mechanism to store the source links in a JSON file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it already stores the links inside the _build file in 3 json files.
One for the tests, one for the source links and one for the combine one.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is mainly used as a 'cache' currently and not exported. But could be easily done so.
Though still need the extra script as at the moment it only runs after extension is activated / called upon.

@a-zw a-zw changed the title Provide //:sourcelinks_json Source links as Bazel target Jan 22, 2026
@a-zw a-zw force-pushed the sourcelinks_json branch from 5dd326c to e2bfbf7 Compare January 22, 2026 13:58
@a-zw a-zw force-pushed the sourcelinks_json branch from d781b67 to 529deb8 Compare January 22, 2026 16:12
@a-zw a-zw marked this pull request as ready for review January 22, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Draft

Development

Successfully merging this pull request may close these issues.

2 participants