Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .github/workflows/internal_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: Internal Tooling Tests
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
jobs:
internal_tests:
uses: eclipse-score/cicd-workflows/.github/workflows/tests.yml@main
with:
bazel-target: "test //scripts/tooling:tooling_tests"
4 changes: 4 additions & 0 deletions .github/workflows/test_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +33 to +34
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need it now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because I added a fetch during report generation so if user does not have PAT, it still see a diff in moment raport is generated

jobs:
test_and_docs:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -111,6 +113,8 @@ jobs:
--github_user=${{ github.repository_owner }} \
--github_repo=${{ github.event.repository.name }}

CURRENT=$(realpath .)
Copy link
Contributor

Choose a reason for hiding this comment

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

was wondering why I could not find the generated html file but it's pull_request_target :D

bazel run //scripts/tooling -- misc html_report --output ${CURRENT}/_build/status_dashboard.html
tar -cf github-pages.tar _build
- name: Upload documentation artifact
uses: actions/upload-artifact@v4.4.0
Expand Down
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ use_format_targets()

exports_files([
"MODULE.bazel",
"pyproject.toml",
])
21 changes: 14 additions & 7 deletions MODULE.bazel.lock
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we track the MODULE.bazel.lock? should this be in .gitignore?

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,8 @@ local_path_override(module_name = "score_tooling", path = "../tooling")
### Rust

Use `scripts/generate_rust_analyzer_support.sh` to generate rust_analyzer settings that will let VS Code work.

## Internal tooling

Internal tooling scripts are currently under development to provide user single point of interaction with all
created goods. More detailed readme can be found in scripts: [Tooling README](scripts/tooling/README.md)
10 changes: 10 additions & 0 deletions bazel_common/score_python.MODULE.bazel
Copy link
Contributor

Choose a reason for hiding this comment

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

should we migrate all the py scripts to be executable via bazel?!

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
bazel_dep(name = "rules_python", version = "1.8.3")
bazel_dep(name = "aspect_rules_py", version = "1.5.2")

PYTHON_VERSION = "3.12"

Expand All @@ -28,3 +29,12 @@ pip.parse(
requirements_lock = "//feature_integration_tests/test_cases:requirements.txt.lock",
)
use_repo(pip, "pip_score_venv_test")

pip.parse(
envsubst = ["PIP_INDEX_URL"],
extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"],
hub_name = "ref_int_scripts_env",
python_version = PYTHON_VERSION,
requirements_lock = "//scripts/tooling:requirements.txt",
)
use_repo(pip, "ref_int_scripts_env")
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Newest Release Notes
newest_release_note = max(all_release_notes, key=lambda s: int(re.search(r'v(\d+)', s["id"]).group(1)))
results = [newest_release_note]

Current Integration Status Overview
-----------------------------------

`View dashboard (points always to main for now) <https://eclipse-score.github.io/reference_integration/main/status_report.html>`_

Explore the documentation
-------------------------
.. toctree::
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[tool.pytest]
pythonpath = [
".",
"scripts/tooling",
]
testpaths = ["scripts/tooling/tests"]

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down Expand Up @@ -75,7 +82,7 @@ select = [
# pyupgrade
"UP",
]
ignore = ["F401", "PTH123", "ARG002", "T201"]
ignore = ["F401", "PTH123", "ARG002", "T201", "TC003"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
Expand Down
73 changes: 73 additions & 0 deletions scripts/tooling/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@ref_int_scripts_env//:requirements.bzl", "all_requirements")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@score_tooling//python_basics:defs.bzl", "score_py_pytest")

# In order to update the requirements, change the `requirements.in` file and run:
# `bazel run //src:requirements.update`.
# This will update the `requirements.txt` file.
# To upgrade all dependencies to their latest versions, run:
# `bazel run //src:requirements.update -- --upgrade`.
compile_pip_requirements(
name = "requirements",
srcs = [
"requirements.in",
"@score_tooling//python_basics:requirements.txt",
],
requirements_txt = "requirements.txt",
tags = [
"manual",
],
)

# Library target
py_library(
name = "lib",
srcs = glob(["lib/**/*.py"]),
visibility = ["//visibility:public"],
)

# CLI library target (shared between binary and tests)
py_library(
name = "cli",
srcs = glob(["cli/**/*.py"]),
data = [
":cli/misc/assets/report_template.html",
],
deps = [":lib"] + all_requirements,
)

# CLI binary target
py_binary(
name = "tooling",
srcs = ["cli/main.py"],
main = "cli/main.py",
visibility = ["//visibility:public"],
deps = [":cli"],
)

# Tests target
score_py_pytest(
name = "tooling_tests",
srcs = glob(["tests/**/*.py"]),
data = [
":cli/misc/assets/report_template.html",
],
pytest_config = "//:pyproject.toml",
deps = [
":cli",
":lib",
] + all_requirements,
)
32 changes: 32 additions & 0 deletions scripts/tooling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Tooling scripts

## Running tooling CLI

```bash
bazel run //scripts/tooling -- --help
```

```bash
bazel run //scripts/tooling -- misc --help
```

## Creating HTML report

```bash
bazel run //scripts/tooling -- misc html_report
```

## Running tests

```bash
bazel test //scripts/tooling_tests
```

## Updating dependencies

Update a list of requirements in [requirements.in](requirements.in) file and then
regenerate lockfile [requirements.txt](requirements.txt) with:

```bash
bazel run //scripts/tooling:requirements.update
```
12 changes: 12 additions & 0 deletions scripts/tooling/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
31 changes: 31 additions & 0 deletions scripts/tooling/cli/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import argparse
import sys


def main() -> None:
parser = argparse.ArgumentParser(prog="tooling")
subparsers = parser.add_subparsers(dest="group", metavar="GROUP")
subparsers.required = True

from scripts.tooling.cli.misc import register as _register_misc

_register_misc(subparsers)

args = parser.parse_args()
sys.exit(args.func(args))


if __name__ == "__main__":
main()
23 changes: 23 additions & 0 deletions scripts/tooling/cli/misc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import argparse


def register(subparsers: argparse._SubParsersAction) -> None:
misc_parser = subparsers.add_parser("misc", help="Miscellaneous utilities")
misc_sub = misc_parser.add_subparsers(dest="command", metavar="COMMAND")
misc_sub.required = True

from scripts.tooling.cli.misc.html_report import register as _register_html_report

_register_html_report(misc_sub)
Loading