Source links as Bazel target#358
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //src:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
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.
d781b67 to
529deb8
Compare
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Overall great stuff, thanks for the work.
Just couple comments / questions.
docs/how-to/source_to_doc_links.rst
Outdated
| In you ``BUILD`` files, you specify which source files to scan | ||
| with ``filegroup`` or ``glob`` or whatever Bazel mechanism you prefer. | ||
| Then, you use the ``sourcelinks_json`` rule to scan those files. | ||
| Finally, pass the scan results to the ``docs`` rule as ``sourcelinks`` attribute. |
There was a problem hiding this comment.
If I remember correctly it was requested that we use non direct language (like you etc.)
Though I don't care too much about it personally.
What's the opinion of the others?
Here is a suggestion how that could look like:
| In you ``BUILD`` files, you specify which source files to scan | |
| with ``filegroup`` or ``glob`` or whatever Bazel mechanism you prefer. | |
| Then, you use the ``sourcelinks_json`` rule to scan those files. | |
| Finally, pass the scan results to the ``docs`` rule as ``sourcelinks`` attribute. | |
| In the ``BUILD`` files, it can be specified which source files should be scanned. | |
| This can be achieved with ``filegroup``, ``glob`` or whatever Bazel mechanism is prefered. | |
| Then, the ``sourcelinks_json`` rule is used to scan those files. | |
| Finally, the scanned results need to be passed into ``docs`` rule as ``sourcelinks`` attribute. |
71b7a05 to
cbb7a3f
Compare
Currently, we are not using it yet, but this commit adds the Bazel scaffolding to make the json data available.
Fixes consumer checks
8eae746 to
502f550
Compare
|
|
||
|
|
||
| def load_source_code_links_json(file: Path) -> list[NeedLink]: | ||
| if not file.is_absolute(): |
There was a problem hiding this comment.
Is this following symlinks?
Though not sure if it matters.
There was a problem hiding this comment.
I assume it does because Bazel is using symlinks everywhere.
2e4350f to
4d7cab0
Compare
Co-authored-by: Maximilian Sören Pollak <maximilian.pollak@qorix.com> Signed-off-by: Andreas Zwinkau <95761648+a-zw@users.noreply.github.com>
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Thanks for this work. Truly appreciated.
|
I'd like to discuss the user facing API. As needs_json is hidden within docs() but this new target is not. |
We for sure have to do this. I think that we could introduce with the further functionality that is I think still missing here? |
88f4d7f to
d42577b
Compare
0cbd661 to
90d694a
Compare
📌 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
✅ Checklist