feat: allow non root docs()#657
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //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 good, just some questions I have that we should address.
| data: Additional data files to include in the documentation build. | ||
| deps: Additional dependencies for the documentation build. | ||
| scan_code: List of code targets to scan for source code links. | ||
| test_sources: Optional list of repo-relative directory paths which will be used to filter testcases for documentation generation. |
There was a problem hiding this comment.
What happens to testcases that do not have file in the attributes?
As that is added by our plugin I think?
There was a problem hiding this comment.
Yeah those would show up in all docs as unlinked tests. Acceptable for now / for my test-use-case.
| def is_testcase_in_scope(test_file: str | None, allowed_dirs: list[str]) -> bool: | ||
| """Return True if the testcase should be turned into a need. | ||
|
|
||
| An empty `allowed_dirs` disables filtering (everything is in scope). Otherwise | ||
| a testcase is in scope only if it has a `file` attribute that is located under | ||
| one of the allowed (repo-relative) directories. | ||
| """ | ||
| if not allowed_dirs: | ||
| return True | ||
| if not test_file: | ||
| return False | ||
| file_path = Path(test_file) | ||
| return any(file_path.is_relative_to(allowed) for allowed in allowed_dirs) |
There was a problem hiding this comment.
If this is now new behaviour, and different than what currently is (have everything regardlesss of attributes & properties be a testcase due to the metrics) we should think if this is okay and if so it should be documented
There was a problem hiding this comment.
Default is unfiltered. The entire new docs()-parameter / behavior is undocumented.
Maybe we should call it experimental?
There was a problem hiding this comment.
Hmm I think we should do that, but in seperate PR's.
We need to document the docs macro somewhere in the future.
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Looks like a good step in the right direction.
Talked about in calls & explained. So all fine for me atm.
99e070e
into
eclipse-score:main
📌 Description
So far docs() was only callable from the root BUILD file. While that was intentional, this also prevents us from running docs() commands in order to test them properly.
Quite a lot of technical debt has accumulated due to this restriction we imposed. Notably:
🚨 Impact Analysis
✅ Checklist