Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d903cbb
Add pre-commit config & upgrade devcontainer
MaximilianSoerenPollak Feb 23, 2026
ff7b3e5
Update README
MaximilianSoerenPollak Feb 23, 2026
bc2c518
Testing Devcontainer in actions
MaximilianSoerenPollak Feb 24, 2026
f5b2d0b
Adding user
MaximilianSoerenPollak Feb 24, 2026
be70a50
Switching user in different place
MaximilianSoerenPollak Feb 24, 2026
90239ff
Pre-commit debuging
MaximilianSoerenPollak Feb 24, 2026
41366a9
Trying different approach
MaximilianSoerenPollak Feb 24, 2026
ca02bf4
Missing quotation
MaximilianSoerenPollak Feb 24, 2026
18da09e
Debuging findings
MaximilianSoerenPollak Feb 24, 2026
7835161
Pre-commit isn't installed in CI
MaximilianSoerenPollak Feb 24, 2026
3a887fb
Missing cd?
MaximilianSoerenPollak Feb 24, 2026
8d82ef3
Git not working?
MaximilianSoerenPollak Feb 24, 2026
789fb50
Typo
MaximilianSoerenPollak Feb 24, 2026
a457665
Redo cd command
MaximilianSoerenPollak Feb 24, 2026
dd60930
Fix path
MaximilianSoerenPollak Feb 24, 2026
f8aefc6
Changing command
MaximilianSoerenPollak Feb 24, 2026
2e85f47
Ordering of commands
MaximilianSoerenPollak Feb 24, 2026
ddc06d6
Add missing command
MaximilianSoerenPollak Feb 24, 2026
5d19316
Permissions missing
MaximilianSoerenPollak Feb 24, 2026
0d0430c
Copy config from tooling
MaximilianSoerenPollak Feb 24, 2026
5334540
Testing other-action
MaximilianSoerenPollak Feb 24, 2026
f493aac
Formatting
MaximilianSoerenPollak Feb 24, 2026
1d8b12f
formatting
MaximilianSoerenPollak Feb 24, 2026
53bde54
Fix image tag
MaximilianSoerenPollak Feb 24, 2026
af5e576
Change command to run
MaximilianSoerenPollak Feb 24, 2026
df3f5e0
Change command
MaximilianSoerenPollak Feb 24, 2026
f86077a
Updating further actions to devcontainer
MaximilianSoerenPollak Feb 24, 2026
b7588c5
Formatting
MaximilianSoerenPollak Feb 24, 2026
5a0d62c
Adding checkout to action
MaximilianSoerenPollak Feb 24, 2026
d3275c8
Change pip install to uv
MaximilianSoerenPollak Feb 24, 2026
406037e
Adding runfiles via pypi
MaximilianSoerenPollak Feb 24, 2026
019119b
Adapting consumer tests
MaximilianSoerenPollak Feb 24, 2026
2bd0529
Testing enviroment
MaximilianSoerenPollak Feb 24, 2026
7df25af
Troubleshooting
MaximilianSoerenPollak Feb 24, 2026
206dce7
Formatting
MaximilianSoerenPollak Feb 24, 2026
50256db
Adapt workflow & delete format.yml
MaximilianSoerenPollak Feb 24, 2026
19e5af6
Add buildifier to pre-commit configuration
MaximilianSoerenPollak Feb 25, 2026
c9e9822
Formatting & Linting
MaximilianSoerenPollak Feb 25, 2026
eea022c
Delete unused script
MaximilianSoerenPollak Feb 25, 2026
3444b27
Fix pre-commit config
MaximilianSoerenPollak Feb 25, 2026
ced2430
Clean up ruff errors
MaximilianSoerenPollak Feb 25, 2026
92f9c8b
Formatting & Linting
MaximilianSoerenPollak Feb 25, 2026
b64929d
Fix paths in requirements.txt
MaximilianSoerenPollak Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "eclipse-s-core",
"image": "ghcr.io/eclipse-score/devcontainer:1.0.0",
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0",
Copy link

Choose a reason for hiding this comment

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

Can you add this and tell me if you stell need PIPX_BIN_DIR to execute pre-commit?

Suggested change
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0",
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0",
"postCreateCommand": "echo \"export PATH=$PIPX_BIN_DIR:$PATH\" | sudo tee /etc/bash_completion.d/add_pipx_to_path",

Copy link

Choose a reason for hiding this comment

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

This only works in conjunction with devcontainer/cli. If this works I can add this to the image.

Copy link

Choose a reason for hiding this comment

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

Now I found a solution, which works in /etc/profile.d/. This took me way too long time

Suggested change
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0",
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0",
"postCreateCommand": "echo \"export PATH=$PIPX_BIN_DIR:$PATH\" | sudo tee /etc/profile.d/add_pipx_to_path.sh",

Copy link

Choose a reason for hiding this comment

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

Will be taken care of with eclipse-score/devcontainer#98

"updateContentCommand": "bazel run //:ide_support"
}
15 changes: 7 additions & 8 deletions .github/actions/link-check/link_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def generate_markdown_table(broken_links: list[BrokenLink]) -> str:
table += "|----------|-------------|-----------|\n"

for link in broken_links:
table += (
f"| {link.location} | {link.line_nr} | {link.reasoning} |\n"
)
table += f"| {link.location} | {link.line_nr} | {link.reasoning} |\n"

return table

Expand All @@ -62,7 +60,7 @@ def generate_issue_body(broken_links: list[BrokenLink]) -> str:
markdown_table = generate_markdown_table(broken_links)
return f"""
# Broken Links Report.
**Last updated: {datetime.now().strftime('%d-%m-%Y %H:%M')}**
**Last updated: {datetime.now().strftime("%d-%m-%Y %H:%M")}**
The following broken links were detected in the documentation:
{markdown_table}
Expand All @@ -73,7 +71,8 @@ def generate_issue_body(broken_links: list[BrokenLink]) -> str:
---
This issue will be auto updated regularly if link issues are found.
You may close it if you wish, though a new one will be created if link issues are still present.
You may close it if you wish.
Though a new one will be created if link issues are still present.
"""

Expand All @@ -85,11 +84,11 @@ def strip_ansi_codes(text: str) -> str:


if __name__ == "__main__":
argparse = argparse.ArgumentParser(
arg = argparse.ArgumentParser(
description="Parse broken links from Sphinx log and generate issue body."
)
argparse.add_argument("logfile", type=str, help="Path to the Sphinx log file.")
args = argparse.parse_args()
arg.add_argument("logfile", type=str, help="Path to the Sphinx log file.")
args = arg.parse_args()
with open(args.logfile) as f:
log_content_raw = f.read()
log_content = strip_ansi_codes(log_content_raw)
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/consumer_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,29 @@ jobs:
- name: Checkout PR
uses: actions/checkout@v4.2.2

- name: Prepare Python
run: |
bazel run //:ide_support

- name: Prepare report directory
run: |
mkdir -p reports
- name: Build and run dev container task
uses: devcontainers/ci@v0.3
with:
cacheFrom: ghcr.io/eclipse-score/devcontainer@v1.2.0
push: never
# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
runCmd: |
set -euxo pipefail
uv venv && uv pip install -r src/requirements.txt

# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
- name: Run Consumer tests
mkdir -p reports

run: |
set -o pipefail
.venv_docs/bin/python -m pytest -s -v src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" | tee "reports/${{ matrix.consumer }}.log"
env:
FORCE_COLOR: "1"
TERM: xterm-256color
PYTHONUNBUFFERED: "1"
CONSUMER: ${{ matrix.consumer }}
export FORCE_COLOR="1"
export TERM="xterm-256color"
export PYTHONUNBUFFERED="1"
export CONSUMER="${{ matrix.consumer }}"
export PYTHONPATH=.
uv run pytest -s -v src/tests/ \
Copy link

Choose a reason for hiding this comment

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

pytest is preinstalled in the devcontainer and should be accessible without uv. Maybe uv just runs what is already there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes pytest is there, but the packages this test needs arent'.

So i installe eveyrthing via uv then running it

--repo="$CONSUMER" \
--junitxml="reports/${{ matrix.consumer }}.xml" \
| tee "reports/${{ matrix.consumer }}.log"

- name: Upload consumer test report
if: ${{ always() }}
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/format.yml

This file was deleted.

16 changes: 5 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4.2.2

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.15.0
- name: Build and run dev container task
uses: devcontainers/ci@v0.3
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit checks
run: pre-commit run -a
cacheFrom: ghcr.io/eclipse-score/devcontainer
push: never
runCmd: ${PIPX_BIN_DIR}/pre-commit run -a
Copy link

Choose a reason for hiding this comment

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

With the current main tag PIPX_BIN_DIR is now part of $PATH

Suggested change
runCmd: ${PIPX_BIN_DIR}/pre-commit run -a
runCmd: pre-commit run -a

34 changes: 9 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Cache Bazel and pip
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
~/.cache/pip
key: ${{ runner.os }}-test-${{ hashFiles('**/*.bazel', '**/BUILD', '**/*.bzl', 'src/requirements.txt', 'src/**/*.py') }}

- name: Setup Bazel with cache
uses: bazel-contrib/setup-bazel@0.15.0
Comment on lines -33 to -34
Copy link

Choose a reason for hiding this comment

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

We should keep an eye on build times and if we can use a cache with the devcontainer

- name: Build and run dev container task
uses: devcontainers/ci@v0.3
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true
- name: Run test targets
run: |
bazel run //:ide_support
bazel test //src/...
- name: Prepare bundled consumer report
if: always()
# Creating tests-report directory
# Follow Symlinks via '-L' to copy correctly
# Copy everything inside the 'test-reports' folder
run: |
mkdir -p tests-report
rsync -amL --include='*/' --include='test.xml' --include='test.log' --exclude='*' bazel-testlogs/ tests-report/
cacheFrom: ghcr.io/eclipse-score/devcontainer@v1.2.0
push: never
runCmd: |
bazel run //:ide_support
bazel test //src/...
mkdir -p tests-report
rsync -amL --include='*/' --include='test.xml' --include='test.log' --exclude='*' bazel-testlogs/ tests-report/
- name: Upload bundled consumer report
if: always()
Expand Down
52 changes: 48 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,52 @@ repos:
# use LOCAL hooks for python tooling so versions come from the virtualenv
- repo: local
hooks:
- id: Linter Scripts
name: Run linter script
entry: ./scripts/run-linters.sh
language: unsupported_script
- id: ruff
name: ruff
entry: ruff check --fix
language: system
types_or: [python, pyi]

- id: ruff-format
name: ruff format
entry: ruff format
language: system
types_or: [python, pyi]

# Can not get this to run ;/
- id: basedpyright
name: basedpyright
entry: basedpyright
language: system
types_or: [python, pyi]
pass_filenames: false

- id: actionlint
name: actionlint (container)
entry: actionlint
language: system
files: ^\.github/workflows/.*\.ya?ml$

- id: yamlfmt
name: yamlfmt (container)
entry: yamlfmt
language: system
types: [yaml]

- id: shellcheck
name: shellcheck (container)
entry: shellcheck
language: system
types: [shell]

- id: buildifier fix
name: bazel linting fix (container)
entry: buildifier --lint=fix
language: system
files: '(^|/)(BUILD(\.bazel)?|MODULE\.bazel|.*\.bzl)$'

- id: buildifier format
name: bazel formatting (container)
entry: buildifier
language: system
files: '(^|/)(BUILD(\.bazel)?|MODULE\.bazel|.*\.bzl)$'
44 changes: 39 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,58 @@
# This file is at the root level, as it applies to all Python code,
# not only to docs or to tools.
[tool.pyright]
extends = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml"
typeCheckingMode = "standard"
pythonVersion = "3.12" # Keep in sync with MODULE.bazel

# Warn if function parameters lack type annotations
reportMissingParameterType = "warning"

# Warn if generic types (e.g. List) are missing type args
reportMissingTypeArgument = "warning"

# Warn when using members marked as private (e.g. _log)
reportPrivateUsage = "warning"

# Warn when variable type can't be inferred or is 'Any'
reportUnknownVariableType = "warning"

# Warn about declared but unused variables
reportUnusedVariable = "warning"

exclude = [
"**/__pycache__",
"**/.*",
"**/bazel-*",
".venv*/**",
]

venvPath = "."
venv = ".venv_docs"

[tool.ruff]
extend = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml"

#line-length=59
target-version = "py312" # Keep in sync with MODULE.bazel
extend-exclude = [
"__pycache__",
".*",
"bazel-*",
"**/__pycache__",
"/.*",
"bazel-*",
".venv*/**",
]

# Selected rules for clean code, readability, and bug prevention
lint.select = [
"E", # pycodestyle (PEP8)
"F", # pyflakes (undefined vars, unused imports)
"I", # isort (import sorting)
"B", # flake8-bugbear (likely bugs)
"C90", # mccabe (complexity checks)
"UP", # pyupgrade (modern Python 3.12+ features)
"SIM", # flake8-simplify (simplifies code patterns)
"RET" # flake8-return (consistent return statements)
]

lint.ignore = [
# Rules we want to ignore go in here.
# Always provide a comment explaining why.
]
41 changes: 0 additions & 41 deletions scripts/run-linters.sh

This file was deleted.

1 change: 1 addition & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test")
load("@aspect_rules_py//py:defs.bzl", "py_library")
load("@rules_java//java:java_binary.bzl", "java_binary")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@score_tooling//:defs.bzl", "dash_license_checker")

Expand Down
4 changes: 1 addition & 3 deletions src/extensions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_library")
load("@docs_as_code_hub_env//:requirements.bzl", "all_requirements")
load("@score_tooling//:defs.bzl", "score_py_pytest", "score_virtualenv")
load("@aspect_rules_py//py:defs.bzl", "py_library")

py_library(
name = "score_plantuml",
Expand Down
2 changes: 1 addition & 1 deletion src/helper_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
from pathlib import Path

from python.runfiles import Runfiles
from runfiles import Runfiles
from sphinx_needs.logging import get_logger

LOGGER = get_logger(__name__)
Expand Down
Loading
Loading