-
Notifications
You must be signed in to change notification settings - Fork 20
Source links as Bazel target #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
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.
d781b67 to
529deb8
Compare
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall great stuff, thanks for the work.
Just couple comments / questions.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
| srcs = glob( | ||
| [ | ||
| "*.py", | ||
| "*.yaml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's super easy to forget some file here. Is a missing source code link safety relevant?
@RolandJentschETAS do you know?
| "@score_process//:needs_json", | ||
| ], | ||
| source_dir = "docs", | ||
| sourcelinks = [":my_source_links"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up to now docs() is defining internal targets like needs_json itself. All in one command. Can we do the same with sourcelinks_json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the solution we had wayyy back when we first introduced scl? :D Oh the cyclical nature of things.
|
|
||
|
|
||
| def load_source_code_links_json(file: Path) -> list[NeedLink]: | ||
| if not file.is_absolute(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this following symlinks?
Though not sure if it matters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it does because Bazel is using symlinks everywhere.
2e4350f to
4d7cab0
Compare
| Docs Dependencies | ||
| ========================== | ||
|
|
||
| When running ``bazel run :docs``, the documentation build system orchestrates multiple interconnected dependencies to produce HTML documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be fixed in future PR:
isn't it bazel run //:docs
otherwise you might not get the right target.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
📌 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