Skip to content

Feat: Add pre-commit, on-pr workflow & cr_checker#138

Open
MaximilianSoerenPollak wants to merge 9 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_add_new_cr_checker
Open

Feat: Add pre-commit, on-pr workflow & cr_checker#138
MaximilianSoerenPollak wants to merge 9 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_add_new_cr_checker

Conversation

@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor

This commit adds the cr_checker from the tools repo, It works as replacement of the old one from tooling.
I also added pre-commit to ensure at least some code quality

This commit adds the cr_checker from the `tools` repo.
It works as replacement of the old one from tooling.
I also added pre-commit to ensure at least some code quality
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: d8bc1882-69a8-4fe5-8b1b-52c72a35bd8f
Computing main repo mapping: 
WARNING: /home/runner/work/time/time/MODULE.bazel:13:7: The attribute 'compatibility_level' in module() is a no-op and will be removed in a future Bazel release. Please remove it from your MODULE.bazel file.
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (29 packages loaded, 10 targets configured)

Analyzing: target //:license-check (89 packages loaded, 10 targets configured)

Analyzing: target //:license-check (145 packages loaded, 3104 targets configured)

Analyzing: target //:license-check (154 packages loaded, 6582 targets configured)

Analyzing: target //:license-check (160 packages loaded, 9249 targets configured)

Analyzing: target //:license-check (166 packages loaded, 9302 targets configured)

Analyzing: target //:license-check (166 packages loaded, 9302 targets configured)

Analyzing: target //:license-check (166 packages loaded, 9302 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11190 targets configured)

Analyzing: target //:license-check (169 packages loaded, 11190 targets configured)

INFO: Analyzed target //:license-check (171 packages loaded, 11440 targets configured).
[1 / 1] no actions running
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 28.301s, Critical Path: 2.55s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./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
Copy Markdown

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

@AlexanderLanin

AlexanderLanin commented Jul 21, 2026

Copy link
Copy Markdown
Member

Does this run pre-commit in CI? I dont see it. Consider using central on-pr workflow 😄

Comment thread .venv_docs Outdated
@@ -0,0 +1 @@
/home/maximilianp/.cache/bazel/_bazel_maximilianp/e21129910acadb4e6a77c10ca6c1c7f2/execroot/_main/bazel-out/k8-fastbuild/bin/.ide_support No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need a file in the repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry this should not be in here, I forgot to add this to .gitignore.

Comment thread BUILD

copyright_checker(
name = "copyright",
srcs = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, we donb't need to specify now explicetly the repo structure or folders to check? the fuill repo will be taken by default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Everything that this command git ls-files --cached --other --exclude-standard will find is now in the cr_checker autoomatically :)

runs:
using: "docker"
image: "jorisroovers/gitlint:0.19.1"
image: "docker://jorisroovers/gitlint:0.19.1"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is needed otherwise it can not infer that the entrypoint should be from the docker and actionlint will give you a warning

Comment thread .github/actionlint.yaml
Comment on lines +17 to +20
paths:
.github/workflows/**/*.{yml,yaml}:
ignore:
- 'file "/bin/sh" does not exist.*entrypoint'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was the only way I could fix the warning.
It did not accept any other solution, this seems to be accepted workaround (adding the specific thing to the ignore list)

Comment thread tools/run_tool.sh
else
echo "Could not run '${tool_name}': not available on PATH in a container, and bazel was not found." >&2
exit 127
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file will allow you to run the binaries either from devcontainer or from your system :)

Comment thread pyproject.toml
[tool.basedpyright]
extends = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml"
verboseOutput = true
# This file is at the root level, as it applies to all Python code,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a direct copy of the content of score_tooling+/python_basics/pyproject.toml
You can adapt this as you need it.

The `on-pr` workflow from cicd workflows has all the things we need to
execute and has the right permissions.
common:
uses: eclipse-score/cicd-workflows/.github/workflows/on-pr.yml@88cb460c47cb49efeb25cd7b73c8945dd1c5bce2 # on-pr/v0.0.0
permissions:
contents: read

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This workflow will start all needed things in the repo, detecting what is inside the repo and then starting it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Things like pre-commit for example, that then start other things.

@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor Author

@lavrovvalera @AlexanderLanin Please have another look, I addressed the comments and added the missing workflow & removed the not needed file.

@MaximilianSoerenPollak MaximilianSoerenPollak changed the title Feat: Add pre-commit & cr_checker Feat: Add pre-commit, on-pr workflow & cr_checker Jul 22, 2026
@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor Author

I removed basedpyright from the pre-commit config. As it's quiet slow.
You can add it back if you think this repo should have this activated.

Comment thread BUILD
@@ -29,17 +30,6 @@ docs(

copyright_checker(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This repo now has bazel run //:copyright.fix and pre-commit run which do the same thing. Should we really have both?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think for this PR from my side, yes.
I would let the codeowners decide which part they rather would have and delete that one, the PR has both working and shows how to use / implement it.

@AlexanderLanin AlexanderLanin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@AlexanderLanin

Copy link
Copy Markdown
Member

@lavrovvalera according to registry you are the maintainer here, but not a committer. What is going on? More importantly: is someone taking care of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants