Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.6.0
21 changes: 21 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 👋 Code owners help maintain this repository and keep it aligned with our technical vision.
# You're responsible for reviewing changes, ensuring quality, and guiding contributors.
# You're also encouraged to help triage issues and keep discussions constructive and focused.
# Ownership can be shared, delegated, or updated as the project evolves.

# For more information about CODEOWNERS, see:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners


# This repository is maintained by the following individuals, who are responsible for reviewing and approving changes to the codebase:
# * @AlexanderLanin @MaximilianSoerenPollak

# However as this would create a potential bottleneck, we also want to cast a wider net and encourage the following individuals to also review and approve changes to the codebase.

# PLEASE LEAVE CRITICAL DECISIONS TO THE FIRST GROUP, BUT FEEL FREE TO APPROVE ANYTHING ELSE.

# Note: this does in no way mean that the first group is in any way more important!
# It's just the usual maintainer assignment that we perform per repository.
# It will be updated as the repository evolves, based on real life experience on who is actively maintaining (not contributing to!!) the repository.

* @AlexanderLanin @MaximilianSoerenPollak @dcalavrezo-qorix @pawelrutkaq @PiotrKorkus @lurtz @nradakovic @opajonk @antonkri @FScholPer @anmittag
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think for now this makes sense.

Might be good for future itterations to have certain people review changes in certain folders that pretend to them.
Like infra for us, or testing for piotr etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I dont want a setup like in score, where it is plain impossible to land a cross topic PR

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's true.

Though I mean here it would make almost more sense cause it strictly is 'just' documentation.
But ye i agree it makes sense to keep it like this for now.

173 changes: 173 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# *******************************************************************************
# 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: Publish Documentation

on:
workflow_run:
workflows: ["PR"]
types:
- completed

concurrency:
group: pages-deploy
cancel-in-progress: false

jobs:
docs-deploy:
name: Deploy documentation to GitHub Pages
if: github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
pages: write
id-token: write
contents: write
pull-requests: write
Comment thread
AlexanderLanin marked this conversation as resolved.
runs-on: ubuntu-latest
steps:
- name: Download build metadata
uses: actions/download-artifact@v8.0.1
with:
name: build-metadata
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Parse build metadata
id: metadata
run: |
EVENT_NAME=$(jq -r '.event_name' build-info.json)
PR_NUMBER=$(jq -r '.pr_number // empty' build-info.json)
REF_NAME=$(jq -r '.ref_name' build-info.json)

case "$EVENT_NAME" in
pull_request|push|merge_group|release) ;;
*)
echo "::error::Unexpected event_name: $EVENT_NAME"
exit 1
;;
esac

if [[ -n "$PR_NUMBER" && ! "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "::error::Invalid pr_number: $PR_NUMBER"
exit 1
fi

if [[ ! "$REF_NAME" =~ ^[a-zA-Z0-9._/-]+$ ]]; then
echo "::error::Invalid ref_name: $REF_NAME"
exit 1
fi

if [[ "$EVENT_NAME" == "merge_group" ]]; then
echo "should_deploy=false" >> "$GITHUB_OUTPUT"
else
echo "should_deploy=true" >> "$GITHUB_OUTPUT"
fi

echo "event_name=$EVENT_NAME" >> "$GITHUB_OUTPUT"
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "ref_name=$REF_NAME" >> "$GITHUB_OUTPUT"

- name: Determine target folder
if: steps.metadata.outputs.should_deploy == 'true'
id: target
run: |
EVENT_NAME="${{ steps.metadata.outputs.event_name }}"
if [[ "$EVENT_NAME" == "pull_request" ]]; then
echo "folder=pr-${{ steps.metadata.outputs.pr_number }}" >> "$GITHUB_OUTPUT"
else
echo "folder=${{ steps.metadata.outputs.ref_name }}" >> "$GITHUB_OUTPUT"
fi

- name: Checkout gh-pages
if: steps.metadata.outputs.should_deploy == 'true'
uses: actions/checkout@v6
with:
ref: gh-pages
path: gh-pages-content

- name: Clean up old documentation
if: steps.metadata.outputs.should_deploy == 'true'
run: |
rm -rf "gh-pages-content/${{ steps.target.outputs.folder }}"

- name: Download documentation artifact
uses: actions/download-artifact@v8.0.1
with:
name: github-pages
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
path: gh-pages-content/${{ steps.target.outputs.folder }}

- name: Ensure .nojekyll exists
if: steps.metadata.outputs.should_deploy == 'true'
run: touch gh-pages-content/.nojekyll

- name: Extend versions.json
if: steps.metadata.outputs.should_deploy == 'true'
run: |
TARGET="${{ steps.target.outputs.folder }}"

# if versions.json does not exist, create it with an empty array as content
if [ ! -f gh-pages-content/versions.json ]; then
echo '[]' > gh-pages-content/versions.json
fi

# Add new version entry to versions.json if it doesn't already exist
if jq -e --arg v "$TARGET" 'map(select(.version == $v)) | length > 0' gh-pages-content/versions.json > /dev/null; then
Comment thread
AlexanderLanin marked this conversation as resolved.
echo "Version '$TARGET' already exists in versions.json"
else
REPO_NAME=$(basename "${{ github.repository }}")
OWNER_NAME="${{ github.repository_owner }}"
PAGES_URL="https://${OWNER_NAME}.github.io/${REPO_NAME}"
jq --arg v "$TARGET" --arg u "${PAGES_URL}/${TARGET}/" \
'. + [{"version": $v, "url": $u}]' gh-pages-content/versions.json > gh-pages-content/tmp.json && mv gh-pages-content/tmp.json gh-pages-content/versions.json
Comment thread
AlexanderLanin marked this conversation as resolved.
fi

- name: Commit and push changes to gh-pages
if: steps.metadata.outputs.should_deploy == 'true'
run: |
cd gh-pages-content
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Comment thread
AlexanderLanin marked this conversation as resolved.
git add .
git commit -m "Update documentation for ${{ steps.target.outputs.folder }}" || echo "No changes to commit"
git push

- name: Create artifact from gh-pages
if: steps.metadata.outputs.should_deploy == 'true'
uses: actions/upload-pages-artifact@v3
with:
path: gh-pages-content

- name: Deploy artifact to GitHub Pages
if: steps.metadata.outputs.should_deploy == 'true'
id: deploy-pages
uses: actions/deploy-pages@v4

- name: Find existing PR comment
if: steps.metadata.outputs.should_deploy == 'true' && steps.metadata.outputs.event_name == 'pull_request' && steps.metadata.outputs.pr_number != ''
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ steps.metadata.outputs.pr_number }}
comment-author: 'github-actions[bot]'
body-includes: Documentation preview for this pull request

- name: Comment on PR with preview link
if: steps.metadata.outputs.should_deploy == 'true' && steps.metadata.outputs.event_name == 'pull_request' && steps.metadata.outputs.pr_number != '' && steps.fc.outputs.comment-id == ''
Comment thread
AlexanderLanin marked this conversation as resolved.
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ steps.metadata.outputs.pr_number }}
body: |
Documentation preview for this pull request is available at:
**${{ steps.target.outputs.folder }}**: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.target.outputs.folder }}/
68 changes: 68 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# *******************************************************************************
# 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: PR

permissions:
contents: read

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main # docs are built only on push to main branch, for feature branches there are PR builds
merge_group:
types: [checks_requested]
release:
types: [created]

jobs:
docs-build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: eclipse-score/more-disk-space@v1

- name: Check out
uses: actions/checkout@v6

- name: Build documentation
run: |
bazel run //:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should enable --lockfile_mode=error here too no, to be consitent with the rest of S-Core?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Docs should not fail because of lockfiles. Lockfiles should fail because of lockfiles 🔒

But since we dont have proper "buy-in" on https://github.com/eclipse-score/cicd-workflows/blob/main/.github/workflows/on-pr.yml I have excluded it for now.


- name: Upload documentation artifact
uses: actions/upload-artifact@v7.0.1
with:
Comment thread
AlexanderLanin marked this conversation as resolved.
name: github-pages
path: _build
retention-days: 1
if-no-files-found: error

- name: Create build metadata
run: |
cat > build-info.json <<'EOF'
{
"event_name": "${{ github.event_name }}",
"pr_number": "${{ github.event.pull_request.number }}",
"ref_name": "${{ github.ref_name }}",
"head_sha": "${{ github.sha }}"
}
EOF

- name: Upload build metadata
uses: actions/upload-artifact@v7.0.1
with:
name: build-metadata
path: build-info.json
retention-days: 1
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Bazel
bazel-*

# Docs
/.venv*
/_build*
docs/ubproject.toml

# AI
/.claude
/.codex
16 changes: 16 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# *******************************************************************************
# 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("@score_docs_as_code//:docs.bzl", "docs")

docs(source_dir = "docs")
38 changes: 38 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# *******************************************************************************
# 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
# *******************************************************************************

module(name = "score_infrastructure")

###############################################################################
#
# Python version
#
###############################################################################
bazel_dep(name = "rules_python", version = "1.8.3")

PYTHON_VERSION = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
python.toolchain(
configure_coverage_tool = True,
is_default = True,
python_version = PYTHON_VERSION,
)
use_repo(python)

###############################################################################
#
# Documentation
#
###############################################################################
bazel_dep(name = "score_docs_as_code", version = "4.1.0")
Comment thread
MaximilianSoerenPollak marked this conversation as resolved.
Loading