diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..883f884
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,5 @@
+# The releng team is by default the owner of everything.
+* @{{ org }}/eclipsefdn-releng
+
+# Otterdog related configurations are also owned by the security team.
+/otterdog/** @{{ org }}/eclipsefdn-security @{{ org }}/eclipsefdn-releng
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..9be4262
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,13 @@
+version: 2
+updates:
+- package-ecosystem: github-actions
+ directory: "/"
+ # We scan and create dependabot PRs against the develop branch only.
+ # Such a branch only exists for the template master at EclipseFdn/.eclipsefdn-template
+ # dependabot shall only update the template master, and changes will be synchronized to
+ # all repos by otterdog using the sync-template operation to avoid having many similar
+ # dependabot PRs for each individual .eclipsefdn repo which we would like to avoid at all costs.
+ target-branch: "develop"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
diff --git a/.github/workflows/build-page.yml b/.github/workflows/build-page.yml
new file mode 100644
index 0000000..b42d127
--- /dev/null
+++ b/.github/workflows/build-page.yml
@@ -0,0 +1,125 @@
+name: Build GH Page
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - 'main'
+ paths:
+ - 'otterdog/*.jsonnet'
+ - 'otterdog/*.json'
+ - 'docs/**'
+ - 'mkdocs.yml'
+ - '.github/workflows/build-page.yml'
+
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+jobs:
+ generate-markdown:
+ # do not run the workflow in the template repo itself
+ if: ${{ !contains (github.repository, '/.eclipsefdn-template') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout eclipse-csi/otterdog
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: eclipse-csi/otterdog
+ path: otterdog
+
+ - name: Checkout EclipseFdn/otterdog-configs
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: EclipseFdn/otterdog-configs
+ path: otterdog-configs
+
+ # checkout the HEAD ref
+ - name: Checkout HEAD
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ path: ${{ github.repository_owner }}
+
+ - name: Install jsonnet-bundler
+ run: |
+ go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1
+ echo $(go env GOPATH)/bin >> $GITHUB_PATH
+
+ - name: Install poetry
+ run: pipx install poetry
+
+ - name: Setup Python
+ uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
+ with:
+ python-version: '3.10'
+ cache: 'poetry'
+
+ - name: Install dependencies with poetry
+ run: |
+ poetry install --only=main
+ working-directory: otterdog
+
+ - name: Copy configuration from HEAD ref
+ run: |
+ mkdir -p orgs/${{ github.repository_owner }}
+ cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }}
+ working-directory: otterdog-configs
+
+ - name: Generate current configuration as markdown
+ run: ../otterdog/otterdog.sh show ${{ github.repository_owner }} -c otterdog.json --markdown --output-dir generated-site
+ working-directory: otterdog-configs
+
+ - name: Generate default configuration as markdown
+ run: ../otterdog/otterdog.sh show-default ${{ github.repository_owner }} -c otterdog.json --markdown > default.txt
+ working-directory: otterdog-configs
+
+ - name: Upload generated site content
+ uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+ with:
+ name: generated-site
+ path: |
+ otterdog-configs/default.txt
+ otterdog-configs/orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet
+ otterdog-configs/generated-site/
+
+ build-page:
+ runs-on: ubuntu-latest
+ needs: generate-markdown
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ - name: Download generated site content
+ uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
+ with:
+ name: generated-site
+ - shell: bash
+ run: |
+ cat default.txt >> ./docs/playground.md
+ cp generated-site/*.md ./docs/
+ cp orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet ./docs/jsonnet/
+ - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
+ with:
+ python-version: 3.x
+ cache: 'pip'
+ - run: pip install -r requirements.txt
+ - name: Build with Mkdocs
+ run: mkdocs build
+ - name: Setup Pages
+ uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
+
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: build-page
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@87c3283f01cd6fe19a0ab93a23b2f6fcba5a8e42 # v4.0.3
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
new file mode 100644
index 0000000..40c5a30
--- /dev/null
+++ b/.github/workflows/validate.yml
@@ -0,0 +1,118 @@
+name: Validate Otterdog Configuration
+
+on:
+ workflow_dispatch:
+ pull_request_target:
+ branches: [ main ]
+
+permissions:
+ contents: read
+ pull-requests: write
+
+jobs:
+ validate:
+ # do not run the workflow in the template repo itself
+ if: ${{ !contains (github.repository, '/.eclipsefdn-template') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout eclipse-csi/otterdog
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: eclipse-csi/otterdog
+ path: otterdog
+
+ - name: Checkout EclipseFdn/otterdog-configs
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: EclipseFdn/otterdog-configs
+ path: otterdog-configs
+
+ # checkout the head ref of the PR
+ # NOTE: in general it is bad practice to check out the pull request HEAD for PRs originating from forked repos,
+ # however, this validation workflow produces a diff between the changes in the PR with the base ref, thus
+ # doing this is acceptable, see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
+ - name: Checkout HEAD ref of the PR
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ path: ${{ github.repository_owner }}
+
+ # checkout the base ref of the PR
+ - name: Checkout BASE ref of the PR (target branch)
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ ref: ${{ github.base_ref }}
+ path: ${{ github.repository_owner }}-base
+
+ - name: Install jsonnet-bundler
+ run: |
+ go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1
+ echo $(go env GOPATH)/bin >> $GITHUB_PATH
+
+ - name: Install poetry
+ run: pipx install poetry
+
+ - name: Setup Python
+ uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
+ with:
+ python-version: '3.10'
+ cache: 'poetry'
+
+ - name: Install dependencies with poetry
+ run: |
+ poetry install --only=main
+ working-directory: otterdog
+
+ - name: Copy configuration from HEAD and BASE ref
+ run: |
+ mkdir -p orgs/${{ github.repository_owner }}
+ cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }}
+ cp ../${{ github.repository_owner }}-base/otterdog/${{ github.repository_owner }}.jsonnet orgs/${{ github.repository_owner }}/${{ github.repository_owner }}.jsonnet-BASE
+ working-directory: otterdog-configs
+
+ - name: Validate Otterdog Configuration and diff HEAD <-> BASE
+ id: validate
+ run: |
+ # use script to enable ansi color output
+ script -e -q /dev/null --command "../otterdog/otterdog.sh local-plan ${{ github.repository_owner }} -c otterdog.json --suffix=-BASE" | tee "$GITHUB_WORKSPACE/diff-ansi.txt"
+ echo "VALIDATION_STATUS=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
+ # filter out ansi escape sequences again, use sed as ansi2txt is not available
+ cat "$GITHUB_WORKSPACE/diff-ansi.txt" | sed -e 's/\x1b\[[0-9;]*m//g' | sed -E 's/^([[:space:]]+)([-+!])/\2\1/g' | sed -E 's/^([[:space:]]+)([~])/!\1/g' > "$GITHUB_WORKSPACE/diff.txt"
+ working-directory: otterdog-configs
+
+ - name: Generate canonical diff
+ run: |
+ ../otterdog/otterdog.sh canonical-diff ${{ github.repository_owner }} -c otterdog.json | tee "$GITHUB_WORKSPACE/canonical-diff-ansi.txt"
+ # filter out ansi escape sequences
+ cat "$GITHUB_WORKSPACE/canonical-diff-ansi.txt" | sed -e 's/\x1b\[[0-9;]*m//g' | sed -E 's/^([[:space:]]+)([-+!])/\2\1/g' | sed -E 's/^([[:space:]]+)([~])/!\1/g' > "$GITHUB_WORKSPACE/canonical-diff.txt"
+ working-directory: otterdog-configs
+
+ # Add a comment to the pull request with the diff
+
+ - name: Generate comment
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ script: |
+ const commentText = 'Diff for ' + process.env.GITHUB_SHA + ':';
+ const canonicalCommentText = 'Canonical Diff for ' + process.env.GITHUB_SHA + ':';
+
+ const fs = require('fs');
+ const diff = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/diff.txt').toString().trimEnd();
+ const canonicalDiff = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/canonical-diff.txt').toString().trimEnd();
+
+ var body = "" + commentText + "
\n\n```diff\n" + diff + "\n```\n\n" + canonicalCommentText + "
\n\n```diff\n" + canonicalDiff + "\n```\n\n