generated from eclipse-score/module_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Eclipse infra #2
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit: - create a generic python aspect that can interface multiple runners; - create our first python runner that runs pylint; - create the aspect user interface at defs.bzl; - create a default pylint runner config at quality/BUILD; - adds `quality/private/python` to our poetry/tox setup; - adds pylint aspect config to .bazelrc; - create a target for pyproject.toml.
This commit: - adds a functional black aspect and runner; - offers the aspect though quality/defs.bzl; - as planned, make use of both python_tool_aspect.bzl and python_tool_common.py; - add a black config to .bazelrc.
We currently have our own python toolchain and support only bazel workspace, even though we have bzlmod activated. This commit removes our python toolchain in favor of rules_python toolchain. By doing this we increase toolchain support for multiple system, add support for both bzlmod and workspace, add support for multiple OSs, and easily update our toolchain version when a new one is released. Other minor changes were made: - change bazel labels to fit the new python toolchain; - add a tools availability to our README.md
This modification allows the caller to have access to the actual subprocess stdout and stderr. This is important because the caller may rely on that information in case of a non-zero return code. Example, isort returns 1 when it finds something, but we still want execute_subprocess to throw so we, on the application level, may be able to catch and evaluate it. Each application will do its own evaluation.
This commit: - adds a functional isort aspect and runner; - offers the aspect though quality/defs.bzl; - as planned, make use of both python_tool_aspect.bzl and python_tool_common.py; - add a isort config to .bazelrc.
The current approach is wrong because it relies on the string `startswith` method. This work on some cases but throws an exception on another ones, for example, "myapp" is not relative to "myapp_lib/path/..." but "myapp_lib/path/.." startswiuth "myapp". To avoid this we should rely on pathlib `is_relative_to`. This ensures that a path is actually relative to the other one instead of just comparing the string.
This commit: - adds a functional mypy aspect and runner; - offers the aspect though quality/defs.bzl; - as planned, make use of both python_tool_aspect.bzl and python_tool_common.py; - add a mypy config to .bazelrc.
This commit fixes every finding that doesn't come from clang-tidy or qac targets. Later PRs can fix those as well.
Multiple python runners may use the same entry_point, for example, ruff. With that in mind one might expect that, as the output file name is based on the tool and not on the runner, a conflict will happen when both runners are triggered. This commit prevents that by changing how we name the output file, which will from now on be based on the runner name. This commit also renamed runners, for example, pylint_runner to pylint, and also add an "_entry_point" to the py_console_script_binaries to avoid confusion. With this, for example, the pylint output file will still be called pylint_output_target_name.
This commit: - adds two functional ruff aspects and runners, one to check files and another to format files; - offers the aspects through quality/defs.bzl; - as planned, make use of both python_tool_aspect.bzl and python_tool_common.py; - add a ruff config to .bazelrc. Two runners were created because ruff has both a check and a formatter. Each one of those must be invoked individually and therefore we have two output files. Knowing that the aspect requires one output file, ruff runner was splitted into two. Also, as ruff python library doesn't provide a default entry point, a ruff_entry_point.py had to be created.
The default config should not be tied to the one that we have in our root. Also, as every python_tool_config was the same we only need to keep one of those. With that, label_flag can now references to the same python config.
Mypy is still using the old nomenclature style. This happened because while other python tools were being refactored mypy was being added to the repo.
To ensure that mypy can type check more code we need to add type libraries. These libraries ususally come from https://github.com/python/typeshed, and most are daily released. This also add those libraries to mypy entry point dependencies.
With this we set mypy as no incremental mode to both our repo and our default aspect config. The reason is that while it does speed up check, it also makes mypy bugprone and therefore we are disabling it. For our repo mypy config we are also fixing it to python 3.9. This means that, if we change our python version, mypy will still check against 3.9 style.
As we aim to not provide our toolchains anymore, we, unfortunatelly, will need to support python 3.8. This mostly means replacing some built-ins typehints with typing
There was a fundamental flaw in the python aspect design. It was not collecting information from the whole dependency tree. This commit fixes it by splitting the aspect into two aspects. The `python_collect_aspect` parse the whole dependency tree and stores it at the `PythonCollectInfo` provider. The already existing `python_tool_aspect` then inherits `PythonCollectInfo` and use that information to call our tool runners.
Naming files with the same name as libraries is a bad practice and can lead some tools to undefined behaviour.
Ideally we want two outputs, a json using quality-tools Fidings format and also a text output so we can output findings to the terminal. Diff outputs are additional. This commit add a Findings definition that follows what quality-tools findings-converter expects. Also, a Findings and a FindingsJSONEncoder helps us to interface a list of Finding with string and json methods. Also, updates `black_runner`, to output their results using the updated Finding string.
This commit standardizes isort_runner output, which is part of a bigger effort to standardize every python tool output.
This commit will add test coverage to the current black runner.
This commit standardizes mypy_runner output, which is part of a bigger effort to standardize every python tool output.
This commit standardizes ruff_check_runner output, and ruff_format_runner output which are part of a bigger effort to standardize every python tool output.
This commit will be removing the DeprecatedLinterFindingAsError function from the python_tool_common, since it should not be used by the tools anymore.
This commit standardizes pylint_runner output, which is part of a bigger effort to standardize every python tool output.
To better integrate our python aspect with our metrics tooling or even with a normal CI usage we should enable our aspect to automatically apply fixes. So in this commit black shall now be able to automatically fix a file depending on the user command.
To better integrate our python aspect with our metrics tooling or even with a normal CI usage we should enable our aspect to automatically apply fixes. So in this commit isort shall now be able to automatically fix a file depending on the user command.
This commit goal is to fix test_black_output_with_refactor test, fixing the assert case to assert against the correct variable.
To better integrate our python aspect with our metrics tooling or even with a normal CI usage we should enable our aspect to automatically apply fixes. So in this commit ruff check and ruff format shall now be able to automatically fix a file depending on the user command.
This commit adds a new test case for both test_python_tool_common and test_clang_tidy_runner, with the objective of reaching 100% coverage with bazel coverage.
See https://bazel.build/rules/lib/builtins/actions#run and https://bazel.build/reference/glossary#mnemonic. This helps to identify and analyze actions e.g. when running on a remote cluster.
While pytest-vcr is a nice library it is causing too much noise when using our custom py_pytest rule from an external repo due to incompatible libraries resolution. As it is not used and also not considered an essential lib, it makes sense to remove it from BRQ. Users can still add VCR back using their own dependencies.
This rule can be used to check python requirements files. As it is an executable rule, it can be used with `bazel run //target` command. From the start, it already supports: - Locked and not locked requirement files; - `index_url` option to change pip index; - `no_deps` option to allow not locked files to be checked.
Move the pycoverage implementation from the quality-tools here. Since pycoverage is a bazel integration it should rather be used by quality-tools but provided by bazel-rules-quality.
Add entry point, allowing pycoverage to be called as a py_binary.
Update the names of output- and report generators in log messages and tests according to the actual file name.
Update the way the pycoverage generators report their exit code, actually returning something from the main function and use sys.exit() to report that value to the system.
Update the report-generator implementation that identifies coverage data files.
Adjust identifiers to new repository.
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
32c3b0c to
49e35ab
Compare
antonkri
previously approved these changes
Aug 19, 2025
Setup the bazel workspace, build files and dependencies.
Add a separate bazel workspace intended for testing the bazel provided integrations.
Add scripts to run linters, formatters and tests.
Add user-facing documentation with the README.md and contributor-focused documentation with the CONTRIBUTING.md.
Replace the existing copyright header with the eclipse one.
Remove the starlark language server since the underlying rule is broken. When attempting to invoke the stetup_starpls rule bazel reports "declared output 'starpls_server_bin' was not created by genrule". Since the starpls language server is anyhow not used by the project it is fine to remove it.
Remove the score targets that build the sphinx documentation. Those targets only work for python 3.12. Since the project has support for python version from 3.8 up to 3.12 we also run tests for each of the versions. However, the score docs targets do not allow to restrict them to only being build for 3.12, hence they are disabled for now. On top of that those targets take way too many resources to build even though it doesn't actually have much content. With too many resources meaning over an hour and up to 40GB memory.
It contains all information regarding secutiry and vulnerabilities for this project.
Add the test github action that executes the run_all_tests shell script which in turn performs all tests and checks relevant for the project.
49e35ab to
5d9f19b
Compare
antonkri
approved these changes
Aug 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrate initial content from BMW repository and update bazel configuration to support quality checks.
Disable certain score targets that are currently not compatible with multiple python versions.