GRM-64: refactor: migrate from scripts/ to devx package

This commit is contained in:
2026-06-22 19:45:24 +00:00
parent a0f997cb3e
commit 041e5ac4aa
73 changed files with 294 additions and 12114 deletions
+38 -32
View File
@@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-quality
- name: Lint all
run: |
@@ -24,22 +26,10 @@ jobs:
make pytest-cov
- name: Check unit test speed
env:
PYTHONPATH: .:src
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/check_test_speed.py --max-seconds 10
- name: Documentation coverage check
env:
PYTHONPATH: .:src
run: |
. .venv/bin/activate
python3 scripts/ci/doc_coverage.py --fail-on-missing
- name: Translation completeness check
env:
PYTHONPATH: .:src
run: |
. .venv/bin/activate
python3 scripts/ci/check_translations.py
python3 -m devx.tools.check_test_speed --max-seconds 10
- name: Dependency security scan
run: |
. .venv/bin/activate
@@ -68,14 +58,18 @@ jobs:
with:
fetch-depth: 0
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-release
- name: Release dry-run validation
env:
PYTHONPATH: .:src
PYTHONPATH: src
DEVX_VERSION_FILE: src/gitea_runner_manager/__init__.py
DEVX_TASK_PREFIX: GRM
run: |
. .venv/bin/activate
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/release.py --dry-run || true
python3 -m devx.ci.release --dry-run || true
detect-changes:
runs-on: docker
@@ -88,14 +82,17 @@ jobs:
with:
fetch-depth: 0
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-ci
- name: Detect changed paths
id: detect
env:
PYTHONPATH: .:src
PYTHONPATH: src
DEVX_TASK_PREFIX: GRM
run: |
. .venv/bin/activate
python3 scripts/ci/classify_changes.py \
python3 -m devx.ci.classify_changes \
--base "origin/master" \
--head "${{ github.event.pull_request.head.sha || github.sha }}" \
--github-output
@@ -111,16 +108,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-ci
- name: Discover available runners
id: discover
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
MOLECULE_RUNNERS: ${{ vars.MOLECULE_RUNNERS }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/ci/discover_runners.py \
python3 -m devx.molecule.discover_runners \
--owner "${{ github.repository_owner }}" \
--repo "${{ github.event.repository.name }}" \
--github-output
@@ -136,15 +135,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-molecule
- name: Discover assigned test pairs
env:
RUNNER_INDEX: ${{ matrix.runner-index }}
MAX_RUNNERS: ${{ needs.discover-runners.outputs.runner-count }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/ci/distribute_molecule.py \
python3 -m devx.molecule.distribute_molecule \
--runner-index "$RUNNER_INDEX" \
--max-runners "$MAX_RUNNERS" \
--github-env --skip-if-excess
@@ -154,7 +155,7 @@ jobs:
. .venv/bin/activate
if [ -z "$TEST_PAIRS" ]; then exit 0; fi
# shellcheck disable=SC2086 # intentional word splitting for argument expansion
python3 scripts/ci/molecule_ci_guard.py $TEST_PAIRS
python3 -m devx.molecule.molecule_ci_guard $TEST_PAIRS
env:
GITEA_URL: ${{ github.server_url }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
@@ -162,7 +163,7 @@ jobs:
JOB_NAME: ${{ github.job }}
MATRIX_INDEX: ${{ matrix.runner-index }}
GITEA_REPOSITORY: ${{ github.repository }}
PYTHONPATH: .:src
PYTHONPATH: src
pr-review:
if: github.event_name == 'pull_request'
@@ -170,16 +171,17 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up environment
run: make setup-ci
- name: Install dependencies
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Run automated PR review
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
set -euo pipefail
. .venv/bin/activate
python3 scripts/ci/pr_review.py \
python3 -m devx.ci.pr_review \
"${{ github.event.number }}" \
"${{ github.repository }}"
@@ -197,18 +199,22 @@ jobs:
fetch-depth: 0
token: ${{ secrets.REPO_TOKEN }}
- name: Install dependencies
run: python3 -m pip install --break-system-packages requests python-dotenv click
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Squash merge with task ID
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
DEVX_TASK_PREFIX: GRM
DEVX_VIKUNJA_PROJECT_ID: 6
HEAD_REF: ${{ github.head_ref }}
PR_TITLE: ${{ github.event.pull_request.title }}
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
run: |
python3 scripts/ci/auto_merge.py \
python3 -m devx.ci.auto_merge \
"$HEAD_REF" \
"$PR_TITLE" \
"$REPOSITORY" \
+59 -28
View File
@@ -40,11 +40,15 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install dependencies
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Check if this is a release commit
id: check
env:
PYTHONPATH: .:src
run: python3 scripts/ci/detect_release_commit.py
PYTHONPATH: src
run: python3 -m devx.ci.detect_release_commit
validate-commit-msg:
needs: [detect-type]
@@ -56,13 +60,15 @@ jobs:
with:
fetch-depth: 1
- name: Install dependencies
run: python3 -m pip install --break-system-packages click python-dotenv
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Validate latest commit message
env:
PYTHONPATH: .:src
PYTHONPATH: src
run: |
git log -1 --format=%B > commit-msg.txt
python3 scripts/ci/validate_commit_msg.py commit-msg.txt --branch master
python3 -m devx.ci.validate_commit_msg commit-msg.txt --branch master
rm -f commit-msg.txt
release:
@@ -76,6 +82,8 @@ jobs:
fetch-depth: 0
token: ${{ secrets.REPO_TOKEN }}
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-release
- name: Configure git
run: |
@@ -83,19 +91,25 @@ jobs:
git config user.email "grm-ci-bot@oblachno.fyi"
- name: Run release
env:
PYTHONPATH: .:src
PYTHONPATH: src
DEVX_VERSION_FILE: src/gitea_runner_manager/__init__.py
DEVX_TASK_PREFIX: GRM
DEVX_VIKUNJA_PROJECT_ID: 6
run: |
. .venv/bin/activate
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/release.py
python3 -m devx.ci.release
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/notify_failure.py \
python3 -m devx.tools.install_tools --tool tea
tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true
tea login default grm || true
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "post-merge/release" \
@@ -111,22 +125,27 @@ jobs:
with:
fetch-depth: 0
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-ci
- name: Sync documentation to wiki
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
. .venv/bin/activate
python3 scripts/ci/sync_wiki.py --repo "${{ github.repository }}" --strict
python3 -m devx.ci.sync_wiki --repo "${{ github.repository }}" --strict
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/notify_failure.py \
python3 -m devx.tools.install_tools --tool tea
tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true
tea login default grm || true
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "post-merge/sync-wiki" \
@@ -148,21 +167,26 @@ jobs:
git fetch origin master
git reset --hard origin/master
- name: Set up environment
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
run: make setup-ci
- name: Generate and push badges
env:
PRE_COMMIT_ALLOW_NO_CONFIG: "1"
run: |
. .venv/bin/activate
python3 scripts/ci/push_badges.py
python3 -m devx.ci.push_badges
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/notify_failure.py \
python3 -m devx.tools.install_tools --tool tea
tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true
tea login default grm || true
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "post-merge/badges" \
@@ -178,23 +202,27 @@ jobs:
with:
fetch-depth: 0
- name: Install dependencies
run: python3 -m pip install --break-system-packages requests python-dotenv click
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Update Vikunja task
env:
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
PYTHONPATH: .:src
run: python3 scripts/ci/post_merge.py --git-sha "${{ github.sha }}"
PYTHONPATH: src
DEVX_TASK_PREFIX: GRM
DEVX_VIKUNJA_PROJECT_ID: 6
run: python3 -m devx.ci.post_merge --git-sha "${{ github.sha }}"
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/install_tools.py --tool tea
python3 -m devx.tools.install_tools --tool tea
tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true
tea login default grm || true
python3 scripts/ci/notify_failure.py \
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "post-merge/vikunja" \
@@ -208,23 +236,26 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install --break-system-packages requests python-dotenv click
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
- name: Ensure branch protection and labels
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
run: python3 scripts/configure_repo.py
PYTHONPATH: src
DEVX_STATUS_CHECKS: "CI / quality (pull_request),CI / molecule-tests (1) (pull_request),CI / molecule-tests (2) (pull_request),CI / molecule-tests (3) (pull_request)"
run: python3 -m devx.tools.configure_repo
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/install_tools.py --tool tea
python3 -m devx.tools.install_tools --tool tea
tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true
tea login default grm || true
python3 scripts/ci/notify_failure.py \
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "post-merge/configure-repo" \
+9 -6
View File
@@ -14,9 +14,12 @@ jobs:
with:
fetch-depth: 0
- name: Install CI tools
run: python3 scripts/install_tools.py --tool git-cliff --tool tea
run: |
. .env 2>/dev/null || true
python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@master"
python3 -m devx.tools.install_tools --tool git-cliff --tool tea
- name: Install build tools
run: python3 -m pip install --break-system-packages build twine requests python-dotenv click
run: python3 -m pip install --break-system-packages build twine
- name: Configure tea login
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
@@ -28,20 +31,20 @@ jobs:
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/publish.py \
python3 -m devx.ci.publish \
"${{ github.ref_name }}" \
"${{ github.repository }}"
- name: Notify on failure
if: failure()
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
PYTHONPATH: .:src
PYTHONPATH: src
run: |
export PATH="$HOME/.local/bin:$PATH"
python3 scripts/ci/notify_failure.py \
python3 -m devx.ci.notify_failure \
--repo "${{ github.repository }}" \
--run-id "${{ github.run_id }}" \
--workflow "publish" \