Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae52aab843 | ||
|
|
2acc1c0eb6 | ||
|
|
a31af2e236 | ||
|
|
68a763b942 | ||
|
|
d9dae396bc | ||
|
|
7816733e5e | ||
|
|
1287785bb8 | ||
|
|
eabd7059d9 | ||
|
|
9e771096e7 | ||
|
|
99413d3ead | ||
|
|
e6e3ba352f | ||
|
|
13aab5539a | ||
|
|
998e438270 | ||
|
|
eab452ec04 | ||
|
|
9609ef2505 | ||
|
|
97e7687e25 | ||
|
|
f672da1753 | ||
|
|
d6549de2e0 | ||
|
|
dc4bb0936d | ||
|
|
52477e558a | ||
|
|
28214de583 | ||
|
|
7fd023d192 | ||
|
|
2ffedaa793 | ||
|
|
e7b2d4e6af | ||
|
|
bda2af91bc | ||
|
|
c72dc97f63 | ||
|
|
db9fb6f162 | ||
|
|
d102453960 | ||
|
|
42409d9e47 | ||
|
|
91e880f05c | ||
|
|
2d2eaa3291 | ||
|
|
8176a62885 | ||
|
|
443756a508 | ||
|
|
340222e041 | ||
|
|
179e47bbb2 | ||
|
|
68d16577b3 | ||
|
|
38607d9f29 | ||
|
|
90139b306b | ||
|
|
dd475bec0d | ||
|
|
0f0ada3576 | ||
|
|
185e41c49e | ||
|
|
103741b3ab | ||
|
|
b770d1debf | ||
|
|
2f11489be0 | ||
|
|
8e9e58fedb | ||
|
|
70d985ebaa | ||
|
|
66f071b676 | ||
|
|
7e18d285ab | ||
|
|
f6ba60bda6 | ||
|
|
0545388b34 | ||
|
|
eb0a56350b | ||
|
|
f712a4493e | ||
|
|
9289b19162 | ||
|
|
185251090f | ||
|
|
fff930920f | ||
|
|
88eca1f6b8 | ||
|
|
1718a415c8 | ||
|
|
3f27ee1423 | ||
|
|
2cf267bace | ||
|
|
87513f9e8f | ||
|
|
8b1a959bc9 | ||
|
|
f6a4f1fe43 | ||
|
|
9ea7ae656b | ||
|
|
70240a13cf | ||
|
|
fd7b786db4 | ||
|
|
c4fe70979c | ||
|
|
dd9fc601fb | ||
|
|
62b37d045e | ||
|
|
390fcb9d4b | ||
|
|
9f8adf14bc | ||
|
|
92e4d2fd2b | ||
|
|
f30764d60f | ||
|
|
a0e3fc09c9 | ||
|
|
bb9e8e6c4b | ||
|
|
d8312ff62c | ||
|
|
39a8f20df2 | ||
|
|
240f08fff4 | ||
|
|
d38a64b0e1 | ||
|
|
89bd40c4a8 | ||
|
|
ab2101983f | ||
|
|
12f4aa4c92 | ||
|
|
60ad1ad30d | ||
|
|
0e64353b0d | ||
|
|
5956bb4fac | ||
|
|
9879ac5935 | ||
|
|
89a765eca6 | ||
|
|
8625f66151 | ||
|
|
7449a05506 | ||
|
|
c61933c4a2 | ||
|
|
dde8445ed4 | ||
|
|
621cc87664 | ||
|
|
262fd57771 | ||
|
|
8a41b1237d | ||
|
|
34742bab40 | ||
|
|
d3dbb17cc2 | ||
|
|
751f594ce5 | ||
|
|
d8caebee2d | ||
|
|
bb4cc80a98 | ||
|
|
e0b2e64b8e | ||
|
|
00404cb484 | ||
|
|
1a30b595dc | ||
|
|
3538eb0803 | ||
|
|
5a93559b79 | ||
|
|
e30acbe213 | ||
|
|
386f3a88c6 | ||
|
|
e99e9d0ac8 | ||
|
|
ca1d8e5cc0 | ||
|
|
83e800c900 | ||
|
|
be17dc278c | ||
|
|
58b8d5b5de | ||
|
|
48f23b554f | ||
|
|
d32bb40cbd | ||
|
|
34954aa396 | ||
|
|
b9d728334f | ||
|
|
02d7c02a19 |
@@ -34,12 +34,13 @@ permissions:
|
|||||||
|
|
||||||
You are a CI failure investigator for the grm repo.
|
You are a CI failure investigator for the grm repo.
|
||||||
|
|
||||||
## Working Directory
|
## Working Directory & Virtual Environment
|
||||||
|
|
||||||
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first:
|
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
||||||
```bash
|
|
||||||
cd /home/emo/dev/ideas/oblachno/grm
|
All Python tools run inside `.venv`. `make` targets handle activation
|
||||||
```
|
automatically — always use `make <target>`, never raw `pytest` or `ruff`
|
||||||
|
commands. If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
## CI Job Dependency Graph
|
## CI Job Dependency Graph
|
||||||
|
|
||||||
@@ -98,7 +99,7 @@ Focus on the FIRST error.
|
|||||||
**Release failures:**
|
**Release failures:**
|
||||||
- **git-cliff errors**: version calculation, no unreleased changes
|
- **git-cliff errors**: version calculation, no unreleased changes
|
||||||
- **Lint/test during release**: release runs `make lint-ruff` and `make pytest-cov`
|
- **Lint/test during release**: release runs `make lint-ruff` and `make pytest-cov`
|
||||||
- **Tag/commit misalignment**: check `src/gitea_runner_manager/__init__.py` version
|
- **Tag/commit misalignment**: check `src/grm/__init__.py` version
|
||||||
|
|
||||||
**Publish failures:**
|
**Publish failures:**
|
||||||
- **PyPI publish**: registry auth, package build errors
|
- **PyPI publish**: registry auth, package build errors
|
||||||
|
|||||||
@@ -31,10 +31,14 @@ permissions:
|
|||||||
|
|
||||||
You are a dependency upgrade specialist for the grm repo.
|
You are a dependency upgrade specialist for the grm repo.
|
||||||
|
|
||||||
## Working Directory
|
## Working Directory & Virtual Environment
|
||||||
|
|
||||||
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
||||||
|
|
||||||
|
All Python tools run inside `.venv`. `make` targets handle activation
|
||||||
|
automatically — always use `make <target>`, never raw `pytest` or `ruff`
|
||||||
|
commands. If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
## Dependency Reference Locations
|
## Dependency Reference Locations
|
||||||
|
|
||||||
- **Python deps**: `pyproject.toml` — `[project] dependencies` and `[project.optional-dependencies]`
|
- **Python deps**: `pyproject.toml` — `[project] dependencies` and `[project.optional-dependencies]`
|
||||||
@@ -88,8 +92,8 @@ pip install -e .[dev] # reinstall with new deps
|
|||||||
ansible-galaxy install -r ansible/requirements.yml # update collections
|
ansible-galaxy install -r ansible/requirements.yml # update collections
|
||||||
make pytest-cov # 100% coverage
|
make pytest-cov # 100% coverage
|
||||||
make lint-all # ruff + pyright + bandit + ansible-lint + checkmake + actionlint
|
make lint-all # ruff + pyright + bandit + ansible-lint + checkmake + actionlint
|
||||||
python3 -m devx.tools.check_pyproject_deps
|
.venv/bin/python -m devx.tools.check_pyproject_deps
|
||||||
python3 -m devx.tools.check_test_speed --max-seconds 4 --max-single-seconds 0.5
|
.venv/bin/python -m devx.tools.check_test_speed --max-seconds 4 --max-single-seconds 0.5
|
||||||
```
|
```
|
||||||
|
|
||||||
If the dependency affects Ansible behavior, also run molecule:
|
If the dependency affects Ansible behavior, also run molecule:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
name: doc-syncer
|
name: doc-sync-specialist
|
||||||
description: Handles documentation coverage, doc structure linting, and wiki sync for the grm repo. Detects missing docs, fixes broken links, updates mapping.json, and debugs wiki sync failures.
|
description: Handles documentation coverage, doc structure linting, and wiki sync for the grm repo. Detects missing docs, fixes broken links, updates mapping.json, and debugs wiki sync failures.
|
||||||
model: glm-5.2
|
model: glm-5.2
|
||||||
allowed-tools:
|
allowed-tools:
|
||||||
@@ -25,10 +25,14 @@ permissions:
|
|||||||
|
|
||||||
You are a documentation sync specialist for the grm repo.
|
You are a documentation sync specialist for the grm repo.
|
||||||
|
|
||||||
## Working Directory
|
## Working Directory & Virtual Environment
|
||||||
|
|
||||||
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
||||||
|
|
||||||
|
All Python tools run inside `.venv`. `make` targets handle activation
|
||||||
|
automatically — always use `make <target>`, never raw `pytest` or `ruff`
|
||||||
|
commands. If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
## Documentation Structure
|
## Documentation Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -54,14 +58,14 @@ docs/
|
|||||||
|
|
||||||
### Step 1: Check documentation coverage
|
### Step 1: Check documentation coverage
|
||||||
```bash
|
```bash
|
||||||
python3 -m devx.ci.doc_coverage --fail-on-missing
|
.venv/bin/python -m devx.ci.doc_coverage --fail-on-missing
|
||||||
```
|
```
|
||||||
Fix undocumented CLI commands, modules, or CI scripts by adding entries
|
Fix undocumented CLI commands, modules, or CI scripts by adding entries
|
||||||
to the appropriate docs file.
|
to the appropriate docs file.
|
||||||
|
|
||||||
### Step 2: Lint documentation structure
|
### Step 2: Lint documentation structure
|
||||||
```bash
|
```bash
|
||||||
python3 -m devx.ci.lint_docs --root .
|
.venv/bin/python -m devx.ci.lint_docs --root .
|
||||||
```
|
```
|
||||||
Fix: broken internal links, heading hierarchy skips, TODO/FIXME markers,
|
Fix: broken internal links, heading hierarchy skips, TODO/FIXME markers,
|
||||||
trailing whitespace.
|
trailing whitespace.
|
||||||
@@ -74,7 +78,7 @@ Update any references to files that were renamed or deleted.
|
|||||||
|
|
||||||
### Step 4: Verify wiki sync (if investigating a sync failure)
|
### Step 4: Verify wiki sync (if investigating a sync failure)
|
||||||
```bash
|
```bash
|
||||||
python3 -m devx.ci.sync_wiki --repo oblachno-oss/grm --strict
|
.venv/bin/python -m devx.ci.sync_wiki --repo oblachno-oss/grm --strict
|
||||||
```
|
```
|
||||||
Check `docs/mapping.json` — every docs file should have a mapping entry.
|
Check `docs/mapping.json` — every docs file should have a mapping entry.
|
||||||
If adding a new docs file, add it to mapping.json with a wiki-compatible
|
If adding a new docs file, add it to mapping.json with a wiki-compatible
|
||||||
@@ -25,10 +25,14 @@ permissions:
|
|||||||
|
|
||||||
You are a molecule test runner for the grm repo.
|
You are a molecule test runner for the grm repo.
|
||||||
|
|
||||||
## Working Directory
|
## Working Directory & Virtual Environment
|
||||||
|
|
||||||
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
||||||
|
|
||||||
|
All Python tools run inside `.venv`. `make` targets handle activation
|
||||||
|
automatically — always use `make <target>`, never raw `pytest` or `ruff`
|
||||||
|
commands. If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
## Available Scenarios (7 total)
|
## Available Scenarios (7 total)
|
||||||
|
|
||||||
| Scenario | Purpose | Makefile target |
|
| Scenario | Purpose | Makefile target |
|
||||||
|
|||||||
@@ -27,10 +27,14 @@ permissions:
|
|||||||
|
|
||||||
You are a Gitea Actions workflow validator for the grm repo.
|
You are a Gitea Actions workflow validator for the grm repo.
|
||||||
|
|
||||||
## Working Directory
|
## Working Directory & Virtual Environment
|
||||||
|
|
||||||
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
The grm repo is at `/home/emo/dev/ideas/oblachno/grm`. Always `cd` there first.
|
||||||
|
|
||||||
|
All Python tools run inside `.venv`. `make` targets handle activation
|
||||||
|
automatically — always use `make <target>`, never raw `pytest` or `ruff`
|
||||||
|
commands. If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
## Key Files
|
## Key Files
|
||||||
|
|
||||||
- `.gitea/workflows/ci.yml` — PR pipeline (quality, detect-changes, pre-merge-check, discover-runners, molecule-tests, molecule-report, release-dry-run, pr-review, auto-merge)
|
- `.gitea/workflows/ci.yml` — PR pipeline (quality, detect-changes, pre-merge-check, discover-runners, molecule-tests, molecule-report, release-dry-run, pr-review, auto-merge)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ Quick reference for devx tools when working on this repo.
|
|||||||
| Check CI status | `make devx-pr-status` or `make devx-pr-status PR=42 WAIT=1` |
|
| Check CI status | `make devx-pr-status` or `make devx-pr-status PR=42 WAIT=1` |
|
||||||
| Fetch CI failure logs | `make devx-pr-logs` or `make devx-pr-logs PR=42 JOB=quality TAIL=50` |
|
| Fetch CI failure logs | `make devx-pr-logs` or `make devx-pr-logs PR=42 JOB=quality TAIL=50` |
|
||||||
| Add ready-to-merge label | `make devx-pr-label` or `make devx-pr-label PR=42` |
|
| Add ready-to-merge label | `make devx-pr-label` or `make devx-pr-label PR=42` |
|
||||||
| Post PR review | `make devx-pr-review PR=42 EVENT=APPROVE BODY="..." CHECKLIST=1,2,3,4,5,6,7,8,9,10,11,12,13` |
|
|
||||||
| Rebase current branch | `make rebase` |
|
| Rebase current branch | `make rebase` |
|
||||||
| Rebase PR via API | `make pr-rebase` or `make pr-rebase PR=42` |
|
| Rebase PR via API | `make pr-rebase` or `make pr-rebase PR=42` |
|
||||||
|
|
||||||
@@ -30,6 +29,25 @@ CI runs a `pre-merge-check` job early (after quality + detect-changes)
|
|||||||
that validates branch format, PR title, and Vikunja task match.
|
that validates branch format, PR title, and Vikunja task match.
|
||||||
This fails fast before expensive molecule tests run.
|
This fails fast before expensive molecule tests run.
|
||||||
|
|
||||||
|
## Spec-Driven CI Gates (Pre-merge)
|
||||||
|
|
||||||
|
Every PR must pass these gates before merge:
|
||||||
|
|
||||||
|
| Gate | Module | What it checks |
|
||||||
|
|------|--------|----------------|
|
||||||
|
| Spec validation | `devx.ci.validate_spec` | Spec file exists at `docs/specs/<TASK-ID>.md`, has REQ-IDs, all ACs checked |
|
||||||
|
| PR size | `devx.ci.check_pr_size` | Max 500 lines / 10 files (excludes CHANGELOG, badges, locks) |
|
||||||
|
|
||||||
|
Full molecule tests still run on every PR (6 scenarios, all platforms).
|
||||||
|
|
||||||
|
## Post-merge Auto-publish + Dependency PR
|
||||||
|
|
||||||
|
After merge to master, `post-merge.yml`:
|
||||||
|
1. Runs release (git-cliff semver, tags, publishes to Gitea PyPI)
|
||||||
|
2. Auto-creates an infra dependency PR (`devx.ci.create_dependency_pr`)
|
||||||
|
to bump the pinned grm version in `infra/pyproject.toml`
|
||||||
|
3. Syncs wiki, updates Vikunja task, pushes badges
|
||||||
|
|
||||||
## Key Rules
|
## Key Rules
|
||||||
|
|
||||||
- Never manually merge via API — always use auto-merge with `ready-to-merge` label
|
- Never manually merge via API — always use auto-merge with `ready-to-merge` label
|
||||||
|
|||||||
@@ -0,0 +1,272 @@
|
|||||||
|
# pr-review
|
||||||
|
|
||||||
|
Deep, critical PR review with auto-fix. This skill guides the agent
|
||||||
|
through a thorough review of a pull request, posting inline comments
|
||||||
|
for each issue found, auto-fixing them, resolving the discussion threads,
|
||||||
|
and marking the PR as ready-to-merge when no blocking issues remain.
|
||||||
|
|
||||||
|
## When to Invoke
|
||||||
|
|
||||||
|
Invoke this skill when asked to review a PR, or when a PR is open and
|
||||||
|
needs review before merge. Do NOT invoke automatically on every PR —
|
||||||
|
this is an on-demand deep review, not a CI gate.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- The PR must be open in a Gitea repo
|
||||||
|
- The agent needs Gitea MCP access (gitea server)
|
||||||
|
- The agent needs git push access to the PR's head branch
|
||||||
|
- The PR should have passed CI (validate job) before deep review
|
||||||
|
|
||||||
|
## Review Categories
|
||||||
|
|
||||||
|
Review every PR against these 8 categories. For each issue found, post
|
||||||
|
an inline comment on the specific line, then auto-fix it.
|
||||||
|
|
||||||
|
### 1. Functional Correctness
|
||||||
|
|
||||||
|
- Does the code actually do what the spec/PR title claims?
|
||||||
|
- Are edge cases handled? (empty input, null, boundary values, concurrent access)
|
||||||
|
- Are error paths tested? Not just happy path.
|
||||||
|
- Does the code handle all return values? (ignored errors, unchecked None)
|
||||||
|
- Are there off-by-one errors, wrong comparisons, inverted conditions?
|
||||||
|
- Do loops terminate correctly? (no infinite loops, correct break/continue)
|
||||||
|
- Are regex patterns correct? (anchored, escaped, non-greedy where needed)
|
||||||
|
- Are API responses validated before use? (status codes, response shape)
|
||||||
|
|
||||||
|
### 2. Completeness
|
||||||
|
|
||||||
|
- Are all requirements from the spec implemented? (check each REQ-ID)
|
||||||
|
- Are all acceptance criteria in the spec checked off?
|
||||||
|
- Are tests written for all new code paths?
|
||||||
|
- Are error messages user-facing (wrapped in `_()`)?
|
||||||
|
- Are new CLI commands documented in `docs/user/cli-commands.md`?
|
||||||
|
- Are new modules added to architecture docs?
|
||||||
|
- Are CHANGELOG entries added for user-facing changes?
|
||||||
|
- Are translations added for new user-facing strings?
|
||||||
|
|
||||||
|
### 3. Architecture
|
||||||
|
|
||||||
|
- Does the code follow the repo's layer separation? (no business logic in CLI, no direct subprocess in CLI)
|
||||||
|
- Are new dependencies justified? (no unnecessary new packages)
|
||||||
|
- Is configuration via env vars / config.py, not hardcoded?
|
||||||
|
- Are new modules placed in the correct directory? (ci/ vs tools/ vs molecule/)
|
||||||
|
- Does the code reuse existing utilities? (no reimplemented helpers)
|
||||||
|
- Are imports circular? (check import chains)
|
||||||
|
- Is the code testable? (injectable dependencies, no hidden global state)
|
||||||
|
- Does the code follow existing patterns in the codebase?
|
||||||
|
|
||||||
|
### 4. Reliability
|
||||||
|
|
||||||
|
- Are external API calls retried with backoff?
|
||||||
|
- Are timeouts set on all network operations?
|
||||||
|
- Are file operations atomic? (write to temp, rename)
|
||||||
|
- Are database operations transactional where needed?
|
||||||
|
- Are there race conditions? (check shared mutable state)
|
||||||
|
- Are resources cleaned up in all paths? (finally blocks, context managers)
|
||||||
|
- Can the code handle partial failures? (one service down, others up)
|
||||||
|
- Are idempotency guarantees maintained? (safe to retry)
|
||||||
|
|
||||||
|
### 5. Robustness
|
||||||
|
|
||||||
|
- Does the code fail gracefully? (meaningful error messages, not stack traces)
|
||||||
|
- Are unexpected inputs handled? (type checking, validation)
|
||||||
|
- Are there any crash-on-bad-input paths?
|
||||||
|
- Does the code degrade under load? (backpressure, queue limits)
|
||||||
|
- Are there resource leaks? (file handles, connections, memory)
|
||||||
|
- Does the code survive network partitions? (retry, circuit breaker)
|
||||||
|
- Are there any unhandled exceptions that could crash the process?
|
||||||
|
- Is logging sufficient to diagnose production issues?
|
||||||
|
|
||||||
|
### 6. Security
|
||||||
|
|
||||||
|
- Are there hardcoded secrets, tokens, or passwords?
|
||||||
|
- Is `shell=True` used with user input? (command injection)
|
||||||
|
- Is `eval()` or `exec()` used? (code injection)
|
||||||
|
- Are SQL queries parameterized? (no string concatenation)
|
||||||
|
- Are file paths validated? (no path traversal)
|
||||||
|
- Are user inputs sanitized before display? (XSS in web contexts)
|
||||||
|
- Are SSL/TLS verifications disabled without justification?
|
||||||
|
- Are secrets logged in error messages or debug output?
|
||||||
|
- Are permissions checked before privileged operations?
|
||||||
|
- Is sensitive data in memory longer than necessary?
|
||||||
|
|
||||||
|
### 7. Technical Excellence
|
||||||
|
|
||||||
|
- Are functions under 50 lines? (refactor if longer)
|
||||||
|
- Is cyclomatic complexity reasonable? (no deeply nested if/else chains)
|
||||||
|
- Are names meaningful? (no single-letter vars, no misleading names)
|
||||||
|
- Is dead code removed? (no commented-out blocks, no unused imports)
|
||||||
|
- Are comments explaining WHY, not WHAT?
|
||||||
|
- Is the code DRY? (no copy-pasted blocks that should be shared)
|
||||||
|
- Is the code SOLID? (single responsibility, open/closed)
|
||||||
|
- Are magic numbers extracted to named constants?
|
||||||
|
- Is the code formatted per the repo's linter config?
|
||||||
|
- Are type hints present on all function signatures?
|
||||||
|
|
||||||
|
### 8. Test Quality
|
||||||
|
|
||||||
|
- Do tests actually test the behavior? (not just that code runs)
|
||||||
|
- Are tests independent? (no shared mutable state, no order dependency)
|
||||||
|
- Are tests fast? (no real sleeps, no real network calls, mocked)
|
||||||
|
- Are edge cases tested? (empty, None, boundary, error paths)
|
||||||
|
- Are test names descriptive? (test_what_condition_expected_result)
|
||||||
|
- Are mocks set up correctly? (mocking the right object, not too broad)
|
||||||
|
- Is coverage 100% for new code? (every branch, every line)
|
||||||
|
- Are integration tests added for cross-module changes?
|
||||||
|
- Do tests clean up after themselves? (tmp_path, fixtures)
|
||||||
|
|
||||||
|
## Review Procedure
|
||||||
|
|
||||||
|
### Step 1: Gather Context
|
||||||
|
|
||||||
|
```
|
||||||
|
1. Read the PR spec (if exists): docs/specs/<TASK-ID>.md
|
||||||
|
2. Fetch PR details via Gitea MCP: pull_request_read (get_pr, list_pr_files)
|
||||||
|
3. Read the full diff: git diff origin/master...HEAD
|
||||||
|
4. Read the PR description and any existing review comments
|
||||||
|
5. Identify the repo's task prefix (OBL-INFRA, GRM, SSO, DEVX)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: Review Each File
|
||||||
|
|
||||||
|
For each changed file in the PR:
|
||||||
|
|
||||||
|
1. Read the full file (not just the diff) to understand context
|
||||||
|
2. Go through all 8 review categories
|
||||||
|
3. For each issue found, note: file path, line number, category, severity, description, suggested fix
|
||||||
|
|
||||||
|
### Step 3: Post Inline Comments
|
||||||
|
|
||||||
|
For each issue found, post an inline review comment using the Gitea MCP:
|
||||||
|
|
||||||
|
```
|
||||||
|
mcp_call_tool: gitea / pull_request_review_write
|
||||||
|
method: create
|
||||||
|
owner: <owner>
|
||||||
|
repo: <repo>
|
||||||
|
pull_number: <PR number>
|
||||||
|
state: PENDING (accumulate comments before submitting)
|
||||||
|
body: "" (empty for now, summary added on submit)
|
||||||
|
comments: [
|
||||||
|
{
|
||||||
|
path: "<file path>",
|
||||||
|
new_line_num: <line number>,
|
||||||
|
body: "**[<category>] [<severity>]** <description>\n\n**Suggested fix:**\n```<lang>\n<fixed code>\n```"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Comment format:
|
||||||
|
```
|
||||||
|
**[Security] [error]** `shell=True` used with user input — command injection risk.
|
||||||
|
|
||||||
|
**Suggested fix:**
|
||||||
|
```python
|
||||||
|
subprocess.run(["git", "log", commit], check=True)
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
|
Severity levels:
|
||||||
|
- `error` — must fix before merge (security, correctness, crash)
|
||||||
|
- `warning` — should fix before merge (reliability, best practice)
|
||||||
|
- `info` — consider fixing (style, minor improvement)
|
||||||
|
|
||||||
|
### Step 4: Auto-Fix Issues
|
||||||
|
|
||||||
|
For each issue that can be safely auto-fixed:
|
||||||
|
|
||||||
|
1. Edit the file using the `edit` tool
|
||||||
|
2. Commit with message: `fix: address review comment — <short description>`
|
||||||
|
3. Push to the PR's head branch: `git push origin HEAD`
|
||||||
|
4. Wait for CI to re-run on the push
|
||||||
|
|
||||||
|
Auto-fix ALL issues unless:
|
||||||
|
- The fix requires an architectural decision (ask the user)
|
||||||
|
- The fix changes public API behavior (ask the user)
|
||||||
|
- The fix is ambiguous (multiple valid approaches, ask the user)
|
||||||
|
|
||||||
|
### Step 5: Resolve Discussion Threads
|
||||||
|
|
||||||
|
After auto-fixing an issue and CI passes:
|
||||||
|
|
||||||
|
1. Find the review comment thread for that issue
|
||||||
|
2. Post a reply: `Fixed in <commit-sha>. Closing this thread.`
|
||||||
|
3. Resolve the discussion (if Gitea supports it via API)
|
||||||
|
4. If resolving via API is not available, the reply comment serves as resolution
|
||||||
|
|
||||||
|
### Step 6: Submit Final Review
|
||||||
|
|
||||||
|
After all issues are addressed (fixed or discussed):
|
||||||
|
|
||||||
|
```
|
||||||
|
mcp_call_tool: gitea / pull_request_review_write
|
||||||
|
method: submit
|
||||||
|
owner: <owner>
|
||||||
|
repo: <repo>
|
||||||
|
pull_number: <PR number>
|
||||||
|
review_id: <from step 3 create>
|
||||||
|
state: COMMENT (or APPROVED if no blocking issues remain)
|
||||||
|
body: <summary — see below>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 7: Post Summary
|
||||||
|
|
||||||
|
Post a brief summary as a PR comment (via `issue_write / add_comment`):
|
||||||
|
|
||||||
|
```
|
||||||
|
## Deep Review Summary
|
||||||
|
|
||||||
|
- **Files reviewed:** N
|
||||||
|
- **Issues found:** N (N auto-fixed, N require attention)
|
||||||
|
- **Categories:** security (N), correctness (N), architecture (N), ...
|
||||||
|
|
||||||
|
**Outcome:** ✅ Ready to merge — all issues addressed.
|
||||||
|
**OR**
|
||||||
|
**Outcome:** ⚠️ N blocking issue(s) remain — see inline comments.
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep the summary to 5-10 bullet points. Do not paste the full review.
|
||||||
|
|
||||||
|
### Step 8: Mark PR Ready
|
||||||
|
|
||||||
|
If all issues are addressed and no blocking issues remain:
|
||||||
|
|
||||||
|
```
|
||||||
|
mcp_call_tool: gitea / issue_write
|
||||||
|
method: add_labels
|
||||||
|
owner: <owner>
|
||||||
|
repo: <repo>
|
||||||
|
issue_number: <PR number>
|
||||||
|
labels: [<label_id for "ready-to-merge">]
|
||||||
|
```
|
||||||
|
|
||||||
|
If blocking issues remain, do NOT add the label. Post a comment
|
||||||
|
explaining what needs to be resolved before the PR can merge.
|
||||||
|
|
||||||
|
## Gitea MCP Tools Reference
|
||||||
|
|
||||||
|
| Action | MCP tool | Method |
|
||||||
|
|--------|----------|--------|
|
||||||
|
| Get PR details | `pull_request_read` | `get_pr` |
|
||||||
|
| List PR files | `pull_request_read` | `list_pr_files` |
|
||||||
|
| Get PR diff | `pull_request_read` | `get_pr_diff` |
|
||||||
|
| Create review (pending) | `pull_request_review_write` | `create` (state: PENDING) |
|
||||||
|
| Submit review | `pull_request_review_write` | `submit` (state: APPROVED/COMMENT/REQUEST_CHANGES) |
|
||||||
|
| Post PR comment | `issue_write` | `add_comment` |
|
||||||
|
| Add label | `issue_write` | `add_labels` |
|
||||||
|
| List labels | `label_read` | `list_repo_labels` |
|
||||||
|
| Merge PR | `pull_request_write` | `merge` (do NOT use — auto-merge handles this) |
|
||||||
|
|
||||||
|
## Important Rules
|
||||||
|
|
||||||
|
- **Never merge the PR yourself.** Add the `ready-to-merge` label and let
|
||||||
|
the auto-merge workflow handle it. This ensures CI passes and the
|
||||||
|
commit message follows the `<PREFIX>-N: <conventional>` format.
|
||||||
|
- **Never approve your own PR.** If the agent created the PR, post
|
||||||
|
COMMENT state, not APPROVED.
|
||||||
|
- **Always push fixes to the PR branch**, not directly to master.
|
||||||
|
- **Wait for CI after each push** before resolving the discussion thread.
|
||||||
|
- **Post one review with all comments**, not multiple reviews.
|
||||||
|
- **The summary must be brief** — 5-10 bullet points max.
|
||||||
|
- **Severity matters**: only `error` severity blocks the `ready-to-merge` label.
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
# Spec-Driven Development
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Every change starts with a spec. No spec, no code. No code, no PR.
|
||||||
|
|
||||||
|
The spec is a markdown file at `docs/specs/<TASK-ID>.md` in the repo.
|
||||||
|
It contains structured requirements (REQ-IDs) and acceptance criteria
|
||||||
|
(AC checklist) that CI validates before merge.
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
1. **Create Vikunja task** — `make create-task -- --title "Title" --description "..."`
|
||||||
|
2. **Write spec** — Create `docs/specs/<TASK-ID>.md` (see template below)
|
||||||
|
3. **Create branch** — `git checkout -b <PREFIX>-N-short-description`
|
||||||
|
4. **Implement** — Write code with `# Implements: REQ-N` comments
|
||||||
|
5. **Check ACs** — Tick all acceptance criteria checkboxes in the spec
|
||||||
|
6. **Push and create PR** — `make push-with-pr`
|
||||||
|
7. **CI validates** — Spec validation, PR size check, fast molecule, lint, tests
|
||||||
|
8. **Auto-merge** — Add `ready-to-merge` label after review
|
||||||
|
9. **Auto-deploy** — Post-merge deploys to staging (if nightly gate is green)
|
||||||
|
|
||||||
|
## Spec Template
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# <TASK-ID>: <Title>
|
||||||
|
|
||||||
|
## Problem
|
||||||
|
<What is broken or missing? Why does this change exist?>
|
||||||
|
|
||||||
|
## Approach
|
||||||
|
<How will you solve it? What are the key design decisions?>
|
||||||
|
|
||||||
|
REQ-1: <First requirement description>
|
||||||
|
REQ-2: <Second requirement description>
|
||||||
|
REQ-3: <Third requirement description>
|
||||||
|
|
||||||
|
## Test Plan
|
||||||
|
- <How will you verify each REQ is implemented correctly?>
|
||||||
|
- <Include unit tests, molecule scenarios, integration tests>
|
||||||
|
|
||||||
|
## Deploy Plan
|
||||||
|
- <How will this change be deployed?>
|
||||||
|
- <What order do components need to deploy in?>
|
||||||
|
- <Are there migrations or one-time operations?>
|
||||||
|
|
||||||
|
## Rollback Plan
|
||||||
|
- <How do you revert if something goes wrong?>
|
||||||
|
- <What data/state changes are irreversible?>
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
- [ ] REQ-1: <criterion that proves REQ-1 is done>
|
||||||
|
- [ ] REQ-2: <criterion that proves REQ-2 is done>
|
||||||
|
- [ ] REQ-3: <criterion that proves REQ-3 is done>
|
||||||
|
```
|
||||||
|
|
||||||
|
## CI Validation
|
||||||
|
|
||||||
|
The `devx.ci.validate_spec` module checks:
|
||||||
|
|
||||||
|
1. **Spec file exists** at `docs/specs/<TASK-ID>.md` (TASK-ID from branch name)
|
||||||
|
2. **Required sections present**: Problem, Approach, Test Plan, Deploy Plan, Rollback Plan, Acceptance Criteria
|
||||||
|
3. **At least one REQ-ID** line (format: `REQ-N: <description>`)
|
||||||
|
4. **All AC checkboxes checked** (`- [x]`, not `- [ ]`)
|
||||||
|
|
||||||
|
If any check fails, CI blocks the PR before expensive jobs run.
|
||||||
|
|
||||||
|
## PR Size Limits
|
||||||
|
|
||||||
|
CI enforces max 500 lines / 10 files changed (excluding CHANGELOG.md,
|
||||||
|
README.md, badges, lock files). Oversized PRs are rejected. Split your
|
||||||
|
work into smaller PRs.
|
||||||
|
|
||||||
|
## Code-to-Spec Linking
|
||||||
|
|
||||||
|
Each function, task, or template that implements a requirement should
|
||||||
|
have a comment:
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Implements: REQ-1
|
||||||
|
def install_sso_bridge():
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Implements: REQ-2
|
||||||
|
- name: Clone infra repo
|
||||||
|
git:
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fast Molecule (Pre-merge)
|
||||||
|
|
||||||
|
CI runs molecule only for **changed roles** (detected via git diff),
|
||||||
|
with converge + verify only, single platform. This gives quick feedback
|
||||||
|
(~5-10 min) without the full molecule suite.
|
||||||
|
|
||||||
|
## Full Molecule (Nightly)
|
||||||
|
|
||||||
|
The complete molecule suite (all scenarios, all platforms) runs nightly
|
||||||
|
at 02:00 CET on master. If it fails:
|
||||||
|
- A Gitea issue is created with the `feedback` label
|
||||||
|
- The `NIGHTLY_STATUS` repo variable is set to `failed:<run_id>`
|
||||||
|
- All staging deploys are blocked until nightly passes again
|
||||||
|
|
||||||
|
## Auto-Deploy on Merge
|
||||||
|
|
||||||
|
Every merged PR auto-deploys to staging (if nightly gate is green).
|
||||||
|
No manual trigger needed. The deploy runs the full pipeline:
|
||||||
|
provision → deploy-observability → deploy-customer → configure-oidc.
|
||||||
|
|
||||||
|
For grm/sso-bridge: post-merge publishes the package, then auto-creates
|
||||||
|
an infra PR to bump the pinned version. That infra PR auto-deploys when
|
||||||
|
merged.
|
||||||
|
|
||||||
|
## Key Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Validate spec locally (before pushing)
|
||||||
|
python -m devx.ci.validate_spec --branch <PREFIX>-N-description
|
||||||
|
|
||||||
|
# Check PR size locally
|
||||||
|
python -m devx.ci.check_pr_size --base origin/master --head HEAD
|
||||||
|
|
||||||
|
# See which roles need fast molecule
|
||||||
|
python -m devx.ci.fast_molecule --base origin/master --head HEAD
|
||||||
|
|
||||||
|
# Check nightly gate status
|
||||||
|
python -m devx.ci.nightly_gate --repo oblachno/infra --action check
|
||||||
|
```
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
# testing-and-debugging
|
||||||
|
|
||||||
|
Make targets for testing, debugging, and CI investigation. **Use these
|
||||||
|
instead of raw `pytest`, `ruff`, or `molecule` commands.**
|
||||||
|
|
||||||
|
## Why Make Targets
|
||||||
|
|
||||||
|
Make targets encapsulate the correct venv activation, PYTHONPATH, env
|
||||||
|
vars, and flags. Running raw commands bypasses venv activation and
|
||||||
|
produces false failures (missing dependencies, wrong Python version).
|
||||||
|
|
||||||
|
## Unit Tests
|
||||||
|
|
||||||
|
| Task | Command | Notes |
|
||||||
|
|------|---------|-------|
|
||||||
|
| Run all unit tests | `make test-unit` | Fast, no coverage |
|
||||||
|
| Run with coverage | `make pytest-cov` | **Required before push** — enforces 100% |
|
||||||
|
| Run single test | `make pytest-cov TEST=tests/test_foo.py::test_bar` | |
|
||||||
|
|
||||||
|
## Linting
|
||||||
|
|
||||||
|
| Task | Command | Notes |
|
||||||
|
|------|---------|-------|
|
||||||
|
| Full lint | `make lint-all` | ruff + pyright + bandit + ansible-lint + checkmake + actionlint |
|
||||||
|
| Ruff only | `make lint-ruff` | |
|
||||||
|
| Type check | `make typecheck` | pyright |
|
||||||
|
| Bandit | `make lint-bandit` | Security linter |
|
||||||
|
| Workflow lint | `make workflow-check` | actionlint + act_runner dry-run |
|
||||||
|
|
||||||
|
## Molecule Tests
|
||||||
|
|
||||||
|
| Task | Command | Notes |
|
||||||
|
|------|---------|-------|
|
||||||
|
| All scenarios | `make molecule` | All 6 scenarios on Ubuntu 22.04 |
|
||||||
|
| All platforms | `make molecule-all` | All 6 scenarios on all 4 OSes |
|
||||||
|
| Parallel | `make molecule-all-parallel` | MOLECULE_JOBS=4 |
|
||||||
|
|
||||||
|
### Spec-Driven Workflow
|
||||||
|
|
||||||
|
Every PR requires a spec file at `docs/specs/<TASK-ID>.md`. See the
|
||||||
|
`spec-driven-development` skill for the full workflow and template.
|
||||||
|
CI validates the spec before running expensive jobs.
|
||||||
|
|
||||||
|
## Pre-Push Verification
|
||||||
|
|
||||||
|
**Before pushing any branch:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make pre-push
|
||||||
|
```
|
||||||
|
|
||||||
|
This runs `lint-all` + `pytest-cov`. The pre-push git hook only
|
||||||
|
validates the Vikunja task exists — it does NOT run tests. You must
|
||||||
|
run `make pre-push` manually.
|
||||||
|
|
||||||
|
## CI Failure Investigation
|
||||||
|
|
||||||
|
When investigating a CI failure:
|
||||||
|
|
||||||
|
1. **Fetch logs via MCP** — use `mcp_call_tool` with gitea server,
|
||||||
|
`actions_run_read` method, `download_job_log` tool
|
||||||
|
2. **Reproduce locally** — use `make pytest-cov` or `make lint-ci`
|
||||||
|
depending on which CI job failed
|
||||||
|
3. **Never run raw pytest** — always use the make target
|
||||||
|
|
||||||
|
## Virtual Environment
|
||||||
|
|
||||||
|
All commands run inside `.venv`. `make` targets handle activation
|
||||||
|
automatically. For raw commands (rare), activate first:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source activate.sh # bash/zsh
|
||||||
|
source activate.fish # fish
|
||||||
|
source activate.zsh # zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
If `.venv` doesn't exist, run `make setup` first.
|
||||||
|
|
||||||
|
## Common Pitfalls
|
||||||
|
|
||||||
|
### Coverage Verification Before Push
|
||||||
|
|
||||||
|
**Always run `make pytest-cov` before pushing** — CI enforces 100%
|
||||||
|
coverage and will fail the PR if any lines are uncovered. This is the
|
||||||
|
most common cause of CI validate job failures after code changes. The
|
||||||
|
pre-push git hook only validates Vikunja task existence, not tests.
|
||||||
|
|
||||||
|
### API Response Type Checking
|
||||||
|
|
||||||
|
Never use `is True`/`is False` identity checks on API response values.
|
||||||
|
Many APIs return boolean values as strings (`"true"`/`"false"`). Use
|
||||||
|
string comparison or truthy/falsy helpers instead.
|
||||||
|
|
||||||
|
### Time Mocking in Tests
|
||||||
|
|
||||||
|
Always mock `time.sleep` and `time.monotonic` in unit tests using
|
||||||
|
`@patch` decorators. Real sleep calls make tests slow and exceed test
|
||||||
|
speed limits.
|
||||||
+14
-3
@@ -15,7 +15,8 @@ GITEA_REGISTRATION_TOKEN=your-registration-token
|
|||||||
# If set, API checks are performed as a bonus but do NOT affect pass/fail.
|
# If set, API checks are performed as a bonus but do NOT affect pass/fail.
|
||||||
# Required scopes: read:user, read:repository, read:admin (or just "admin")
|
# Required scopes: read:user, read:repository, read:admin (or just "admin")
|
||||||
# Generate token at: Settings → Applications → Generate New Token
|
# Generate token at: Settings → Applications → Generate New Token
|
||||||
# CI_GITEA_TOKEN=your-admin-api-token
|
# CI_GITEA_API_TOKEN=your-admin-api-token
|
||||||
|
# Legacy CI_GITEA_TOKEN is also accepted.
|
||||||
|
|
||||||
# Integration test API retries (optional, default: 3).
|
# Integration test API retries (optional, default: 3).
|
||||||
# Number of times to retry API checks waiting for runner to appear.
|
# Number of times to retry API checks waiting for runner to appear.
|
||||||
@@ -48,7 +49,17 @@ GITEA_REGISTRATION_TOKEN=your-registration-token
|
|||||||
|
|
||||||
# Gitea PyPI registry username (for private package access)
|
# Gitea PyPI registry username (for private package access)
|
||||||
# Used by PIP_INSTALL to configure PIP_EXTRA_INDEX_URL
|
# Used by PIP_INSTALL to configure PIP_EXTRA_INDEX_URL
|
||||||
CI_GITEA_USERNAME=emil
|
CI_GITEA_USERNAME=your-gitea-username
|
||||||
|
|
||||||
|
# Role-based Gitea API tokens (devx 0.40.0+)
|
||||||
|
# DEVELOPER_GITEA_API_TOKEN is used by local `grm trigger-workflow` and `make create-pr`.
|
||||||
|
# CI_GITEA_API_TOKEN is used by CI workflows (and accepted as a fallback for local tools).
|
||||||
|
# REVIEWER_GITEA_API_TOKEN is used by CI to post APPROVE reviews; it must belong to a
|
||||||
|
# different user than the PR author.
|
||||||
|
# Legacy CI_GITEA_TOKEN and REVIEW_GITEA_TOKEN are accepted as fallbacks.
|
||||||
|
# DEVELOPER_GITEA_API_TOKEN=your-developer-token
|
||||||
|
# CI_GITEA_API_TOKEN=your-ci-token
|
||||||
|
# REVIEWER_GITEA_API_TOKEN=your-reviewer-token
|
||||||
|
|
||||||
# Vikunja API token (required for `make create-task` dev workflow)
|
# Vikunja API token (required for `make create-task` dev workflow)
|
||||||
# Generate at: Vikunja → Settings → API Tokens
|
# Generate at: Vikunja → Settings → API Tokens
|
||||||
@@ -60,4 +71,4 @@ DEVX_TASK_PREFIX=GRM
|
|||||||
# Vikunja project ID for GRM
|
# Vikunja project ID for GRM
|
||||||
DEVX_VIKUNJA_PROJECT_ID=6
|
DEVX_VIKUNJA_PROJECT_ID=6
|
||||||
# Version file path (relative to repo root)
|
# Version file path (relative to repo root)
|
||||||
DEVX_VERSION_FILE=src/gitea_runner_manager/__init__.py
|
DEVX_VERSION_FILE=src/grm/__init__.py
|
||||||
|
|||||||
+216
-170
@@ -6,21 +6,38 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
PIP_BREAK_SYSTEM_PACKAGES: "1"
|
||||||
|
PYTHONPATH: src
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
quality:
|
# Single validation job that merges: quality, detect-changes,
|
||||||
|
# release-dry-run, pre-merge-check, pr-review, and discover-runners.
|
||||||
|
# Uses ci-full image (has git-cliff for release-dry-run).
|
||||||
|
# Saves ~5x checkout+setup overhead vs 6 separate jobs.
|
||||||
|
validate:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-quality:latest
|
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 15
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
outputs:
|
||||||
|
ansible-changed: ${{ steps.detect.outputs.ansible-changed }}
|
||||||
|
user-facing-changed: ${{ steps.detect.outputs.user-facing-changed }}
|
||||||
|
runner-count: ${{ steps.discover-runners.outputs.runner-count }}
|
||||||
|
runner-indices: ${{ steps.discover-runners.outputs.runner-indices }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
run: make setup-image EXTRAS=lint
|
run: make setup-image EXTRAS=ci,lint
|
||||||
|
# --- quality steps ---
|
||||||
- name: Lint all
|
- name: Lint all
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
@@ -30,24 +47,20 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
make pytest-cov
|
make pytest-cov
|
||||||
- name: Documentation lint check
|
- name: Documentation gate (coverage + stale refs + lint + version refs + prose)
|
||||||
env:
|
env:
|
||||||
PYTHONPATH: src
|
DEVX_DOC_COVERAGE_STRICT: "1"
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
DEVX_DOC_VERSIONS_PKG: grm
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
DEVX_VALE_LEVEL: warning
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
pip install --upgrade devx \
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
--index-url "https://${CI_GITEA_USERNAME}:${CI_GITEA_TOKEN}@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/" \
|
make devx-docs-check
|
||||||
--no-deps
|
|
||||||
python3 -m devx.ci.lint_docs --root .
|
|
||||||
- name: Translation completeness check
|
- name: Translation completeness check
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.check_translations --translations src/gitea_runner_manager/translations.json
|
python3 -m devx.ci.check_translations --translations src/grm/translations.json
|
||||||
- name: Check unit test speed
|
- name: Check unit test speed
|
||||||
env:
|
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.tools.check_test_speed --max-seconds 4 --max-single-seconds 0.5
|
python3 -m devx.tools.check_test_speed --max-seconds 4 --max-single-seconds 0.5
|
||||||
@@ -68,52 +81,10 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "act_runner not found — skipping workflow dry-run (static lint still passed)"
|
echo "act_runner not found — skipping workflow dry-run (static lint still passed)"
|
||||||
fi
|
fi
|
||||||
|
# --- detect-changes step ---
|
||||||
release-dry-run:
|
|
||||||
needs: [quality, detect-changes]
|
|
||||||
if: needs.detect-changes.outputs.user-facing-changed == 'true'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci,lint
|
|
||||||
- name: Release dry-run validation
|
|
||||||
env:
|
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_VERSION_FILE: src/gitea_runner_manager/__init__.py
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
python3 -m devx.ci.release --dry-run
|
|
||||||
|
|
||||||
detect-changes:
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
outputs:
|
|
||||||
ansible-changed: ${{ steps.detect.outputs.ansible-changed }}
|
|
||||||
user-facing-changed: ${{ steps.detect.outputs.user-facing-changed }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Detect changed paths
|
- name: Detect changed paths
|
||||||
id: detect
|
id: detect
|
||||||
env:
|
env:
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
@@ -121,22 +92,10 @@ jobs:
|
|||||||
--base "origin/master" \
|
--base "origin/master" \
|
||||||
--head "${{ github.event.pull_request.head.sha || github.sha }}" \
|
--head "${{ github.event.pull_request.head.sha || github.sha }}" \
|
||||||
--github-output
|
--github-output
|
||||||
|
# --- validate-pr + pr-review steps (PR only) ---
|
||||||
pre-merge-check:
|
|
||||||
needs: [quality, detect-changes]
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up environment
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Validate auto-merge preconditions
|
- name: Validate auto-merge preconditions
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
DEVX_VIKUNJA_PROJECT_ID: 6
|
DEVX_VIKUNJA_PROJECT_ID: 6
|
||||||
@@ -144,7 +103,6 @@ jobs:
|
|||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||||
REPOSITORY: ${{ github.repository }}
|
REPOSITORY: ${{ github.repository }}
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
PYTHONPATH: ${{ env.PYTHONPATH }}
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.check_auto_merge_ready \
|
python3 -m devx.ci.check_auto_merge_ready \
|
||||||
@@ -152,52 +110,81 @@ jobs:
|
|||||||
--pr-title "$PR_TITLE" \
|
--pr-title "$PR_TITLE" \
|
||||||
--repo "$REPOSITORY" \
|
--repo "$REPOSITORY" \
|
||||||
--pr-number "$PR_NUMBER"
|
--pr-number "$PR_NUMBER"
|
||||||
|
- name: Validate spec file
|
||||||
discover-runners:
|
if: github.event_name == 'pull_request'
|
||||||
needs: [detect-changes]
|
|
||||||
if: needs.detect-changes.outputs.ansible-changed == 'true'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
outputs:
|
|
||||||
runner-count: ${{ steps.discover.outputs.runner-count }}
|
|
||||||
runner-indices: ${{ steps.discover.outputs.runner-indices }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
DEVX_TASK_PREFIX: GRM
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
PYTHONPATH: ${{ env.PYTHONPATH }}
|
||||||
run: make setup-image EXTRAS=ci
|
HEAD_REF: ${{ github.head_ref }}
|
||||||
- name: Discover available runners
|
run: |
|
||||||
id: discover
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
python3 -m devx.ci.validate_spec \
|
||||||
|
--branch "$HEAD_REF" \
|
||||||
|
--github-output
|
||||||
|
- name: Check PR size
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
PYTHONPATH: ${{ env.PYTHONPATH }}
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
python3 -m devx.ci.check_pr_size \
|
||||||
|
--base "origin/master" \
|
||||||
|
--head "${{ github.event.pull_request.head.sha || github.sha }}" \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--pr-number "${{ github.event.number }}" \
|
||||||
|
--github-output
|
||||||
|
# --- release-dry-run step (conditional) ---
|
||||||
|
- name: Release dry-run validation
|
||||||
|
if: steps.detect.outputs.user-facing-changed == 'true'
|
||||||
|
env:
|
||||||
|
DEVX_VERSION_FILE: src/grm/__init__.py
|
||||||
|
DEVX_TASK_PREFIX: GRM
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
python3 -m devx.ci.release --dry-run
|
||||||
|
# --- discover-runners step (conditional on ansible-changed) ---
|
||||||
|
- name: Discover available molecule runners
|
||||||
|
id: discover-runners
|
||||||
|
if: steps.detect.outputs.ansible-changed == 'true'
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
MOLECULE_RUNNERS: ${{ vars.MOLECULE_RUNNERS }}
|
MOLECULE_RUNNERS: ${{ vars.MOLECULE_RUNNERS }}
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.molecule.discover_runners \
|
python3 -m devx.molecule.discover_runners \
|
||||||
--owner "${{ github.repository_owner }}" \
|
--owner "${{ github.repository_owner }}" \
|
||||||
--repo "${{ github.event.repository.name }}" \
|
--repo "${{ github.event.repository.name }}" \
|
||||||
--github-output
|
--github-output
|
||||||
|
- name: Notify on failure
|
||||||
|
if: failure()
|
||||||
|
env:
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
python3 -m devx.ci.notify_failure --auto-login \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--run-id "${{ github.run_id }}" \
|
||||||
|
--workflow "ci/validate" \
|
||||||
|
--commit "${{ github.sha }}"
|
||||||
|
|
||||||
molecule-tests:
|
molecule-tests:
|
||||||
needs: [quality, detect-changes, discover-runners]
|
needs: [validate]
|
||||||
if: needs.detect-changes.outputs.ansible-changed == 'true'
|
if: needs.validate.outputs.ansible-changed == 'true'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 15
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
max-parallel: 3
|
max-parallel: 4
|
||||||
matrix:
|
matrix:
|
||||||
runner-index: [1, 2, 3, 4, 5, 6]
|
runner-index: [1, 2, 3, 4]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
run: make setup-image EXTRAS=ci,molecule
|
run: make setup-image EXTRAS=ci,molecule
|
||||||
- name: Install Ansible collections
|
- name: Install Ansible collections
|
||||||
@@ -207,16 +194,34 @@ jobs:
|
|||||||
- name: Discover assigned test pairs
|
- name: Discover assigned test pairs
|
||||||
env:
|
env:
|
||||||
RUNNER_INDEX: ${{ matrix.runner-index }}
|
RUNNER_INDEX: ${{ matrix.runner-index }}
|
||||||
MAX_RUNNERS: ${{ needs.discover-runners.outputs.runner-count }}
|
MAX_RUNNERS: 4
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.molecule.distribute_molecule \
|
python3 -m devx.molecule.distribute_molecule \
|
||||||
--runner-index "$RUNNER_INDEX" \
|
--runner-index "$RUNNER_INDEX" \
|
||||||
--max-runners "$MAX_RUNNERS" \
|
--max-runners "$MAX_RUNNERS" \
|
||||||
--github-env --skip-if-excess
|
--github-env
|
||||||
- name: Run molecule tests
|
- name: Prune stale Docker data
|
||||||
|
id: prune
|
||||||
if: env.SKIP != 'true'
|
if: env.SKIP != 'true'
|
||||||
|
run: |
|
||||||
|
docker system prune -af --volumes 2>/dev/null || true
|
||||||
|
disk_pct=$(df -P / | awk 'NR==2 {gsub(/%/, "", $5); print $5}')
|
||||||
|
echo "Disk usage after prune: ${disk_pct}%"
|
||||||
|
if [ "$disk_pct" -ge 85 ]; then
|
||||||
|
echo "should-run=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::warning::Disk usage at ${disk_pct}% after prune — skipping molecule tests to avoid ENOSPC failures"
|
||||||
|
else
|
||||||
|
echo "should-run=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
- name: Run molecule tests
|
||||||
|
if: env.SKIP != 'true' && steps.prune.outputs.should-run != 'false'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
|
ANSIBLE_INJECT_INVOCATION: "1"
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
if [ -z "$TEST_PAIRS" ]; then exit 0; fi
|
if [ -z "$TEST_PAIRS" ]; then exit 0; fi
|
||||||
@@ -224,61 +229,58 @@ jobs:
|
|||||||
echo "Docker not available in CI container — skipping molecule tests"
|
echo "Docker not available in CI container — skipping molecule tests"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "$CI_GITEA_TOKEN" | docker login git.oblachno.oblachno.fyi -u "$CI_GITEA_USERNAME" --password-stdin
|
_TOKEN="$CI_GITEA_API_TOKEN"; [ -z "$_TOKEN" ] && _TOKEN="$CI_GITEA_TOKEN"
|
||||||
# shellcheck disable=SC2086 # intentional word splitting for argument expansion
|
[ -z "$_TOKEN" ] && { echo "Gitea API token not set — skipping Docker login"; exit 0; }
|
||||||
python3 -m devx.molecule.molecule_ci_guard $TEST_PAIRS
|
echo "$_TOKEN" | docker login git.oblachno.oblachno.fyi -u "$CI_GITEA_USERNAME" --password-stdin
|
||||||
env:
|
# Run each molecule test pair sequentially.
|
||||||
GITEA_URL: ${{ github.server_url }}
|
# Pairs are 4-part: scenario|platform_name|platform_image|platform_command
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
# Spaces in platform_command are encoded as __SPACE__.
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
role_dir="ansible/roles/gitea_runner"
|
||||||
RUN_ID: ${{ github.run_id }}
|
# shellcheck disable=SC2086 # intentional word splitting for pair list
|
||||||
ANSIBLE_INJECT_INVOCATION: "1"
|
for pair in $TEST_PAIRS; do
|
||||||
JOB_NAME: ${{ github.job }}
|
IFS='|' read -r scenario platform_name platform_image platform_command <<< "$pair"
|
||||||
MATRIX_INDEX: ${{ matrix.runner-index }}
|
platform_command="${platform_command//__SPACE__/ }"
|
||||||
GITEA_REPOSITORY: ${{ github.repository }}
|
export MOLECULE_PLATFORM_NAME="$platform_name"
|
||||||
PYTHONPATH: src
|
export MOLECULE_PLATFORM_IMAGE="$platform_image"
|
||||||
DOCKER_HOST: unix:///var/run/docker.sock
|
if [ -n "$platform_command" ]; then
|
||||||
|
export MOLECULE_PLATFORM_COMMAND="$platform_command"
|
||||||
pr-review:
|
else
|
||||||
if: github.event_name == 'pull_request'
|
unset MOLECULE_PLATFORM_COMMAND
|
||||||
runs-on: docker
|
fi
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
export ANSIBLE_ALLOW_BROKEN_CONDITIONALS=true
|
||||||
timeout-minutes: 10
|
echo "--- Running: $scenario on $platform_name ---"
|
||||||
defaults:
|
pushd "$role_dir" >/dev/null
|
||||||
run:
|
if [ "$scenario" = "default" ]; then
|
||||||
shell: bash
|
molecule test || {
|
||||||
steps:
|
echo "FAILED: $pair — running molecule destroy"
|
||||||
- uses: actions/checkout@v4
|
molecule destroy 2>/dev/null || true
|
||||||
- name: Set up environment
|
popd >/dev/null
|
||||||
env:
|
exit 1
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
else
|
||||||
run: make setup-image EXTRAS=ci
|
molecule test -s "$scenario" || {
|
||||||
- name: Run automated PR review
|
echo "FAILED: $pair — running molecule destroy"
|
||||||
env:
|
molecule destroy -s "$scenario" 2>/dev/null || true
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
popd >/dev/null
|
||||||
PYTHONPATH: src
|
exit 1
|
||||||
run: |
|
}
|
||||||
set -euo pipefail
|
fi
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
popd >/dev/null
|
||||||
python3 -m devx.ci.pr_review \
|
echo "PASSED: $pair"
|
||||||
"${{ github.event.number }}" \
|
docker system prune -af --volumes 2>/dev/null || true
|
||||||
"${{ github.repository }}"
|
done
|
||||||
|
echo "All molecule tests passed."
|
||||||
|
|
||||||
auto-merge:
|
auto-merge:
|
||||||
# Auto-merge runs after all CI checks pass. It reads the task ID
|
# Auto-merge runs after validate passes. molecule-tests is NOT in needs
|
||||||
# from the branch name, validates the PR title, and squash-merges.
|
# because Gitea Actions skips dependent jobs of skipped jobs without
|
||||||
# Uses always() so it evaluates even when molecule-tests is skipped
|
# evaluating if: conditions — having molecule-tests in needs would
|
||||||
# (Gitea Actions skips dependent jobs of skipped jobs by default).
|
# cascade the skip to auto-merge when ansible-changed=false.
|
||||||
needs: [quality, detect-changes, pre-merge-check, pr-review, molecule-tests, release-dry-run]
|
needs: [validate]
|
||||||
if: >-
|
if: >-
|
||||||
always() &&
|
always() &&
|
||||||
github.event_name == 'pull_request' &&
|
github.event_name == 'pull_request' &&
|
||||||
needs.quality.result == 'success' &&
|
needs.validate.result == 'success'
|
||||||
needs.pre-merge-check.result == 'success' &&
|
|
||||||
needs.pr-review.result == 'success' &&
|
|
||||||
(needs.molecule-tests.result == 'success' || needs.molecule-tests.result == 'skipped') &&
|
|
||||||
(needs.release-dry-run.result == 'success' || needs.release-dry-run.result == 'skipped')
|
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -289,32 +291,76 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.CI_GITEA_TOKEN }}
|
token: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
run: make setup-image EXTRAS=ci
|
run: make setup-image EXTRAS=ci
|
||||||
- name: Post approval review
|
- name: Post approval review
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.REVIEW_GITEA_TOKEN }}
|
DEVELOPER_GITEA_API_TOKEN: ${{ secrets.DEVELOPER_GITEA_API_TOKEN }}
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
REPOSITORY: ${{ github.repository }}
|
GITHUB_SERVER_URL: ${{ github.server_url }}
|
||||||
PYTHONPATH: src
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.pr_review \
|
# Post APPROVE review via Gitea API to satisfy branch protection
|
||||||
"$PR_NUMBER" \
|
# Uses DEVELOPER_GITEA_API_TOKEN (kireto) — a different user than
|
||||||
"$REPOSITORY" \
|
# the PR creator — so Gitea counts the approval (no self-approvals).
|
||||||
--event APPROVE \
|
curl -s -X POST \
|
||||||
--checklist-confirmed \
|
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/reviews" \
|
||||||
--checklist-categories 1,2,3,4,5,6,7,8,9,10,11,12,13 \
|
-H "Authorization: token ${DEVELOPER_GITEA_API_TOKEN}" \
|
||||||
--body "Auto-approved: all CI checks passed (quality, molecule, pr-review, pre-merge-check)."
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"event":"APPROVED","body":"Auto-approved: all CI checks passed (validate, molecule-tests)."}' \
|
||||||
|
|| echo "::warning::Failed to post approval review (best-effort)."
|
||||||
|
- name: Wait for molecule tests to complete
|
||||||
|
env:
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
|
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
# Poll commit status until all required checks pass or fail
|
||||||
|
MAX_WAIT=600 # 10 minutes
|
||||||
|
ELAPSED=0
|
||||||
|
while [ $ELAPSED -lt $MAX_WAIT ]; do
|
||||||
|
STATUS=$(curl -s -H "Authorization: token $CI_GITEA_API_TOKEN" \
|
||||||
|
"https://git.oblachno.oblachno.fyi/api/v1/repos/${{ github.repository }}/commits/$HEAD_SHA/status" \
|
||||||
|
| python3 -c "
|
||||||
|
import sys,json
|
||||||
|
d=json.load(sys.stdin)
|
||||||
|
statuses={s['context']:s['status'] for s in d.get('statuses',[])}
|
||||||
|
# Check if all molecule-tests contexts are terminal (success/failure/skipped)
|
||||||
|
mol_contexts=[k for k in statuses if 'molecule-tests' in k]
|
||||||
|
if not mol_contexts:
|
||||||
|
print('skipped')
|
||||||
|
elif all(statuses[k] in ('success','failure','skipped') for k in mol_contexts):
|
||||||
|
if any(statuses[k]=='failure' for k in mol_contexts):
|
||||||
|
print('failure')
|
||||||
|
else:
|
||||||
|
print('success')
|
||||||
|
else:
|
||||||
|
print('pending')
|
||||||
|
")
|
||||||
|
echo "Molecule tests status: $STATUS (elapsed: ${ELAPSED}s)"
|
||||||
|
if [ "$STATUS" = "success" ] || [ "$STATUS" = "skipped" ]; then
|
||||||
|
echo "All molecule tests passed (or skipped — no ansible changes)."
|
||||||
|
break
|
||||||
|
elif [ "$STATUS" = "failure" ]; then
|
||||||
|
echo "ERROR: Molecule tests failed. Aborting auto-merge."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 30
|
||||||
|
ELAPSED=$((ELAPSED + 30))
|
||||||
|
done
|
||||||
|
if [ $ELAPSED -ge $MAX_WAIT ]; then
|
||||||
|
echo "ERROR: Timed out waiting for molecule tests."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Squash merge with task ID
|
- name: Squash merge with task ID
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
DEVX_VIKUNJA_PROJECT_ID: 6
|
DEVX_VIKUNJA_PROJECT_ID: 6
|
||||||
HEAD_REF: ${{ github.head_ref }}
|
HEAD_REF: ${{ github.head_ref }}
|
||||||
|
|||||||
+111
-220
@@ -1,320 +1,211 @@
|
|||||||
name: Post-merge
|
name: Post-merge
|
||||||
|
|
||||||
# Runs on every push to master. A single workflow with conditional jobs
|
# Runs on every push to master (after CI workflow merges a PR).
|
||||||
# for release, publish, wiki sync, badges, and Vikunja task updates.
|
# Consolidated into 2 jobs (from 7) to reduce runner overhead:
|
||||||
|
# detect-and-configure ──→ release-and-maintain
|
||||||
#
|
#
|
||||||
# Job dependency graph:
|
# Job 1: detect release commit, validate commit msg, configure repo
|
||||||
|
# (branch protection, labels).
|
||||||
|
# Job 2: release + publish + sync-wiki + vikunja + badges.
|
||||||
|
# Individual steps are conditional on job 1 outputs.
|
||||||
#
|
#
|
||||||
# detect-type ──┬── validate-commit-msg (skip if release commit)
|
# The badges step always runs (even on release commits) so version
|
||||||
# ├── release (skip if release commit)
|
# badge picks up the new __version__. It runs last so it sees the
|
||||||
# │ └── publish (needs release — builds & publishes to PyPI)
|
# new version if release created one.
|
||||||
# ├── badges (ALWAYS runs — even on release commits)
|
|
||||||
# ├── configure-repo (independent — skip if release commit)
|
|
||||||
# ├── sync-wiki (skip if release commit — runs for ALL merges)
|
|
||||||
# └── vikunja (skip if release commit — runs for ALL merges)
|
|
||||||
#
|
|
||||||
# sync-wiki and vikunja run for ALL non-release commits, not just when
|
|
||||||
# release succeeds. This ensures the wiki and task tracker are updated
|
|
||||||
# even for infrastructure-only changes (docs, CI config, etc.).
|
|
||||||
#
|
|
||||||
# The badges job uses `if: always()` with no is-release condition so it
|
|
||||||
# runs on every push to master, including release commits. This ensures
|
|
||||||
# badges (tests, coverage, version, etc.) are always current.
|
|
||||||
#
|
#
|
||||||
# When release creates a "release: vX.Y.Z" commit and tag, the publish
|
# When release creates a "release: vX.Y.Z" commit and tag, the publish
|
||||||
# job (which depends on release) builds and publishes the package to the
|
# step builds and publishes the package to the Gitea PyPI registry.
|
||||||
# Gitea PyPI registry. The release commit's post-merge run still updates
|
# The release commit's post-merge run still updates badges. Other
|
||||||
# badges (version badge picks up the new version). Other jobs skip.
|
# steps (sync-wiki, vikunja) skip on release commits.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: post-merge-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
PIP_BREAK_SYSTEM_PACKAGES: "1"
|
||||||
|
PYTHONPATH: src
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
detect-type:
|
detect-and-configure:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
outputs:
|
outputs:
|
||||||
is-release: ${{ steps.check.outputs.is-release }}
|
is-release: ${{ steps.check.outputs.is-release }}
|
||||||
|
is-automated: ${{ steps.check.outputs.is-automated }}
|
||||||
|
user-facing-changed: ${{ steps.detect.outputs.user-facing-changed }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 0
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
run: make setup-image EXTRAS=ci
|
run: make setup-image EXTRAS=ci
|
||||||
|
- name: Ensure branch protection and labels
|
||||||
|
env:
|
||||||
|
DEVX_REPO_NAME: grm
|
||||||
|
DEVX_REPO_OWNER: oblachno-oss
|
||||||
|
DEVX_STATUS_CHECKS: "CI / validate (pull_request),CI / molecule-tests (1) (pull_request),CI / molecule-tests (2) (pull_request),CI / molecule-tests (3) (pull_request)"
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
python3 -m devx.tools.configure_repo
|
||||||
- name: Check if this is a release commit
|
- name: Check if this is a release commit
|
||||||
id: check
|
id: check
|
||||||
env:
|
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.detect_release_commit
|
python3 -m devx.ci.detect_release_commit
|
||||||
|
|
||||||
validate-commit-msg:
|
|
||||||
needs: [detect-type]
|
|
||||||
if: needs.detect-type.outputs.is-release == 'false'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Validate latest commit message
|
- name: Validate latest commit message
|
||||||
|
if: steps.check.outputs.is-automated == 'false'
|
||||||
env:
|
env:
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
git log -1 --format=%B > commit-msg.txt
|
git log -1 --format=%B > commit-msg.txt
|
||||||
python3 -m devx.ci.validate_commit_msg commit-msg.txt --branch master
|
python3 -m devx.ci.validate_commit_msg commit-msg.txt --branch master
|
||||||
rm -f commit-msg.txt
|
rm -f commit-msg.txt
|
||||||
|
- name: Detect changed paths
|
||||||
|
id: detect
|
||||||
|
if: steps.check.outputs.is-release == 'false'
|
||||||
|
env:
|
||||||
|
DEVX_TASK_PREFIX: GRM
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
python3 -m devx.ci.classify_changes \
|
||||||
|
--base "HEAD~1" \
|
||||||
|
--head "HEAD" \
|
||||||
|
--github-output
|
||||||
|
- name: Notify on failure
|
||||||
|
if: failure()
|
||||||
|
env:
|
||||||
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
python3 -m devx.ci.notify_failure --auto-login \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--run-id "${{ github.run_id }}" \
|
||||||
|
--workflow "post-merge/detect-and-configure" \
|
||||||
|
--commit "${{ github.sha }}"
|
||||||
|
|
||||||
release:
|
release-and-maintain:
|
||||||
needs: [detect-type]
|
needs: [detect-and-configure]
|
||||||
if: needs.detect-type.outputs.is-release == 'false'
|
if: always() && needs.detect-and-configure.result == 'success'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
outputs:
|
outputs:
|
||||||
tag: ${{ steps.release-tag.outputs.tag }}
|
tag: ${{ steps.release-tag.outputs.tag }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.CI_GITEA_TOKEN }}
|
ref: master
|
||||||
|
token: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
||||||
run: make setup-image EXTRAS=ci,lint
|
run: make setup-image EXTRAS=ci,lint
|
||||||
- name: Configure git
|
- name: Configure git
|
||||||
run: |
|
run: |
|
||||||
git config user.name "grm-ci-bot"
|
git config user.name "grm-ci-bot"
|
||||||
git config user.email "grm-ci-bot@oblachno.fyi"
|
git config user.email "grm-ci-bot@oblachno.fyi"
|
||||||
|
# --- release + publish (only if not a release commit) ---
|
||||||
- name: Run release
|
- name: Run release
|
||||||
id: release-tag
|
id: release-tag
|
||||||
|
if: needs.detect-and-configure.outputs.is-release == 'false' && needs.detect-and-configure.outputs.user-facing-changed == 'true'
|
||||||
env:
|
env:
|
||||||
PYTHONPATH: src
|
DEVX_VERSION_FILE: src/grm/__init__.py
|
||||||
DEVX_VERSION_FILE: src/gitea_runner_manager/__init__.py
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
DEVX_VIKUNJA_PROJECT_ID: 6
|
DEVX_VIKUNJA_PROJECT_ID: 6
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
python3 -m devx.ci.release
|
python3 -m devx.ci.release
|
||||||
- name: Notify on failure
|
|
||||||
if: failure()
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--run-id "${{ github.run_id }}" \
|
|
||||||
--workflow "post-merge/release" \
|
|
||||||
--commit "${{ github.sha }}"
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: [release]
|
|
||||||
if: needs.release.outputs.tag != ''
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-full:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ needs.release.outputs.tag }}
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci,lint
|
|
||||||
- name: Build and publish release
|
- name: Build and publish release
|
||||||
|
if: steps.release-tag.outputs.tag != ''
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
python3 -m devx.ci.publish \
|
git fetch --tags
|
||||||
"${{ needs.release.outputs.tag }}" \
|
git checkout "${{ steps.release-tag.outputs.tag }}"
|
||||||
"${{ github.repository }}" --auto-login
|
python3 -m devx.ci.publish "${{ steps.release-tag.outputs.tag }}" "${{ github.repository }}" --auto-login
|
||||||
- name: Notify on failure
|
- name: Create infra dependency PR
|
||||||
if: failure()
|
if: steps.release-tag.outputs.tag != ''
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
PYTHONPATH: src
|
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
||||||
|
PYTHONPATH: ${{ env.PYTHONPATH }}
|
||||||
|
DEVX_TASK_PREFIX: GRM
|
||||||
|
DEVX_VIKUNJA_PROJECT_ID: 6
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
# Extract version from the tag (strip leading 'v')
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
TAG="${{ steps.release-tag.outputs.tag }}"
|
||||||
--repo "${{ github.repository }}" \
|
VERSION="${TAG#v}"
|
||||||
--run-id "${{ github.run_id }}" \
|
python3 -m devx.ci.create_dependency_pr \
|
||||||
--workflow "post-merge/publish" \
|
--repo oblachno/infra \
|
||||||
--commit "${{ github.sha }}"
|
--package grm \
|
||||||
|
--new-version "$VERSION" \
|
||||||
sync-wiki:
|
--source-repo "${{ github.repository }}" \
|
||||||
needs: [detect-type]
|
--source-run-id "${{ github.run_id }}" || \
|
||||||
if: needs.detect-type.outputs.is-release == 'false'
|
echo "::warning::Failed to create infra dependency PR (best-effort)."
|
||||||
runs-on: docker
|
# --- sync-wiki + vikunja (skip on automated/release commits) ---
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Sync documentation to wiki
|
- name: Sync documentation to wiki
|
||||||
|
if: needs.detect-and-configure.outputs.is-automated == 'false'
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.sync_wiki --repo "${{ github.repository }}" --strict
|
python3 -m devx.ci.sync_wiki --repo "${{ github.repository }}" --verify
|
||||||
- name: Notify on failure
|
|
||||||
if: failure()
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--run-id "${{ github.run_id }}" \
|
|
||||||
--workflow "post-merge/sync-wiki" \
|
|
||||||
--commit "${{ github.sha }}"
|
|
||||||
|
|
||||||
badges:
|
|
||||||
needs: [detect-type]
|
|
||||||
if: always()
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-quality:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: master
|
|
||||||
token: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
- name: Fetch latest master
|
|
||||||
run: |
|
|
||||||
git fetch origin master
|
|
||||||
git reset --hard origin/master
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=lint
|
|
||||||
- name: Generate and push badges
|
|
||||||
env:
|
|
||||||
PRE_COMMIT_ALLOW_NO_CONFIG: "1"
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
|
||||||
python3 -m devx.ci.push_badges
|
|
||||||
- name: Notify on failure
|
|
||||||
if: failure()
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--run-id "${{ github.run_id }}" \
|
|
||||||
--workflow "post-merge/badges" \
|
|
||||||
--commit "${{ github.sha }}"
|
|
||||||
|
|
||||||
vikunja:
|
|
||||||
needs: [detect-type]
|
|
||||||
if: needs.detect-type.outputs.is-release == 'false'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Update Vikunja task
|
- name: Update Vikunja task
|
||||||
|
if: needs.detect-and-configure.outputs.is-automated == 'false'
|
||||||
env:
|
env:
|
||||||
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_TASK_PREFIX: GRM
|
DEVX_TASK_PREFIX: GRM
|
||||||
DEVX_VIKUNJA_PROJECT_ID: 6
|
DEVX_VIKUNJA_PROJECT_ID: 6
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.ci.post_merge --git-sha "${{ github.sha }}"
|
python3 -m devx.ci.post_merge --git-sha "${{ github.sha }}"
|
||||||
- name: Notify on failure
|
# --- badges (always run — even on release commits) ---
|
||||||
if: failure()
|
- name: Generate and push badges
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
PYTHONPATH: src
|
PRE_COMMIT_ALLOW_NO_CONFIG: "1"
|
||||||
run: |
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--run-id "${{ github.run_id }}" \
|
|
||||||
--workflow "post-merge/vikunja" \
|
|
||||||
--commit "${{ github.sha }}"
|
|
||||||
|
|
||||||
configure-repo:
|
|
||||||
needs: [detect-type]
|
|
||||||
if: needs.detect-type.outputs.is-release == 'false'
|
|
||||||
runs-on: docker
|
|
||||||
container: git.oblachno.oblachno.fyi/oblachno-oss/runner-images/ci-base:latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up environment
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
CI_GITEA_USERNAME: ${{ vars.CI_GITEA_USERNAME }}
|
|
||||||
run: make setup-image EXTRAS=ci
|
|
||||||
- name: Ensure branch protection and labels
|
|
||||||
env:
|
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
|
||||||
PYTHONPATH: src
|
|
||||||
DEVX_REPO_NAME: grm
|
|
||||||
DEVX_REPO_OWNER: oblachno-oss
|
|
||||||
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: |
|
run: |
|
||||||
. .venv/bin/activate 2>/dev/null || true
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
python3 -m devx.tools.configure_repo
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
# Fetch latest master to pick up any release commit that was pushed
|
||||||
|
git fetch origin master
|
||||||
|
git reset --hard origin/master
|
||||||
|
python3 -m devx.ci.push_badges
|
||||||
- name: Notify on failure
|
- name: Notify on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
env:
|
env:
|
||||||
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }}
|
||||||
PYTHONPATH: src
|
|
||||||
run: |
|
run: |
|
||||||
|
. .venv/bin/activate 2>/dev/null || true
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
python3 -m devx.ci.notify_failure --auto-login \
|
python3 -m devx.ci.notify_failure --auto-login \
|
||||||
--repo "${{ github.repository }}" \
|
--repo "${{ github.repository }}" \
|
||||||
--run-id "${{ github.run_id }}" \
|
--run-id "${{ github.run_id }}" \
|
||||||
--workflow "post-merge/configure-repo" \
|
--workflow "post-merge/release-and-maintain" \
|
||||||
--commit "${{ github.sha }}"
|
--commit "${{ github.sha }}"
|
||||||
|
|||||||
@@ -57,6 +57,38 @@ repos:
|
|||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-commit]
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: checkmake
|
||||||
|
name: checkmake Makefile linter
|
||||||
|
entry: make checkmake
|
||||||
|
language: system
|
||||||
|
files: ^Makefile$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-test-speed
|
||||||
|
name: unit test speed check
|
||||||
|
entry: .venv/bin/python -m devx.tools.check_test_speed --max-seconds 4 --max-single-seconds 0.5
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-translations
|
||||||
|
name: translation completeness check
|
||||||
|
entry: env PYTHONPATH=src .venv/bin/python -m devx.ci.check_translations --translations src/grm/translations.json
|
||||||
|
language: system
|
||||||
|
files: ^src/grm/translations\.json$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: docs-check
|
||||||
|
name: documentation gate (coverage + stale refs + lint + version refs + prose)
|
||||||
|
entry: bash -c 'PYTHONPATH=src DEVX_DOC_COVERAGE_STRICT=1 DEVX_DOC_VERSIONS_PKG=grm DEVX_VALE_LEVEL=warning make devx-docs-check'
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
- id: pytest-cov
|
- id: pytest-cov
|
||||||
name: pytest with 100% coverage
|
name: pytest with 100% coverage
|
||||||
entry: make pytest-cov
|
entry: make pytest-cov
|
||||||
@@ -64,3 +96,43 @@ repos:
|
|||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-push]
|
stages: [pre-push]
|
||||||
|
|
||||||
|
- id: check-ansible-no-log
|
||||||
|
name: ansible no_log on secret tasks
|
||||||
|
entry: make check-ansible-no-log
|
||||||
|
language: system
|
||||||
|
files: ^ansible/.*\.(yml|yaml)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-ansible-no-state-absent-on-db
|
||||||
|
name: no state absent on DB paths
|
||||||
|
entry: make check-ansible-no-state-absent-on-db
|
||||||
|
language: system
|
||||||
|
files: ^ansible/.*\.(yml|yaml)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-ansible-patterns
|
||||||
|
name: ansible failure-masking patterns
|
||||||
|
entry: make check-ansible-patterns
|
||||||
|
language: system
|
||||||
|
files: ^ansible/.*\.(yml|yaml)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-jinja-expr
|
||||||
|
name: jinja2 expression validation
|
||||||
|
entry: make check-jinja-expr
|
||||||
|
language: system
|
||||||
|
files: ^ansible/.*\.(yml|yaml|j2)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|
||||||
|
- id: check-ansible-set-fact-to-json
|
||||||
|
name: set_fact to_json misuse check
|
||||||
|
entry: make check-ansible-set-fact-to-json
|
||||||
|
language: system
|
||||||
|
files: ^ansible/.*\.(yml|yaml)$
|
||||||
|
pass_filenames: false
|
||||||
|
stages: [pre-commit]
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# Vale configuration for grm documentation
|
||||||
|
# https://vale.sh/docs/
|
||||||
|
|
||||||
|
StylesPath = .vale/styles
|
||||||
|
|
||||||
|
# Packages are downloaded via `vale sync`
|
||||||
|
Packages = write-good, Google, Readability
|
||||||
|
|
||||||
|
# Minimum alert level to display (suggestion, warning, error)
|
||||||
|
MinAlertLevel = warning
|
||||||
|
|
||||||
|
# Project vocabulary — terms not flagged as spelling errors
|
||||||
|
Vocab = grm
|
||||||
|
|
||||||
|
[*.{md}]
|
||||||
|
# Enable style guides
|
||||||
|
BasedOnStyles = Vale, write-good, Google, Readability, devx
|
||||||
|
|
||||||
|
# Google style — relax rules too strict for technical docs
|
||||||
|
Google.Contractions = NO
|
||||||
|
Google.WordList = NO
|
||||||
|
Google.Acronyms = NO
|
||||||
|
Google.We = NO
|
||||||
|
Google.Will = NO
|
||||||
|
Google.Colons = NO
|
||||||
|
Google.Headings = NO
|
||||||
|
Google.EmDash = NO
|
||||||
|
Google.Units = NO
|
||||||
|
Google.Latin = NO
|
||||||
|
Google.OptionalPlurals = NO
|
||||||
|
|
||||||
|
# write-good — relax rules too strict for technical writing
|
||||||
|
write-good.E-Prime = NO
|
||||||
|
write-good.So = NO
|
||||||
|
write-good.ThereIs = NO
|
||||||
|
write-good.TooWordy = NO
|
||||||
|
write-good.Passive = NO
|
||||||
|
|
||||||
|
# Vale defaults — spelling catches too many technical terms
|
||||||
|
Vale.Terms = NO
|
||||||
|
Vale.Repetition = NO
|
||||||
|
Vale.Spelling = NO
|
||||||
|
|
||||||
|
# Readability — technical docs are naturally complex, downgrade to suggestions
|
||||||
|
Readability.FleschReadingEase = suggestion
|
||||||
|
Readability.FleschKincaid = suggestion
|
||||||
|
Readability.AutomatedReadability = suggestion
|
||||||
|
Readability.ColemanLiau = suggestion
|
||||||
|
Readability.LIX = suggestion
|
||||||
|
Readability.GunningFog = suggestion
|
||||||
|
Readability.SMOG = suggestion
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Use 'AM' or 'PM' (preceded by a space)."
|
||||||
|
link: "https://developers.google.com/style/word-list"
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- '\d{1,2}[AP]M\b'
|
||||||
|
- '\d{1,2} ?[ap]m\b'
|
||||||
|
- '\d{1,2} ?[aApP]\.[mM]\.'
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
extends: conditional
|
||||||
|
message: "Spell out '%s', if it's unfamiliar to the audience."
|
||||||
|
link: 'https://developers.google.com/style/abbreviations'
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: false
|
||||||
|
# Ensures that the existence of 'first' implies the existence of 'second'.
|
||||||
|
first: '\b([A-Z]{3,5})\b'
|
||||||
|
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
|
||||||
|
# ... with the exception of these:
|
||||||
|
exceptions:
|
||||||
|
- API
|
||||||
|
- ASP
|
||||||
|
- CLI
|
||||||
|
- CPU
|
||||||
|
- CSS
|
||||||
|
- CSV
|
||||||
|
- DEBUG
|
||||||
|
- DOM
|
||||||
|
- DPI
|
||||||
|
- FAQ
|
||||||
|
- GCC
|
||||||
|
- GDB
|
||||||
|
- GET
|
||||||
|
- GPU
|
||||||
|
- GTK
|
||||||
|
- GUI
|
||||||
|
- HTML
|
||||||
|
- HTTP
|
||||||
|
- HTTPS
|
||||||
|
- IDE
|
||||||
|
- JAR
|
||||||
|
- JSON
|
||||||
|
- JSX
|
||||||
|
- LESS
|
||||||
|
- LLDB
|
||||||
|
- NET
|
||||||
|
- NOTE
|
||||||
|
- NVDA
|
||||||
|
- OSS
|
||||||
|
- PATH
|
||||||
|
- PDF
|
||||||
|
- PHP
|
||||||
|
- POST
|
||||||
|
- RAM
|
||||||
|
- REPL
|
||||||
|
- RSA
|
||||||
|
- SCM
|
||||||
|
- SCSS
|
||||||
|
- SDK
|
||||||
|
- SQL
|
||||||
|
- SSH
|
||||||
|
- SSL
|
||||||
|
- SVG
|
||||||
|
- TBD
|
||||||
|
- TCP
|
||||||
|
- TODO
|
||||||
|
- URI
|
||||||
|
- URL
|
||||||
|
- USB
|
||||||
|
- UTF
|
||||||
|
- XML
|
||||||
|
- XSS
|
||||||
|
- YAML
|
||||||
|
- ZIP
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't attribute human qualities to software or hardware ('%s')."
|
||||||
|
link: https://developers.google.com/style/anthropomorphism
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: true
|
||||||
|
# Limited to the two verbs the guide itself names. Broader lists (wants, knows,
|
||||||
|
# thinks) can't tell a software subject from a human one: on a 950-file corpus
|
||||||
|
# they produced 8 false positives ('the customer wants', 'your audience knows')
|
||||||
|
# for every 2 real ones.
|
||||||
|
tokens:
|
||||||
|
- sees
|
||||||
|
- tells
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' should be in lowercase."
|
||||||
|
link: 'https://developers.google.com/style/colons'
|
||||||
|
level: warning
|
||||||
|
scope: sentence
|
||||||
|
# The match is the word itself, not ': X', and `nonword` is off. Both are
|
||||||
|
# required for a project Vocab to work: Vale compares accept.txt entries
|
||||||
|
# against the matched text, and `nonword: true` opts out of that entirely.
|
||||||
|
# So a proper noun after a colon can be exempted by adding it to accept.txt.
|
||||||
|
# The guide's other exemption, notice labels, is handled by the lookbehinds;
|
||||||
|
# headings are already excluded by `scope: sentence`. See issue #20.
|
||||||
|
tokens:
|
||||||
|
- '(?<!Note: )(?<!Caution: )(?<!Warning: )(?<!Success: )(?<=:\s)[A-Z]\w+'
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Use '%s' instead of '%s'."
|
||||||
|
link: 'https://developers.google.com/style/contractions'
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: true
|
||||||
|
action:
|
||||||
|
name: replace
|
||||||
|
swap:
|
||||||
|
are not: aren't
|
||||||
|
cannot: can't
|
||||||
|
could not: couldn't
|
||||||
|
did not: didn't
|
||||||
|
do not: don't
|
||||||
|
does not: doesn't
|
||||||
|
has not: hasn't
|
||||||
|
have not: haven't
|
||||||
|
how is: how's
|
||||||
|
is not: isn't
|
||||||
|
it is: it's
|
||||||
|
should not: shouldn't
|
||||||
|
that is: that's
|
||||||
|
they are: they're
|
||||||
|
was not: wasn't
|
||||||
|
we are: we're
|
||||||
|
we have: we've
|
||||||
|
were not: weren't
|
||||||
|
what is: what's
|
||||||
|
when is: when's
|
||||||
|
where is: where's
|
||||||
|
will not: won't
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Use 'July 31, 2016' format, not '%s'."
|
||||||
|
link: 'https://developers.google.com/style/dates-times'
|
||||||
|
ignorecase: true
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
|
||||||
|
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?) \d{4}'
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "In general, don't use an ellipsis."
|
||||||
|
link: 'https://developers.google.com/style/ellipses'
|
||||||
|
nonword: true
|
||||||
|
level: warning
|
||||||
|
action:
|
||||||
|
name: remove
|
||||||
|
tokens:
|
||||||
|
- '\.\.\.'
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't put a space before or after a dash."
|
||||||
|
link: "https://developers.google.com/style/dashes"
|
||||||
|
nonword: true
|
||||||
|
level: error
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- trim
|
||||||
|
- " "
|
||||||
|
tokens:
|
||||||
|
- '\s[—–]\s'
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid the unverifiable claim '%s'."
|
||||||
|
link: https://developers.google.com/style/excessive-claims
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: true
|
||||||
|
# The guide also names 'never', 'always', and 'ensure', but in technical writing
|
||||||
|
# those are usually legitimate instructions ('never commit secrets') rather than
|
||||||
|
# product claims: they accounted for 125 of 142 hits on a 950-file corpus.
|
||||||
|
# 'best practices' is a fixed term, not a superlative.
|
||||||
|
tokens:
|
||||||
|
- 'best(?! practices?)'
|
||||||
|
- simplest
|
||||||
|
- fastest
|
||||||
|
- guarantees?
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't use exclamation points in text."
|
||||||
|
link: "https://developers.google.com/style/exclamation-points"
|
||||||
|
nonword: true
|
||||||
|
level: error
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- trim_right
|
||||||
|
- "!"
|
||||||
|
tokens:
|
||||||
|
- '\w+!(?:\s|$)'
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid first-person pronouns such as '%s'."
|
||||||
|
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
# The 'I' tokens use lookaround rather than consuming the surrounding
|
||||||
|
# whitespace. Matching ' I ' made the alert span cover both spaces, which shows
|
||||||
|
# up as a too-wide underline in editors, and read as "such as ' I '". Dropping
|
||||||
|
# `nonword` also lets a project Vocab apply, which it can't when set. See PR #50.
|
||||||
|
tokens:
|
||||||
|
- '(?<=^|\s)I(?=[\s,])'
|
||||||
|
- "\\bI'm\\b"
|
||||||
|
- \bme\b
|
||||||
|
- \bmy\b
|
||||||
|
- \bmine\b
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't use '%s' as a gender-neutral pronoun."
|
||||||
|
link: 'https://developers.google.com/style/pronouns#gender-neutral-pronouns'
|
||||||
|
level: error
|
||||||
|
ignorecase: true
|
||||||
|
tokens:
|
||||||
|
- he/she
|
||||||
|
- s/he
|
||||||
|
- \(s\)he
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Consider using '%s' instead of '%s'."
|
||||||
|
ignorecase: true
|
||||||
|
link: "https://developers.google.com/style/inclusive-documentation"
|
||||||
|
level: error
|
||||||
|
action:
|
||||||
|
name: replace
|
||||||
|
swap:
|
||||||
|
(?:alumna|alumnus): graduate
|
||||||
|
(?:alumnae|alumni): graduates
|
||||||
|
air(?:m[ae]n|wom[ae]n): pilot(s)
|
||||||
|
anchor(?:m[ae]n|wom[ae]n): anchor(s)
|
||||||
|
authoress: author
|
||||||
|
camera(?:m[ae]n|wom[ae]n): camera operator(s)
|
||||||
|
door(?:m[ae]|wom[ae]n): concierge(s)
|
||||||
|
draft(?:m[ae]n|wom[ae]n): drafter(s)
|
||||||
|
fire(?:m[ae]n|wom[ae]n): firefighter(s)
|
||||||
|
fisher(?:m[ae]n|wom[ae]n): fisher(s)
|
||||||
|
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
|
||||||
|
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
|
||||||
|
lady lawyer: lawyer
|
||||||
|
ladylike: courteous
|
||||||
|
mail(?:m[ae]n|wom[ae]n): mail carriers
|
||||||
|
man and wife: husband and wife
|
||||||
|
man enough: strong enough
|
||||||
|
mankind: human kind|humanity
|
||||||
|
manmade: manufactured
|
||||||
|
manpower: personnel
|
||||||
|
middle(?:m[ae]n|wom[ae]n): intermediary
|
||||||
|
news(?:m[ae]n|wom[ae]n): journalist(s)
|
||||||
|
ombuds(?:man|woman): ombuds
|
||||||
|
oneupmanship: upstaging
|
||||||
|
poetess: poet
|
||||||
|
police(?:m[ae]n|wom[ae]n): police officer(s)
|
||||||
|
repair(?:m[ae]n|wom[ae]n): technician(s)
|
||||||
|
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
|
||||||
|
service(?:m[ae]n|wom[ae]n): soldier(s)
|
||||||
|
steward(?:ess)?: flight attendant
|
||||||
|
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
|
||||||
|
waitress: waiter
|
||||||
|
woman doctor: doctor
|
||||||
|
woman scientist[s]?: scientist(s)
|
||||||
|
work(?:m[ae]n|wom[ae]n): worker(s)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't put a period at the end of a heading."
|
||||||
|
link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings"
|
||||||
|
nonword: true
|
||||||
|
level: warning
|
||||||
|
scope: heading
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- trim_right
|
||||||
|
- "."
|
||||||
|
tokens:
|
||||||
|
- '[a-z0-9][.]\s*$'
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
extends: capitalization
|
||||||
|
message: "'%s' should use sentence-style capitalization."
|
||||||
|
link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings"
|
||||||
|
level: warning
|
||||||
|
scope: heading
|
||||||
|
match: $sentence
|
||||||
|
# No `indicators: [":"]` here. That makes Vale require a capital after a colon,
|
||||||
|
# which is the Microsoft convention this rule was originally copied from. This
|
||||||
|
# guide says the opposite: "the first word after a colon is generally
|
||||||
|
# lowercase" (developers.google.com/style/colons), and Colons.yml enforces
|
||||||
|
# exactly that. See issue #58.
|
||||||
|
exceptions:
|
||||||
|
- Azure
|
||||||
|
- CLI
|
||||||
|
- Cosmos
|
||||||
|
- Docker
|
||||||
|
- Emmet
|
||||||
|
- gRPC
|
||||||
|
- I
|
||||||
|
- Kubernetes
|
||||||
|
- Linux
|
||||||
|
- macOS
|
||||||
|
- Marketplace
|
||||||
|
- MongoDB
|
||||||
|
- REPL
|
||||||
|
- Studio
|
||||||
|
- TypeScript
|
||||||
|
- URLs
|
||||||
|
- Visual
|
||||||
|
- VS
|
||||||
|
- Windows
|
||||||
|
- JSON
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid the jargon '%s'."
|
||||||
|
link: https://developers.google.com/style/jargon
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: true
|
||||||
|
# The guide also cites 'solution', 'support', and 'workload' as overloaded
|
||||||
|
# terms, but those have ordinary technical meanings and accounted for every hit
|
||||||
|
# on a 950-file corpus, so only the unambiguous figurative terms are listed.
|
||||||
|
tokens:
|
||||||
|
- break-glass
|
||||||
|
- camel ?case
|
||||||
|
- out-of-the-box
|
||||||
|
- swim ?lane
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Use '%s' instead of '%s'."
|
||||||
|
link: 'https://developers.google.com/style/abbreviations'
|
||||||
|
ignorecase: true
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
action:
|
||||||
|
name: replace
|
||||||
|
# The delimiter is a lookahead so the replacement doesn't swallow the comma or
|
||||||
|
# space that follows (issue #18). `$` is included so the abbreviation is still
|
||||||
|
# caught at the end of a heading, table cell, or block, which accounted for 8
|
||||||
|
# of 10 occurrences on a 950-file corpus.
|
||||||
|
swap:
|
||||||
|
'\b(?:eg|e\.g\.)(?=[\s,;]|$)': for example
|
||||||
|
'\b(?:ie|i\.e\.)(?=[\s,;]|$)': that is
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' doesn't need a hyphen."
|
||||||
|
link: "https://developers.google.com/style/hyphens"
|
||||||
|
level: error
|
||||||
|
ignorecase: false
|
||||||
|
nonword: true
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- regex
|
||||||
|
- "-"
|
||||||
|
- " "
|
||||||
|
tokens:
|
||||||
|
- '\b[^\s-]+ly-\w+\b'
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't use plurals in parentheses such as in '%s'."
|
||||||
|
link: "https://developers.google.com/style/plurals-parentheses"
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- trim_right
|
||||||
|
- "(s)"
|
||||||
|
tokens:
|
||||||
|
- '\b\w+\(s\)'
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Spell out all ordinal numbers ('%s') in text."
|
||||||
|
link: 'https://developers.google.com/style/numbers'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- \d+(?:st|nd|rd|th)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Use the Oxford comma in '%s'."
|
||||||
|
link: 'https://developers.google.com/style/commas'
|
||||||
|
scope: sentence
|
||||||
|
level: warning
|
||||||
|
nonword: true
|
||||||
|
# List items may be several words long, not just one. Four guards keep the
|
||||||
|
# false-positive rate down:
|
||||||
|
#
|
||||||
|
# 1. The comma can't be the one closing a fronted subordinate clause
|
||||||
|
# ('When your alarm rings, you turn it off and tumble out of bed.') --
|
||||||
|
# that comma separates clauses, not list items. Only the first comma of
|
||||||
|
# such a sentence is exempt, so 'When it rains, apples, pears or bananas
|
||||||
|
# get wet.' is still caught.
|
||||||
|
# 2. The item can't open with a clause-introducer (', which ...',
|
||||||
|
# ', specifically ...').
|
||||||
|
# 3. The item can't open with a subject pronoun followed by a verb, which
|
||||||
|
# marks a compound predicate rather than a list ('..., you walk to the
|
||||||
|
# fridge and get a snack.'). A pronoun directly followed by 'and'/'or'
|
||||||
|
# is a real list item, so ', you and me.' still matches.
|
||||||
|
# 4. Neither item may contain an auxiliary verb, which is another compound
|
||||||
|
# predicate signal (', it has some downsides and is officially
|
||||||
|
# discouraged.').
|
||||||
|
#
|
||||||
|
# The trailing anchor allows end-of-scope so list fragments ('Apples, pears
|
||||||
|
# or bananas') are still caught.
|
||||||
|
tokens:
|
||||||
|
- '(?<!^(?i:when|whenever|while|if|unless|until|although|though|because|since|after|before|once|whereas|whether|as)\b[^,]{0,80}),\s(?!(?:which|who|whom|whose|that|where|when|while|because|since|although|though|if|unless|so|but|and|or|however|therefore|thus|specifically|especially|namely|then|take|see|note|consider|make|use|either|neither)\b)(?!(?i:i|you|we|they|he|she|it)\s+(?!(?:and|or)\b))(?:(?!\b(?:is|are|was|were|has|have|had|be|been|being|will|would|can|could|should|may|might|must|do|does|did)\b)\w+ ){0,4}\w+ (?:and|or) (?:(?!\b(?:is|are|was|were|has|have|had|be|been|being|will|would|can|could|should|may|might|must|do|does|did)\b)\w+ ){0,4}\w+(?:[.?!]|$)'
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Use parentheses judiciously."
|
||||||
|
link: 'https://developers.google.com/style/parentheses'
|
||||||
|
nonword: true
|
||||||
|
level: suggestion
|
||||||
|
# `[^)]` rather than `.+`: a greedy match ran from the first '(' on a line to
|
||||||
|
# the last ')', so 'Text (one) and more (two).' produced a single alert
|
||||||
|
# covering everything between them. See issue #30.
|
||||||
|
# A bare 3-5 letter acronym is skipped: Acronyms.yml requires acronyms to be
|
||||||
|
# defined as 'Spelled Out Term (ACRONYM)', so flagging those parentheses would
|
||||||
|
# put the two rules in direct conflict. The acronym has to be the whole
|
||||||
|
# parenthetical — '(NASA rocket program)' is an ordinary aside and still
|
||||||
|
# flags. Length matches the {3,5} in Acronyms.yml. See PR #59.
|
||||||
|
tokens:
|
||||||
|
- '\((?![A-Z]{3,5}\))[^)]+\)'
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
extends: existence
|
||||||
|
link: 'https://developers.google.com/style/voice'
|
||||||
|
message: "In general, use active voice instead of passive voice ('%s')."
|
||||||
|
ignorecase: true
|
||||||
|
level: suggestion
|
||||||
|
raw:
|
||||||
|
- \b(am|are|were|being|is|been|was|be)\b\s*
|
||||||
|
tokens:
|
||||||
|
- '[\w]+ed'
|
||||||
|
- awoken
|
||||||
|
- beat
|
||||||
|
- become
|
||||||
|
- been
|
||||||
|
- begun
|
||||||
|
- bent
|
||||||
|
- beset
|
||||||
|
- bet
|
||||||
|
- bid
|
||||||
|
- bidden
|
||||||
|
- bitten
|
||||||
|
- bled
|
||||||
|
- blown
|
||||||
|
- born
|
||||||
|
- bought
|
||||||
|
- bound
|
||||||
|
- bred
|
||||||
|
- broadcast
|
||||||
|
- broken
|
||||||
|
- brought
|
||||||
|
- built
|
||||||
|
- burnt
|
||||||
|
- burst
|
||||||
|
- cast
|
||||||
|
- caught
|
||||||
|
- chosen
|
||||||
|
- clung
|
||||||
|
- come
|
||||||
|
- cost
|
||||||
|
- crept
|
||||||
|
- cut
|
||||||
|
- dealt
|
||||||
|
- dived
|
||||||
|
- done
|
||||||
|
- drawn
|
||||||
|
- dreamt
|
||||||
|
- driven
|
||||||
|
- drunk
|
||||||
|
- dug
|
||||||
|
- eaten
|
||||||
|
- fallen
|
||||||
|
- fed
|
||||||
|
- felt
|
||||||
|
- fit
|
||||||
|
- fled
|
||||||
|
- flown
|
||||||
|
- flung
|
||||||
|
- forbidden
|
||||||
|
- foregone
|
||||||
|
- forgiven
|
||||||
|
- forgotten
|
||||||
|
- forsaken
|
||||||
|
- fought
|
||||||
|
- found
|
||||||
|
- frozen
|
||||||
|
- given
|
||||||
|
- gone
|
||||||
|
- gotten
|
||||||
|
- ground
|
||||||
|
- grown
|
||||||
|
- heard
|
||||||
|
- held
|
||||||
|
- hidden
|
||||||
|
- hit
|
||||||
|
- hung
|
||||||
|
- hurt
|
||||||
|
- kept
|
||||||
|
- knelt
|
||||||
|
- knit
|
||||||
|
- known
|
||||||
|
- laid
|
||||||
|
- lain
|
||||||
|
- leapt
|
||||||
|
- learnt
|
||||||
|
- led
|
||||||
|
- left
|
||||||
|
- lent
|
||||||
|
- let
|
||||||
|
- lighted
|
||||||
|
- lost
|
||||||
|
- made
|
||||||
|
- meant
|
||||||
|
- met
|
||||||
|
- misspelt
|
||||||
|
- mistaken
|
||||||
|
- mown
|
||||||
|
- overcome
|
||||||
|
- overdone
|
||||||
|
- overtaken
|
||||||
|
- overthrown
|
||||||
|
- paid
|
||||||
|
- pled
|
||||||
|
- proven
|
||||||
|
- put
|
||||||
|
- quit
|
||||||
|
- read
|
||||||
|
- rid
|
||||||
|
- ridden
|
||||||
|
- risen
|
||||||
|
- run
|
||||||
|
- rung
|
||||||
|
- said
|
||||||
|
- sat
|
||||||
|
- sawn
|
||||||
|
- seen
|
||||||
|
- sent
|
||||||
|
- set
|
||||||
|
- sewn
|
||||||
|
- shaken
|
||||||
|
- shaven
|
||||||
|
- shed
|
||||||
|
- shod
|
||||||
|
- shone
|
||||||
|
- shorn
|
||||||
|
- shot
|
||||||
|
- shown
|
||||||
|
- shrunk
|
||||||
|
- shut
|
||||||
|
- slain
|
||||||
|
- slept
|
||||||
|
- slid
|
||||||
|
- slit
|
||||||
|
- slung
|
||||||
|
- smitten
|
||||||
|
- sold
|
||||||
|
- sought
|
||||||
|
- sown
|
||||||
|
- sped
|
||||||
|
- spent
|
||||||
|
- spilt
|
||||||
|
- spit
|
||||||
|
- split
|
||||||
|
- spoken
|
||||||
|
- spread
|
||||||
|
- sprung
|
||||||
|
- spun
|
||||||
|
- stolen
|
||||||
|
- stood
|
||||||
|
- stridden
|
||||||
|
- striven
|
||||||
|
- struck
|
||||||
|
- strung
|
||||||
|
- stuck
|
||||||
|
- stung
|
||||||
|
- stunk
|
||||||
|
- sung
|
||||||
|
- sunk
|
||||||
|
- swept
|
||||||
|
- swollen
|
||||||
|
- sworn
|
||||||
|
- swum
|
||||||
|
- swung
|
||||||
|
- taken
|
||||||
|
- taught
|
||||||
|
- thought
|
||||||
|
- thrived
|
||||||
|
- thrown
|
||||||
|
- thrust
|
||||||
|
- told
|
||||||
|
- torn
|
||||||
|
- trodden
|
||||||
|
- understood
|
||||||
|
- upheld
|
||||||
|
- upset
|
||||||
|
- wed
|
||||||
|
- wept
|
||||||
|
- withheld
|
||||||
|
- withstood
|
||||||
|
- woken
|
||||||
|
- won
|
||||||
|
- worn
|
||||||
|
- wound
|
||||||
|
- woven
|
||||||
|
- written
|
||||||
|
- wrung
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't use periods with acronyms or initialisms such as '%s'."
|
||||||
|
link: 'https://developers.google.com/style/abbreviations'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- '\b(?:[A-Z]\.){3,}'
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Commas and periods go inside quotation marks."
|
||||||
|
link: 'https://developers.google.com/style/quotation-marks'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
tokens:
|
||||||
|
- '"[^"]+"[.,?]'
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't add words such as 'from' or 'between' to describe a range of numbers."
|
||||||
|
link: 'https://developers.google.com/style/hyphens'
|
||||||
|
nonword: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- '(?:from|between)\s\d+\s?-\s?\d+'
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Use semicolons judiciously."
|
||||||
|
link: 'https://developers.google.com/style/semicolons'
|
||||||
|
nonword: true
|
||||||
|
scope: sentence
|
||||||
|
level: suggestion
|
||||||
|
tokens:
|
||||||
|
- ';'
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't use internet slang abbreviations such as '%s'."
|
||||||
|
link: 'https://developers.google.com/style/abbreviations'
|
||||||
|
ignorecase: true
|
||||||
|
level: error
|
||||||
|
tokens:
|
||||||
|
- 'tl;dr'
|
||||||
|
- ymmv
|
||||||
|
- rtfm
|
||||||
|
- imo
|
||||||
|
- fwiw
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' should have one space."
|
||||||
|
link: 'https://developers.google.com/style/sentence-spacing'
|
||||||
|
level: error
|
||||||
|
nonword: true
|
||||||
|
action:
|
||||||
|
name: remove
|
||||||
|
tokens:
|
||||||
|
- '[a-z][.?!] {2,}[A-Z]'
|
||||||
|
- '[a-z][.?!][A-Z]'
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "In general, use American spelling instead of '%s'."
|
||||||
|
link: 'https://developers.google.com/style/spelling'
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- '(?:\w+)nised?'
|
||||||
|
- 'colour'
|
||||||
|
- 'labour'
|
||||||
|
- 'centre'
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid time-based words like '%s' in product documentation."
|
||||||
|
link: https://developers.google.com/style/timeless-documentation
|
||||||
|
level: suggestion
|
||||||
|
ignorecase: true
|
||||||
|
# The guide also names 'now' and 'new', but both have common senses that aren't
|
||||||
|
# time-anchored ('create a new project'): adding them took a 950-file corpus of
|
||||||
|
# technical documentation from 14 hits to 117. 'recently' is left out too — every
|
||||||
|
# hit in that corpus was the UI idiom 'recently used'.
|
||||||
|
tokens:
|
||||||
|
- currently
|
||||||
|
- latest
|
||||||
|
- soon
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Put a nonbreaking space between the number and the unit in '%s'."
|
||||||
|
link: "https://developers.google.com/style/units-of-measure"
|
||||||
|
nonword: true
|
||||||
|
level: error
|
||||||
|
tokens:
|
||||||
|
- '\b\d+(?:B|kB|MB|GB|TB)\b'
|
||||||
|
- '\b\d+(?:ns|ms|min|h|d)\b'
|
||||||
|
# Seconds are split out so a decade ('1990s') isn't read as a unit.
|
||||||
|
- '\b\d+s\b(?<!\b(?:19|20)\d\ds\b)'
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Try to avoid using first-person plural like '%s'."
|
||||||
|
link: 'https://developers.google.com/style/pronouns#personal-pronouns'
|
||||||
|
level: warning
|
||||||
|
ignorecase: true
|
||||||
|
tokens:
|
||||||
|
- we
|
||||||
|
- we'(?:ve|re)
|
||||||
|
- ours?
|
||||||
|
- us
|
||||||
|
- let's
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid using '%s'."
|
||||||
|
link: 'https://developers.google.com/style/tense'
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- will
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Use '%s' instead of '%s'."
|
||||||
|
link: "https://developers.google.com/style/word-list"
|
||||||
|
level: warning
|
||||||
|
# Case matters here: each key's own capitalization is what's being corrected,
|
||||||
|
# so ignorecase would make these match their own replacements. The rest of the
|
||||||
|
# word list lives in WordListCase.yml.
|
||||||
|
ignorecase: false
|
||||||
|
action:
|
||||||
|
name: replace
|
||||||
|
swap:
|
||||||
|
Ajax: AJAX
|
||||||
|
Android device: Android-powered device
|
||||||
|
android: Android
|
||||||
|
API explorer: APIs Explorer
|
||||||
|
authN: authentication
|
||||||
|
authZ: authorization
|
||||||
|
CLI: command-line tool
|
||||||
|
Cloud: Google Cloud Platform|GCP
|
||||||
|
Container Engine: Kubernetes Engine
|
||||||
|
Developers Console: Google API Console|API Console
|
||||||
|
Google account: Google Account
|
||||||
|
Google accounts: Google Accounts
|
||||||
|
Googling: search with Google
|
||||||
|
HTTPs: HTTPS
|
||||||
|
k8s: Kubernetes
|
||||||
|
SHA1: SHA-1|HAS-SHA1
|
||||||
|
url: URL
|
||||||
|
World Wide Web: web
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Use '%s' instead of '%s'."
|
||||||
|
link: "https://developers.google.com/style/word-list"
|
||||||
|
level: warning
|
||||||
|
# The case-insensitive half of the word list, so sentence-initial use is caught
|
||||||
|
# ('Touch the screen', not only 'touch the screen'). Entries that must stay
|
||||||
|
# case-sensitive are in WordList.yml.
|
||||||
|
ignorecase: true
|
||||||
|
action:
|
||||||
|
name: replace
|
||||||
|
swap:
|
||||||
|
"(?:API Console|dev|developer) key": API key
|
||||||
|
"(?:cell ?phone|smart ?phone)": phone|mobile phone
|
||||||
|
"(?:dev|developer|APIs) console": API console
|
||||||
|
"(?:e-mail|Email|E-mail)": email
|
||||||
|
"(?:file ?path|path ?name)": path
|
||||||
|
"(?:kill|terminate|abort)": stop|exit|cancel|end
|
||||||
|
# Longest form first: with the shortest alternative leading, 'OAuth 2' matched
|
||||||
|
# only 'OAuth', so applying the suggestion produced 'OAuth 2.0 2'. The rule is
|
||||||
|
# already case-insensitive, so the inline (?i) is redundant. See issue #41.
|
||||||
|
'\bOauth2\.0\b|\bOAuth ?2\b(?!\.0)|\bOauth\b(?! ?2)': OAuth 2.0
|
||||||
|
"(?:ok|Okay)": OK|okay
|
||||||
|
"(?:WiFi|wifi)": Wi-Fi
|
||||||
|
'[\.]+apk': APK
|
||||||
|
'3\-D': 3D
|
||||||
|
'Google (?:I\-O|IO)': Google I/O
|
||||||
|
"tap (?:&|and) hold": touch & hold
|
||||||
|
"un(?:check|select)": clear
|
||||||
|
above: preceding
|
||||||
|
account name: username
|
||||||
|
action bar: app bar
|
||||||
|
admin: administrator
|
||||||
|
a\.k\.a|aka: or|also known as
|
||||||
|
application: app
|
||||||
|
approx\.: approximately
|
||||||
|
autoupdate: automatically update
|
||||||
|
cellular data: mobile data
|
||||||
|
cellular network: mobile network
|
||||||
|
chapter: documents|pages|sections
|
||||||
|
check box: checkbox
|
||||||
|
click on: click|click in
|
||||||
|
content type: media type
|
||||||
|
curated roles: predefined roles
|
||||||
|
data are: data is
|
||||||
|
disabled?: turn off|off
|
||||||
|
ephemeral IP address: ephemeral external IP address
|
||||||
|
fewer data: less data
|
||||||
|
file name: filename
|
||||||
|
firewalls: firewall rules
|
||||||
|
functionality: capability|feature
|
||||||
|
grayed-out: unavailable
|
||||||
|
in order to: to
|
||||||
|
ingest: import|load
|
||||||
|
long press: touch & hold
|
||||||
|
network IP address: internal IP address
|
||||||
|
omnibox: address bar
|
||||||
|
open-source: open source
|
||||||
|
overview screen: recents screen
|
||||||
|
regex: regular expression
|
||||||
|
sign into: sign in to
|
||||||
|
'(?<!single )sign-?on': single sign-on
|
||||||
|
static IP address: static external IP address
|
||||||
|
stylesheet: style sheet
|
||||||
|
synch: sync
|
||||||
|
tablename: table name
|
||||||
|
tablet: device
|
||||||
|
'touch(?! ?(?:&|and) hold)': tap
|
||||||
|
vs\.: versus
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"feed": "https://github.com/errata-ai/Google/releases.atom",
|
||||||
|
"vale_version": ">=1.0.0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the Automated Readability Index (%s) below 8."
|
||||||
|
link: https://en.wikipedia.org/wiki/Automated_readability_index
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
(4.71 * (characters / words)) + (0.5 * (words / sentences)) - 21.43
|
||||||
|
|
||||||
|
condition: "> 8"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the Coleman–Liau Index grade (%s) below 9."
|
||||||
|
link: https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
(0.0588 * (characters / words) * 100) - (0.296 * (sentences / words) * 100) - 15.8
|
||||||
|
|
||||||
|
condition: "> 9"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the Flesch–Kincaid grade level (%s) below 8."
|
||||||
|
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
(0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59
|
||||||
|
|
||||||
|
condition: "> 8"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the Flesch reading ease score (%s) above 70."
|
||||||
|
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
206.835 - (1.015 * (words / sentences)) - (84.6 * (syllables / words))
|
||||||
|
|
||||||
|
condition: "< 70"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the Gunning-Fog index (%s) below 10."
|
||||||
|
link: https://en.wikipedia.org/wiki/Gunning_fog_index
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
0.4 * ((words / sentences) + 100 * (complex_words / words))
|
||||||
|
|
||||||
|
condition: "> 10"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the LIX score (%s) below 35."
|
||||||
|
|
||||||
|
link: https://en.wikipedia.org/wiki/Lix_(readability_test)
|
||||||
|
# Very Easy: 20 - 25
|
||||||
|
#
|
||||||
|
# Easy: 30 - 35
|
||||||
|
#
|
||||||
|
# Medium: 40 - 45
|
||||||
|
#
|
||||||
|
# Difficult: 50 - 55
|
||||||
|
#
|
||||||
|
# Very Difficult: 60+
|
||||||
|
formula: |
|
||||||
|
(words / sentences) + ((long_words * 100) / words)
|
||||||
|
|
||||||
|
condition: "> 35"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends: metric
|
||||||
|
message: "Try to keep the SMOG grade (%s) below 10."
|
||||||
|
link: https://en.wikipedia.org/wiki/SMOG
|
||||||
|
|
||||||
|
formula: |
|
||||||
|
1.0430 * math.sqrt((polysyllabic_words * 30.0) / sentences) + 3.1291
|
||||||
|
|
||||||
|
condition: "> 10"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"feed": "https://github.com/errata-ai/Readability/releases.atom",
|
||||||
|
"vale_version": ">=2.13.0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
devx
|
||||||
|
grm
|
||||||
|
GRM
|
||||||
|
Gitea
|
||||||
|
ZITADEL
|
||||||
|
OpenTofu
|
||||||
|
Ansible
|
||||||
|
Vaultwarden
|
||||||
|
Nextcloud
|
||||||
|
Vikunja
|
||||||
|
Mattermost
|
||||||
|
Prometheus
|
||||||
|
Grafana
|
||||||
|
Loki
|
||||||
|
Alertmanager
|
||||||
|
Promtail
|
||||||
|
pyproject
|
||||||
|
tofu
|
||||||
|
act_runner
|
||||||
|
actionlint
|
||||||
|
hadolint
|
||||||
|
git-cliff
|
||||||
|
pre-commit
|
||||||
|
semver
|
||||||
|
changelog
|
||||||
|
idempotent
|
||||||
|
rootless
|
||||||
|
OIDC
|
||||||
|
SSO
|
||||||
|
SAML
|
||||||
|
LDAP
|
||||||
|
pytest
|
||||||
|
molecule
|
||||||
|
ruff
|
||||||
|
pyright
|
||||||
|
bandit
|
||||||
|
Vale
|
||||||
|
oblachno
|
||||||
|
Oblachno
|
||||||
|
Bulgarian
|
||||||
|
gitea-runner
|
||||||
|
runner
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Unlabeled code block — add a language tag (```bash, ```yaml, etc.)"
|
||||||
|
level: warning
|
||||||
|
scope: raw
|
||||||
|
raw:
|
||||||
|
- '(?ms)^\n```\n.*?^```\s*$'
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Avoid '%s' — it's condescending in technical documentation"
|
||||||
|
level: warning
|
||||||
|
ignorecase: true
|
||||||
|
tokens:
|
||||||
|
- '\bsimply\b'
|
||||||
|
- '\bjust\b'
|
||||||
|
- '\bobviously\b'
|
||||||
|
- '\bof course\b'
|
||||||
|
- '\bas you (can )?see\b'
|
||||||
|
- '\beasily\b'
|
||||||
|
- '\btrivial\b'
|
||||||
|
- '\bstraightforward\b'
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Custom Vale style for devx documentation
|
||||||
|
|
||||||
|
Project-specific terminology and style rules
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
extends: substitution
|
||||||
|
message: "Use '%s' instead of '%s' (terminology consistency)"
|
||||||
|
level: error
|
||||||
|
ignorecase: false
|
||||||
|
swap:
|
||||||
|
'\b(?i)gitea\b': Gitea
|
||||||
|
'\b(?i)zitadel\b': ZITADEL
|
||||||
|
'\b(?i)opentofu\b': OpenTofu
|
||||||
|
'\b(?i)vaultwarden\b': Vaultwarden
|
||||||
|
'\b(?i)nextcloud\b': Nextcloud
|
||||||
|
'\b(?i)mattermost\b': Mattermost
|
||||||
@@ -0,0 +1,702 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Try to avoid using clichés like '%s'."
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- a chip off the old block
|
||||||
|
- a clean slate
|
||||||
|
- a dark and stormy night
|
||||||
|
- a far cry
|
||||||
|
- a fine kettle of fish
|
||||||
|
- a loose cannon
|
||||||
|
- a penny saved is a penny earned
|
||||||
|
- a tough row to hoe
|
||||||
|
- a word to the wise
|
||||||
|
- ace in the hole
|
||||||
|
- acid test
|
||||||
|
- add insult to injury
|
||||||
|
- against all odds
|
||||||
|
- air your dirty laundry
|
||||||
|
- all fun and games
|
||||||
|
- all in a day's work
|
||||||
|
- all talk, no action
|
||||||
|
- all thumbs
|
||||||
|
- all your eggs in one basket
|
||||||
|
- all's fair in love and war
|
||||||
|
- all's well that ends well
|
||||||
|
- almighty dollar
|
||||||
|
- American as apple pie
|
||||||
|
- an axe to grind
|
||||||
|
- another day, another dollar
|
||||||
|
- armed to the teeth
|
||||||
|
- as luck would have it
|
||||||
|
- as old as time
|
||||||
|
- as the crow flies
|
||||||
|
- at loose ends
|
||||||
|
- at my wits end
|
||||||
|
- avoid like the plague
|
||||||
|
- babe in the woods
|
||||||
|
- back against the wall
|
||||||
|
- back in the saddle
|
||||||
|
- back to square one
|
||||||
|
- back to the drawing board
|
||||||
|
- bad to the bone
|
||||||
|
- badge of honor
|
||||||
|
- bald faced liar
|
||||||
|
- ballpark figure
|
||||||
|
- banging your head against a brick wall
|
||||||
|
- baptism by fire
|
||||||
|
- barking up the wrong tree
|
||||||
|
- bat out of hell
|
||||||
|
- be all and end all
|
||||||
|
- beat a dead horse
|
||||||
|
- beat around the bush
|
||||||
|
- been there, done that
|
||||||
|
- beggars can't be choosers
|
||||||
|
- behind the eight ball
|
||||||
|
- bend over backwards
|
||||||
|
- benefit of the doubt
|
||||||
|
- bent out of shape
|
||||||
|
- best thing since sliced bread
|
||||||
|
- bet your bottom dollar
|
||||||
|
- better half
|
||||||
|
- better late than never
|
||||||
|
- better mousetrap
|
||||||
|
- better safe than sorry
|
||||||
|
- between a rock and a hard place
|
||||||
|
- beyond the pale
|
||||||
|
- bide your time
|
||||||
|
- big as life
|
||||||
|
- big cheese
|
||||||
|
- big fish in a small pond
|
||||||
|
- big man on campus
|
||||||
|
- bigger they are the harder they fall
|
||||||
|
- bird in the hand
|
||||||
|
- bird's eye view
|
||||||
|
- birds and the bees
|
||||||
|
- birds of a feather flock together
|
||||||
|
- bit the hand that feeds you
|
||||||
|
- bite the bullet
|
||||||
|
- bite the dust
|
||||||
|
- bitten off more than he can chew
|
||||||
|
- black as coal
|
||||||
|
- black as pitch
|
||||||
|
- black as the ace of spades
|
||||||
|
- blast from the past
|
||||||
|
- bleeding heart
|
||||||
|
- blessing in disguise
|
||||||
|
- blind ambition
|
||||||
|
- blind as a bat
|
||||||
|
- blind leading the blind
|
||||||
|
- blood is thicker than water
|
||||||
|
- blood sweat and tears
|
||||||
|
- blow off steam
|
||||||
|
- blow your own horn
|
||||||
|
- blushing bride
|
||||||
|
- boils down to
|
||||||
|
- bolt from the blue
|
||||||
|
- bone to pick
|
||||||
|
- bored stiff
|
||||||
|
- bored to tears
|
||||||
|
- bottomless pit
|
||||||
|
- boys will be boys
|
||||||
|
- bright and early
|
||||||
|
- brings home the bacon
|
||||||
|
- broad across the beam
|
||||||
|
- broken record
|
||||||
|
- brought back to reality
|
||||||
|
- bull by the horns
|
||||||
|
- bull in a china shop
|
||||||
|
- burn the midnight oil
|
||||||
|
- burning question
|
||||||
|
- burning the candle at both ends
|
||||||
|
- burst your bubble
|
||||||
|
- bury the hatchet
|
||||||
|
- busy as a bee
|
||||||
|
- by hook or by crook
|
||||||
|
- call a spade a spade
|
||||||
|
- called onto the carpet
|
||||||
|
- calm before the storm
|
||||||
|
- can of worms
|
||||||
|
- can't cut the mustard
|
||||||
|
- can't hold a candle to
|
||||||
|
- case of mistaken identity
|
||||||
|
- cat got your tongue
|
||||||
|
- cat's meow
|
||||||
|
- caught in the crossfire
|
||||||
|
- caught red-handed
|
||||||
|
- checkered past
|
||||||
|
- chomping at the bit
|
||||||
|
- cleanliness is next to godliness
|
||||||
|
- clear as a bell
|
||||||
|
- clear as mud
|
||||||
|
- close to the vest
|
||||||
|
- cock and bull story
|
||||||
|
- cold shoulder
|
||||||
|
- come hell or high water
|
||||||
|
- cool as a cucumber
|
||||||
|
- cool, calm, and collected
|
||||||
|
- cost a king's ransom
|
||||||
|
- count your blessings
|
||||||
|
- crack of dawn
|
||||||
|
- crash course
|
||||||
|
- creature comforts
|
||||||
|
- cross that bridge when you come to it
|
||||||
|
- crushing blow
|
||||||
|
- cry like a baby
|
||||||
|
- cry me a river
|
||||||
|
- cry over spilt milk
|
||||||
|
- crystal clear
|
||||||
|
- curiosity killed the cat
|
||||||
|
- cut and dried
|
||||||
|
- cut through the red tape
|
||||||
|
- cut to the chase
|
||||||
|
- cute as a bugs ear
|
||||||
|
- cute as a button
|
||||||
|
- cute as a puppy
|
||||||
|
- cuts to the quick
|
||||||
|
- dark before the dawn
|
||||||
|
- day in, day out
|
||||||
|
- dead as a doornail
|
||||||
|
- devil is in the details
|
||||||
|
- dime a dozen
|
||||||
|
- divide and conquer
|
||||||
|
- dog and pony show
|
||||||
|
- dog days
|
||||||
|
- dog eat dog
|
||||||
|
- dog tired
|
||||||
|
- don't burn your bridges
|
||||||
|
- don't count your chickens
|
||||||
|
- don't look a gift horse in the mouth
|
||||||
|
- don't rock the boat
|
||||||
|
- don't step on anyone's toes
|
||||||
|
- don't take any wooden nickels
|
||||||
|
- down and out
|
||||||
|
- down at the heels
|
||||||
|
- down in the dumps
|
||||||
|
- down the hatch
|
||||||
|
- down to earth
|
||||||
|
- draw the line
|
||||||
|
- dressed to kill
|
||||||
|
- dressed to the nines
|
||||||
|
- drives me up the wall
|
||||||
|
- dull as dishwater
|
||||||
|
- dyed in the wool
|
||||||
|
- eagle eye
|
||||||
|
- ear to the ground
|
||||||
|
- early bird catches the worm
|
||||||
|
- easier said than done
|
||||||
|
- easy as pie
|
||||||
|
- eat your heart out
|
||||||
|
- eat your words
|
||||||
|
- eleventh hour
|
||||||
|
- even the playing field
|
||||||
|
- every dog has its day
|
||||||
|
- every fiber of my being
|
||||||
|
- everything but the kitchen sink
|
||||||
|
- eye for an eye
|
||||||
|
- face the music
|
||||||
|
- facts of life
|
||||||
|
- fair weather friend
|
||||||
|
- fall by the wayside
|
||||||
|
- fan the flames
|
||||||
|
- feast or famine
|
||||||
|
- feather your nest
|
||||||
|
- feathered friends
|
||||||
|
- few and far between
|
||||||
|
- fifteen minutes of fame
|
||||||
|
- filthy vermin
|
||||||
|
- fine kettle of fish
|
||||||
|
- fish out of water
|
||||||
|
- fishing for a compliment
|
||||||
|
- fit as a fiddle
|
||||||
|
- fit the bill
|
||||||
|
- fit to be tied
|
||||||
|
- flash in the pan
|
||||||
|
- flat as a pancake
|
||||||
|
- flip your lid
|
||||||
|
- flog a dead horse
|
||||||
|
- fly by night
|
||||||
|
- fly the coop
|
||||||
|
- follow your heart
|
||||||
|
- for all intents and purposes
|
||||||
|
- for the birds
|
||||||
|
- for what it's worth
|
||||||
|
- force of nature
|
||||||
|
- force to be reckoned with
|
||||||
|
- forgive and forget
|
||||||
|
- fox in the henhouse
|
||||||
|
- free and easy
|
||||||
|
- free as a bird
|
||||||
|
- fresh as a daisy
|
||||||
|
- full steam ahead
|
||||||
|
- fun in the sun
|
||||||
|
- garbage in, garbage out
|
||||||
|
- gentle as a lamb
|
||||||
|
- get a kick out of
|
||||||
|
- get a leg up
|
||||||
|
- get down and dirty
|
||||||
|
- get the lead out
|
||||||
|
- get to the bottom of
|
||||||
|
- get your feet wet
|
||||||
|
- gets my goat
|
||||||
|
- gilding the lily
|
||||||
|
- give and take
|
||||||
|
- go against the grain
|
||||||
|
- go at it tooth and nail
|
||||||
|
- go for broke
|
||||||
|
- go him one better
|
||||||
|
- go the extra mile
|
||||||
|
- go with the flow
|
||||||
|
- goes without saying
|
||||||
|
- good as gold
|
||||||
|
- good deed for the day
|
||||||
|
- good things come to those who wait
|
||||||
|
- good time was had by all
|
||||||
|
- good times were had by all
|
||||||
|
- greased lightning
|
||||||
|
- greek to me
|
||||||
|
- green thumb
|
||||||
|
- green-eyed monster
|
||||||
|
- grist for the mill
|
||||||
|
- growing like a weed
|
||||||
|
- hair of the dog
|
||||||
|
- hand to mouth
|
||||||
|
- happy as a clam
|
||||||
|
- happy as a lark
|
||||||
|
- hasn't a clue
|
||||||
|
- have a nice day
|
||||||
|
- have high hopes
|
||||||
|
- have the last laugh
|
||||||
|
- haven't got a row to hoe
|
||||||
|
- head honcho
|
||||||
|
- head over heels
|
||||||
|
- hear a pin drop
|
||||||
|
- heard it through the grapevine
|
||||||
|
- heart's content
|
||||||
|
- heavy as lead
|
||||||
|
- hem and haw
|
||||||
|
- high and dry
|
||||||
|
- high and mighty
|
||||||
|
- high as a kite
|
||||||
|
- hit paydirt
|
||||||
|
- hold your head up high
|
||||||
|
- hold your horses
|
||||||
|
- hold your own
|
||||||
|
- hold your tongue
|
||||||
|
- honest as the day is long
|
||||||
|
- horns of a dilemma
|
||||||
|
- horse of a different color
|
||||||
|
- hot under the collar
|
||||||
|
- hour of need
|
||||||
|
- I beg to differ
|
||||||
|
- icing on the cake
|
||||||
|
- if the shoe fits
|
||||||
|
- if the shoe were on the other foot
|
||||||
|
- in a jam
|
||||||
|
- in a jiffy
|
||||||
|
- in a nutshell
|
||||||
|
- in a pig's eye
|
||||||
|
- in a pinch
|
||||||
|
- in a word
|
||||||
|
- in hot water
|
||||||
|
- in the gutter
|
||||||
|
- in the nick of time
|
||||||
|
- in the thick of it
|
||||||
|
- in your dreams
|
||||||
|
- it ain't over till the fat lady sings
|
||||||
|
- it goes without saying
|
||||||
|
- it takes all kinds
|
||||||
|
- it takes one to know one
|
||||||
|
- it's a small world
|
||||||
|
- it's only a matter of time
|
||||||
|
- ivory tower
|
||||||
|
- Jack of all trades
|
||||||
|
- jockey for position
|
||||||
|
- jog your memory
|
||||||
|
- joined at the hip
|
||||||
|
- judge a book by its cover
|
||||||
|
- jump down your throat
|
||||||
|
- jump in with both feet
|
||||||
|
- jump on the bandwagon
|
||||||
|
- jump the gun
|
||||||
|
- jump to conclusions
|
||||||
|
- just a hop, skip, and a jump
|
||||||
|
- just the ticket
|
||||||
|
- justice is blind
|
||||||
|
- keep a stiff upper lip
|
||||||
|
- keep an eye on
|
||||||
|
- keep it simple, stupid
|
||||||
|
- keep the home fires burning
|
||||||
|
- keep up with the Joneses
|
||||||
|
- keep your chin up
|
||||||
|
- keep your fingers crossed
|
||||||
|
- kick the bucket
|
||||||
|
- kick up your heels
|
||||||
|
- kick your feet up
|
||||||
|
- kid in a candy store
|
||||||
|
- kill two birds with one stone
|
||||||
|
- kiss of death
|
||||||
|
- knock it out of the park
|
||||||
|
- knock on wood
|
||||||
|
- knock your socks off
|
||||||
|
- know him from Adam
|
||||||
|
- know the ropes
|
||||||
|
- know the score
|
||||||
|
- knuckle down
|
||||||
|
- knuckle sandwich
|
||||||
|
- knuckle under
|
||||||
|
- labor of love
|
||||||
|
- ladder of success
|
||||||
|
- land on your feet
|
||||||
|
- lap of luxury
|
||||||
|
- last but not least
|
||||||
|
- last hurrah
|
||||||
|
- last-ditch effort
|
||||||
|
- law of the jungle
|
||||||
|
- law of the land
|
||||||
|
- lay down the law
|
||||||
|
- leaps and bounds
|
||||||
|
- let sleeping dogs lie
|
||||||
|
- let the cat out of the bag
|
||||||
|
- let the good times roll
|
||||||
|
- let your hair down
|
||||||
|
- let's talk turkey
|
||||||
|
- letter perfect
|
||||||
|
- lick your wounds
|
||||||
|
- lies like a rug
|
||||||
|
- life's a bitch
|
||||||
|
- life's a grind
|
||||||
|
- light at the end of the tunnel
|
||||||
|
- lighter than a feather
|
||||||
|
- lighter than air
|
||||||
|
- like clockwork
|
||||||
|
- like father like son
|
||||||
|
- like taking candy from a baby
|
||||||
|
- like there's no tomorrow
|
||||||
|
- lion's share
|
||||||
|
- live and learn
|
||||||
|
- live and let live
|
||||||
|
- long and short of it
|
||||||
|
- long lost love
|
||||||
|
- look before you leap
|
||||||
|
- look down your nose
|
||||||
|
- look what the cat dragged in
|
||||||
|
- looking a gift horse in the mouth
|
||||||
|
- looks like death warmed over
|
||||||
|
- loose cannon
|
||||||
|
- lose your head
|
||||||
|
- lose your temper
|
||||||
|
- loud as a horn
|
||||||
|
- lounge lizard
|
||||||
|
- loved and lost
|
||||||
|
- low man on the totem pole
|
||||||
|
- luck of the draw
|
||||||
|
- luck of the Irish
|
||||||
|
- make hay while the sun shines
|
||||||
|
- make money hand over fist
|
||||||
|
- make my day
|
||||||
|
- make the best of a bad situation
|
||||||
|
- make the best of it
|
||||||
|
- make your blood boil
|
||||||
|
- man of few words
|
||||||
|
- man's best friend
|
||||||
|
- mark my words
|
||||||
|
- meaningful dialogue
|
||||||
|
- missed the boat on that one
|
||||||
|
- moment in the sun
|
||||||
|
- moment of glory
|
||||||
|
- moment of truth
|
||||||
|
- money to burn
|
||||||
|
- more power to you
|
||||||
|
- more than one way to skin a cat
|
||||||
|
- movers and shakers
|
||||||
|
- moving experience
|
||||||
|
- naked as a jaybird
|
||||||
|
- naked truth
|
||||||
|
- neat as a pin
|
||||||
|
- needle in a haystack
|
||||||
|
- needless to say
|
||||||
|
- neither here nor there
|
||||||
|
- never look back
|
||||||
|
- never say never
|
||||||
|
- nip and tuck
|
||||||
|
- nip it in the bud
|
||||||
|
- no guts, no glory
|
||||||
|
- no love lost
|
||||||
|
- no pain, no gain
|
||||||
|
- no skin off my back
|
||||||
|
- no stone unturned
|
||||||
|
- no time like the present
|
||||||
|
- no use crying over spilled milk
|
||||||
|
- nose to the grindstone
|
||||||
|
- not a hope in hell
|
||||||
|
- not a minute's peace
|
||||||
|
- not in my backyard
|
||||||
|
- not playing with a full deck
|
||||||
|
- not the end of the world
|
||||||
|
- not written in stone
|
||||||
|
- nothing to sneeze at
|
||||||
|
- nothing ventured nothing gained
|
||||||
|
- now we're cooking
|
||||||
|
- off the top of my head
|
||||||
|
- off the wagon
|
||||||
|
- off the wall
|
||||||
|
- old hat
|
||||||
|
- older and wiser
|
||||||
|
- older than dirt
|
||||||
|
- older than Methuselah
|
||||||
|
- on a roll
|
||||||
|
- on cloud nine
|
||||||
|
- on pins and needles
|
||||||
|
- on the bandwagon
|
||||||
|
- on the money
|
||||||
|
- on the nose
|
||||||
|
- on the rocks
|
||||||
|
- on the spot
|
||||||
|
- on the tip of my tongue
|
||||||
|
- on the wagon
|
||||||
|
- on thin ice
|
||||||
|
- once bitten, twice shy
|
||||||
|
- one bad apple doesn't spoil the bushel
|
||||||
|
- one born every minute
|
||||||
|
- one brick short
|
||||||
|
- one foot in the grave
|
||||||
|
- one in a million
|
||||||
|
- one red cent
|
||||||
|
- only game in town
|
||||||
|
- open a can of worms
|
||||||
|
- open and shut case
|
||||||
|
- open the flood gates
|
||||||
|
- opportunity doesn't knock twice
|
||||||
|
- out of pocket
|
||||||
|
- out of sight, out of mind
|
||||||
|
- out of the frying pan into the fire
|
||||||
|
- out of the woods
|
||||||
|
- out on a limb
|
||||||
|
- over a barrel
|
||||||
|
- over the hump
|
||||||
|
- pain and suffering
|
||||||
|
- pain in the
|
||||||
|
- panic button
|
||||||
|
- par for the course
|
||||||
|
- part and parcel
|
||||||
|
- party pooper
|
||||||
|
- pass the buck
|
||||||
|
- patience is a virtue
|
||||||
|
- pay through the nose
|
||||||
|
- penny pincher
|
||||||
|
- perfect storm
|
||||||
|
- pig in a poke
|
||||||
|
- pile it on
|
||||||
|
- pillar of the community
|
||||||
|
- pin your hopes on
|
||||||
|
- pitter patter of little feet
|
||||||
|
- plain as day
|
||||||
|
- plain as the nose on your face
|
||||||
|
- play by the rules
|
||||||
|
- play your cards right
|
||||||
|
- playing the field
|
||||||
|
- playing with fire
|
||||||
|
- pleased as punch
|
||||||
|
- plenty of fish in the sea
|
||||||
|
- point with pride
|
||||||
|
- poor as a church mouse
|
||||||
|
- pot calling the kettle black
|
||||||
|
- pretty as a picture
|
||||||
|
- pull a fast one
|
||||||
|
- pull your punches
|
||||||
|
- pulling your leg
|
||||||
|
- pure as the driven snow
|
||||||
|
- put it in a nutshell
|
||||||
|
- put one over on you
|
||||||
|
- put the cart before the horse
|
||||||
|
- put the pedal to the metal
|
||||||
|
- put your best foot forward
|
||||||
|
- put your foot down
|
||||||
|
- quick as a bunny
|
||||||
|
- quick as a lick
|
||||||
|
- quick as a wink
|
||||||
|
- quick as lightning
|
||||||
|
- quiet as a dormouse
|
||||||
|
- rags to riches
|
||||||
|
- raining buckets
|
||||||
|
- raining cats and dogs
|
||||||
|
- rank and file
|
||||||
|
- rat race
|
||||||
|
- reap what you sow
|
||||||
|
- red as a beet
|
||||||
|
- red herring
|
||||||
|
- reinvent the wheel
|
||||||
|
- rich and famous
|
||||||
|
- rings a bell
|
||||||
|
- ripe old age
|
||||||
|
- ripped me off
|
||||||
|
- rise and shine
|
||||||
|
- road to hell is paved with good intentions
|
||||||
|
- rob Peter to pay Paul
|
||||||
|
- roll over in the grave
|
||||||
|
- rub the wrong way
|
||||||
|
- ruled the roost
|
||||||
|
- running in circles
|
||||||
|
- sad but true
|
||||||
|
- sadder but wiser
|
||||||
|
- salt of the earth
|
||||||
|
- scared stiff
|
||||||
|
- scared to death
|
||||||
|
- sealed with a kiss
|
||||||
|
- second to none
|
||||||
|
- see eye to eye
|
||||||
|
- seen the light
|
||||||
|
- seize the day
|
||||||
|
- set the record straight
|
||||||
|
- set the world on fire
|
||||||
|
- set your teeth on edge
|
||||||
|
- sharp as a tack
|
||||||
|
- shoot for the moon
|
||||||
|
- shoot the breeze
|
||||||
|
- shot in the dark
|
||||||
|
- shoulder to the wheel
|
||||||
|
- sick as a dog
|
||||||
|
- sigh of relief
|
||||||
|
- signed, sealed, and delivered
|
||||||
|
- sink or swim
|
||||||
|
- six of one, half a dozen of another
|
||||||
|
- skating on thin ice
|
||||||
|
- slept like a log
|
||||||
|
- slinging mud
|
||||||
|
- slippery as an eel
|
||||||
|
- slow as molasses
|
||||||
|
- smart as a whip
|
||||||
|
- smooth as a baby's bottom
|
||||||
|
- sneaking suspicion
|
||||||
|
- snug as a bug in a rug
|
||||||
|
- sow wild oats
|
||||||
|
- spare the rod, spoil the child
|
||||||
|
- speak of the devil
|
||||||
|
- spilled the beans
|
||||||
|
- spinning your wheels
|
||||||
|
- spitting image of
|
||||||
|
- spoke with relish
|
||||||
|
- spread like wildfire
|
||||||
|
- spring to life
|
||||||
|
- squeaky wheel gets the grease
|
||||||
|
- stands out like a sore thumb
|
||||||
|
- start from scratch
|
||||||
|
- stick in the mud
|
||||||
|
- still waters run deep
|
||||||
|
- stitch in time
|
||||||
|
- stop and smell the roses
|
||||||
|
- straight as an arrow
|
||||||
|
- straw that broke the camel's back
|
||||||
|
- strong as an ox
|
||||||
|
- stubborn as a mule
|
||||||
|
- stuff that dreams are made of
|
||||||
|
- stuffed shirt
|
||||||
|
- sweating blood
|
||||||
|
- sweating bullets
|
||||||
|
- take a load off
|
||||||
|
- take one for the team
|
||||||
|
- take the bait
|
||||||
|
- take the bull by the horns
|
||||||
|
- take the plunge
|
||||||
|
- takes one to know one
|
||||||
|
- takes two to tango
|
||||||
|
- the more the merrier
|
||||||
|
- the real deal
|
||||||
|
- the real McCoy
|
||||||
|
- the red carpet treatment
|
||||||
|
- the same old story
|
||||||
|
- there is no accounting for taste
|
||||||
|
- thick as a brick
|
||||||
|
- thick as thieves
|
||||||
|
- thin as a rail
|
||||||
|
- think outside of the box
|
||||||
|
- third time's the charm
|
||||||
|
- this day and age
|
||||||
|
- this hurts me worse than it hurts you
|
||||||
|
- this point in time
|
||||||
|
- three sheets to the wind
|
||||||
|
- through thick and thin
|
||||||
|
- throw in the towel
|
||||||
|
- tie one on
|
||||||
|
- tighter than a drum
|
||||||
|
- time and time again
|
||||||
|
- time is of the essence
|
||||||
|
- tip of the iceberg
|
||||||
|
- tired but happy
|
||||||
|
- to coin a phrase
|
||||||
|
- to each his own
|
||||||
|
- to make a long story short
|
||||||
|
- to the best of my knowledge
|
||||||
|
- toe the line
|
||||||
|
- tongue in cheek
|
||||||
|
- too good to be true
|
||||||
|
- too hot to handle
|
||||||
|
- too numerous to mention
|
||||||
|
- touch with a ten foot pole
|
||||||
|
- tough as nails
|
||||||
|
- trial and error
|
||||||
|
- trials and tribulations
|
||||||
|
- tried and true
|
||||||
|
- trip down memory lane
|
||||||
|
- twist of fate
|
||||||
|
- two cents worth
|
||||||
|
- two peas in a pod
|
||||||
|
- ugly as sin
|
||||||
|
- under the counter
|
||||||
|
- under the gun
|
||||||
|
- under the same roof
|
||||||
|
- under the weather
|
||||||
|
- until the cows come home
|
||||||
|
- unvarnished truth
|
||||||
|
- up the creek
|
||||||
|
- uphill battle
|
||||||
|
- upper crust
|
||||||
|
- upset the applecart
|
||||||
|
- vain attempt
|
||||||
|
- vain effort
|
||||||
|
- vanquish the enemy
|
||||||
|
- vested interest
|
||||||
|
- waiting for the other shoe to drop
|
||||||
|
- wakeup call
|
||||||
|
- warm welcome
|
||||||
|
- watch your p's and q's
|
||||||
|
- watch your tongue
|
||||||
|
- watching the clock
|
||||||
|
- water under the bridge
|
||||||
|
- weather the storm
|
||||||
|
- weed them out
|
||||||
|
- week of Sundays
|
||||||
|
- went belly up
|
||||||
|
- wet behind the ears
|
||||||
|
- what goes around comes around
|
||||||
|
- what you see is what you get
|
||||||
|
- when it rains, it pours
|
||||||
|
- when push comes to shove
|
||||||
|
- when the cat's away
|
||||||
|
- when the going gets tough, the tough get going
|
||||||
|
- white as a sheet
|
||||||
|
- whole ball of wax
|
||||||
|
- whole hog
|
||||||
|
- whole nine yards
|
||||||
|
- wild goose chase
|
||||||
|
- will wonders never cease?
|
||||||
|
- wisdom of the ages
|
||||||
|
- wise as an owl
|
||||||
|
- wolf at the door
|
||||||
|
- words fail me
|
||||||
|
- work like a dog
|
||||||
|
- world weary
|
||||||
|
- worst nightmare
|
||||||
|
- worth its weight in gold
|
||||||
|
- wrong side of the bed
|
||||||
|
- yanking your chain
|
||||||
|
- yappy as a dog
|
||||||
|
- years young
|
||||||
|
- you are what you eat
|
||||||
|
- you can run but you can't hide
|
||||||
|
- you only live once
|
||||||
|
- you're the boss
|
||||||
|
- young and foolish
|
||||||
|
- young and vibrant
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Try to avoid using '%s'."
|
||||||
|
ignorecase: true
|
||||||
|
level: suggestion
|
||||||
|
tokens:
|
||||||
|
- am
|
||||||
|
- are
|
||||||
|
- aren't
|
||||||
|
- be
|
||||||
|
- been
|
||||||
|
- being
|
||||||
|
- he's
|
||||||
|
- here's
|
||||||
|
- here's
|
||||||
|
- how's
|
||||||
|
- i'm
|
||||||
|
- is
|
||||||
|
- isn't
|
||||||
|
- it's
|
||||||
|
- she's
|
||||||
|
- that's
|
||||||
|
- there's
|
||||||
|
- they're
|
||||||
|
- was
|
||||||
|
- wasn't
|
||||||
|
- we're
|
||||||
|
- were
|
||||||
|
- weren't
|
||||||
|
- what's
|
||||||
|
- where's
|
||||||
|
- who's
|
||||||
|
- you're
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
extends: repetition
|
||||||
|
message: "'%s' is repeated!"
|
||||||
|
level: warning
|
||||||
|
alpha: true
|
||||||
|
action:
|
||||||
|
name: edit
|
||||||
|
params:
|
||||||
|
- truncate
|
||||||
|
- " "
|
||||||
|
tokens:
|
||||||
|
- '[^\s]+'
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' may be passive voice. Use active voice if you can."
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
raw:
|
||||||
|
- \b(am|are|were|being|is|been|was|be)\b\s*
|
||||||
|
tokens:
|
||||||
|
- '[\w]+ed'
|
||||||
|
- awoken
|
||||||
|
- beat
|
||||||
|
- become
|
||||||
|
- been
|
||||||
|
- begun
|
||||||
|
- bent
|
||||||
|
- beset
|
||||||
|
- bet
|
||||||
|
- bid
|
||||||
|
- bidden
|
||||||
|
- bitten
|
||||||
|
- bled
|
||||||
|
- blown
|
||||||
|
- born
|
||||||
|
- bought
|
||||||
|
- bound
|
||||||
|
- bred
|
||||||
|
- broadcast
|
||||||
|
- broken
|
||||||
|
- brought
|
||||||
|
- built
|
||||||
|
- burnt
|
||||||
|
- burst
|
||||||
|
- cast
|
||||||
|
- caught
|
||||||
|
- chosen
|
||||||
|
- clung
|
||||||
|
- come
|
||||||
|
- cost
|
||||||
|
- crept
|
||||||
|
- cut
|
||||||
|
- dealt
|
||||||
|
- dived
|
||||||
|
- done
|
||||||
|
- drawn
|
||||||
|
- dreamt
|
||||||
|
- driven
|
||||||
|
- drunk
|
||||||
|
- dug
|
||||||
|
- eaten
|
||||||
|
- fallen
|
||||||
|
- fed
|
||||||
|
- felt
|
||||||
|
- fit
|
||||||
|
- fled
|
||||||
|
- flown
|
||||||
|
- flung
|
||||||
|
- forbidden
|
||||||
|
- foregone
|
||||||
|
- forgiven
|
||||||
|
- forgotten
|
||||||
|
- forsaken
|
||||||
|
- fought
|
||||||
|
- found
|
||||||
|
- frozen
|
||||||
|
- given
|
||||||
|
- gone
|
||||||
|
- gotten
|
||||||
|
- ground
|
||||||
|
- grown
|
||||||
|
- heard
|
||||||
|
- held
|
||||||
|
- hidden
|
||||||
|
- hit
|
||||||
|
- hung
|
||||||
|
- hurt
|
||||||
|
- kept
|
||||||
|
- knelt
|
||||||
|
- knit
|
||||||
|
- known
|
||||||
|
- laid
|
||||||
|
- lain
|
||||||
|
- leapt
|
||||||
|
- learnt
|
||||||
|
- led
|
||||||
|
- left
|
||||||
|
- lent
|
||||||
|
- let
|
||||||
|
- lighted
|
||||||
|
- lost
|
||||||
|
- made
|
||||||
|
- meant
|
||||||
|
- met
|
||||||
|
- misspelt
|
||||||
|
- mistaken
|
||||||
|
- mown
|
||||||
|
- overcome
|
||||||
|
- overdone
|
||||||
|
- overtaken
|
||||||
|
- overthrown
|
||||||
|
- paid
|
||||||
|
- pled
|
||||||
|
- proven
|
||||||
|
- put
|
||||||
|
- quit
|
||||||
|
- read
|
||||||
|
- rid
|
||||||
|
- ridden
|
||||||
|
- risen
|
||||||
|
- run
|
||||||
|
- rung
|
||||||
|
- said
|
||||||
|
- sat
|
||||||
|
- sawn
|
||||||
|
- seen
|
||||||
|
- sent
|
||||||
|
- set
|
||||||
|
- sewn
|
||||||
|
- shaken
|
||||||
|
- shaven
|
||||||
|
- shed
|
||||||
|
- shod
|
||||||
|
- shone
|
||||||
|
- shorn
|
||||||
|
- shot
|
||||||
|
- shown
|
||||||
|
- shrunk
|
||||||
|
- shut
|
||||||
|
- slain
|
||||||
|
- slept
|
||||||
|
- slid
|
||||||
|
- slit
|
||||||
|
- slung
|
||||||
|
- smitten
|
||||||
|
- sold
|
||||||
|
- sought
|
||||||
|
- sown
|
||||||
|
- sped
|
||||||
|
- spent
|
||||||
|
- spilt
|
||||||
|
- spit
|
||||||
|
- split
|
||||||
|
- spoken
|
||||||
|
- spread
|
||||||
|
- sprung
|
||||||
|
- spun
|
||||||
|
- stolen
|
||||||
|
- stood
|
||||||
|
- stridden
|
||||||
|
- striven
|
||||||
|
- struck
|
||||||
|
- strung
|
||||||
|
- stuck
|
||||||
|
- stung
|
||||||
|
- stunk
|
||||||
|
- sung
|
||||||
|
- sunk
|
||||||
|
- swept
|
||||||
|
- swollen
|
||||||
|
- sworn
|
||||||
|
- swum
|
||||||
|
- swung
|
||||||
|
- taken
|
||||||
|
- taught
|
||||||
|
- thought
|
||||||
|
- thrived
|
||||||
|
- thrown
|
||||||
|
- thrust
|
||||||
|
- told
|
||||||
|
- torn
|
||||||
|
- trodden
|
||||||
|
- understood
|
||||||
|
- upheld
|
||||||
|
- upset
|
||||||
|
- wed
|
||||||
|
- wept
|
||||||
|
- withheld
|
||||||
|
- withstood
|
||||||
|
- woken
|
||||||
|
- won
|
||||||
|
- worn
|
||||||
|
- wound
|
||||||
|
- woven
|
||||||
|
- written
|
||||||
|
- wrung
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
Based on [write-good](https://github.com/btford/write-good).
|
||||||
|
|
||||||
|
> Naive linter for English prose for developers who can't write good and wanna learn to do other stuff good too.
|
||||||
|
|
||||||
|
```
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014 Brian Ford
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
```
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't start a sentence with '%s'."
|
||||||
|
level: error
|
||||||
|
raw:
|
||||||
|
- '(?:[;-]\s)so[\s,]|\bSo[\s,]'
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "Don't start a sentence with '%s'."
|
||||||
|
ignorecase: false
|
||||||
|
level: error
|
||||||
|
raw:
|
||||||
|
- '(?:[;-]\s)There\s(is|are)|\bThere\s(is|are)\b'
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' is too wordy."
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- a number of
|
||||||
|
- abundance
|
||||||
|
- accede to
|
||||||
|
- accelerate
|
||||||
|
- accentuate
|
||||||
|
- accompany
|
||||||
|
- accomplish
|
||||||
|
- accorded
|
||||||
|
- accrue
|
||||||
|
- acquiesce
|
||||||
|
- acquire
|
||||||
|
- additional
|
||||||
|
- adjacent to
|
||||||
|
- adjustment
|
||||||
|
- admissible
|
||||||
|
- advantageous
|
||||||
|
- adversely impact
|
||||||
|
- advise
|
||||||
|
- aforementioned
|
||||||
|
- aggregate
|
||||||
|
- aircraft
|
||||||
|
- all of
|
||||||
|
- all things considered
|
||||||
|
- alleviate
|
||||||
|
- allocate
|
||||||
|
- along the lines of
|
||||||
|
- already existing
|
||||||
|
- alternatively
|
||||||
|
- amazing
|
||||||
|
- ameliorate
|
||||||
|
- anticipate
|
||||||
|
- apparent
|
||||||
|
- appreciable
|
||||||
|
- as a matter of fact
|
||||||
|
- as a means of
|
||||||
|
- as far as I'm concerned
|
||||||
|
- as of yet
|
||||||
|
- as to
|
||||||
|
- as yet
|
||||||
|
- ascertain
|
||||||
|
- assistance
|
||||||
|
- at the present time
|
||||||
|
- at this time
|
||||||
|
- attain
|
||||||
|
- attributable to
|
||||||
|
- authorize
|
||||||
|
- because of the fact that
|
||||||
|
- belated
|
||||||
|
- benefit from
|
||||||
|
- bestow
|
||||||
|
- by means of
|
||||||
|
- by virtue of
|
||||||
|
- by virtue of the fact that
|
||||||
|
- cease
|
||||||
|
- close proximity
|
||||||
|
- commence
|
||||||
|
- comply with
|
||||||
|
- concerning
|
||||||
|
- consequently
|
||||||
|
- consolidate
|
||||||
|
- constitutes
|
||||||
|
- demonstrate
|
||||||
|
- depart
|
||||||
|
- designate
|
||||||
|
- discontinue
|
||||||
|
- due to the fact that
|
||||||
|
- each and every
|
||||||
|
- economical
|
||||||
|
- eliminate
|
||||||
|
- elucidate
|
||||||
|
- employ
|
||||||
|
- endeavor
|
||||||
|
- enumerate
|
||||||
|
- equitable
|
||||||
|
- equivalent
|
||||||
|
- evaluate
|
||||||
|
- evidenced
|
||||||
|
- exclusively
|
||||||
|
- expedite
|
||||||
|
- expend
|
||||||
|
- expiration
|
||||||
|
- facilitate
|
||||||
|
- factual evidence
|
||||||
|
- feasible
|
||||||
|
- finalize
|
||||||
|
- first and foremost
|
||||||
|
- for all intents and purposes
|
||||||
|
- for the most part
|
||||||
|
- for the purpose of
|
||||||
|
- forfeit
|
||||||
|
- formulate
|
||||||
|
- have a tendency to
|
||||||
|
- honest truth
|
||||||
|
- however
|
||||||
|
- if and when
|
||||||
|
- impacted
|
||||||
|
- implement
|
||||||
|
- in a manner of speaking
|
||||||
|
- in a timely manner
|
||||||
|
- in a very real sense
|
||||||
|
- in accordance with
|
||||||
|
- in addition
|
||||||
|
- in all likelihood
|
||||||
|
- in an effort to
|
||||||
|
- in between
|
||||||
|
- in excess of
|
||||||
|
- in lieu of
|
||||||
|
- in light of the fact that
|
||||||
|
- in many cases
|
||||||
|
- in my opinion
|
||||||
|
- in order to
|
||||||
|
- in regard to
|
||||||
|
- in some instances
|
||||||
|
- in terms of
|
||||||
|
- in the case of
|
||||||
|
- in the event that
|
||||||
|
- in the final analysis
|
||||||
|
- in the nature of
|
||||||
|
- in the near future
|
||||||
|
- in the process of
|
||||||
|
- inception
|
||||||
|
- incumbent upon
|
||||||
|
- indicate
|
||||||
|
- indication
|
||||||
|
- initiate
|
||||||
|
- irregardless
|
||||||
|
- is applicable to
|
||||||
|
- is authorized to
|
||||||
|
- is responsible for
|
||||||
|
- it is
|
||||||
|
- it is essential
|
||||||
|
- it seems that
|
||||||
|
- it was
|
||||||
|
- magnitude
|
||||||
|
- maximum
|
||||||
|
- methodology
|
||||||
|
- minimize
|
||||||
|
- minimum
|
||||||
|
- modify
|
||||||
|
- monitor
|
||||||
|
- multiple
|
||||||
|
- necessitate
|
||||||
|
- nevertheless
|
||||||
|
- not certain
|
||||||
|
- not many
|
||||||
|
- not often
|
||||||
|
- not unless
|
||||||
|
- not unlike
|
||||||
|
- notwithstanding
|
||||||
|
- null and void
|
||||||
|
- numerous
|
||||||
|
- objective
|
||||||
|
- obligate
|
||||||
|
- obtain
|
||||||
|
- on the contrary
|
||||||
|
- on the other hand
|
||||||
|
- one particular
|
||||||
|
- optimum
|
||||||
|
- overall
|
||||||
|
- owing to the fact that
|
||||||
|
- participate
|
||||||
|
- particulars
|
||||||
|
- pass away
|
||||||
|
- pertaining to
|
||||||
|
- point in time
|
||||||
|
- portion
|
||||||
|
- possess
|
||||||
|
- preclude
|
||||||
|
- previously
|
||||||
|
- prior to
|
||||||
|
- prioritize
|
||||||
|
- procure
|
||||||
|
- proficiency
|
||||||
|
- provided that
|
||||||
|
- purchase
|
||||||
|
- put simply
|
||||||
|
- readily apparent
|
||||||
|
- refer back
|
||||||
|
- regarding
|
||||||
|
- relocate
|
||||||
|
- remainder
|
||||||
|
- remuneration
|
||||||
|
- requirement
|
||||||
|
- reside
|
||||||
|
- residence
|
||||||
|
- retain
|
||||||
|
- satisfy
|
||||||
|
- shall
|
||||||
|
- should you wish
|
||||||
|
- similar to
|
||||||
|
- solicit
|
||||||
|
- span across
|
||||||
|
- strategize
|
||||||
|
- subsequent
|
||||||
|
- substantial
|
||||||
|
- successfully complete
|
||||||
|
- sufficient
|
||||||
|
- terminate
|
||||||
|
- the month of
|
||||||
|
- the point I am trying to make
|
||||||
|
- therefore
|
||||||
|
- time period
|
||||||
|
- took advantage of
|
||||||
|
- transmit
|
||||||
|
- transpire
|
||||||
|
- type of
|
||||||
|
- until such time as
|
||||||
|
- utilization
|
||||||
|
- utilize
|
||||||
|
- validate
|
||||||
|
- various different
|
||||||
|
- what I mean to say is
|
||||||
|
- whether or not
|
||||||
|
- with respect to
|
||||||
|
- with the exception of
|
||||||
|
- witnessed
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
extends: existence
|
||||||
|
message: "'%s' is a weasel word!"
|
||||||
|
ignorecase: true
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- clearly
|
||||||
|
- completely
|
||||||
|
- exceedingly
|
||||||
|
- excellent
|
||||||
|
- extremely
|
||||||
|
- fairly
|
||||||
|
- huge
|
||||||
|
- interestingly
|
||||||
|
- is a number
|
||||||
|
- largely
|
||||||
|
- mostly
|
||||||
|
- obviously
|
||||||
|
- quite
|
||||||
|
- relatively
|
||||||
|
- remarkably
|
||||||
|
- several
|
||||||
|
- significantly
|
||||||
|
- substantially
|
||||||
|
- surprisingly
|
||||||
|
- tiny
|
||||||
|
- usually
|
||||||
|
- various
|
||||||
|
- vast
|
||||||
|
- very
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"feed": "https://github.com/errata-ai/write-good/releases.atom",
|
||||||
|
"vale_version": ">=1.0.0"
|
||||||
|
}
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
# AGENTS.md — Project Conventions for GRM
|
# AGENTS.md — Project Conventions for GRM
|
||||||
|
|
||||||
|
## Virtual Environment
|
||||||
|
|
||||||
|
All Python tools, tests, and scripts run inside a standard `.venv` directory.
|
||||||
|
Activate it before running any non-`make` command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source activate.sh # bash/zsh
|
||||||
|
source activate.fish # fish
|
||||||
|
source activate.zsh # zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
If `.venv` doesn't exist, run `make setup` first. The `make` targets handle
|
||||||
|
venv activation automatically — always prefer `make <target>` over raw commands.
|
||||||
|
|
||||||
## Build & Test Commands
|
## Build & Test Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -37,31 +51,60 @@ Workflow YAML files (`.gitea/workflows/*.yml`) are verified with two tools:
|
|||||||
|
|
||||||
Both run via `make workflow-check` and are part of `make lint-all`.
|
Both run via `make workflow-check` and are part of `make lint-all`.
|
||||||
The pre-commit hook runs actionlint automatically when workflow files change.
|
The pre-commit hook runs actionlint automatically when workflow files change.
|
||||||
The CI `quality` job runs `make setup` (which installs all tools) then `make lint-all`.
|
The CI `validate` job runs `make setup-image` (which installs all tools) then `make lint-all`.
|
||||||
CI also runs a best-effort `make workflow-dryrun` step (skipped if act_runner is not installed in the CI Docker image).
|
CI also runs a best-effort `make workflow-dryrun` step (skipped if act_runner is not installed in the CI Docker image).
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
- **Python CLI** (`src/gitea_runner_manager/`) — Click-based CLI that delegates to Ansible
|
- **Python CLI** (`src/grm/`) — Click-based CLI that delegates to Ansible
|
||||||
- **Ansible Role** (`ansible/roles/gitea-runner/`) — Idempotent role for rootless Docker runner setup
|
- **Ansible Role** (`ansible/roles/gitea_runner/`) — Idempotent role for rootless Docker runner setup with pasta networking (IPv6 support)
|
||||||
- **devx package** (installed from git) — Reusable CI/CD tools: auto-merge, post-merge, release, publishing, molecule distribution, PR reviews, failure notifications
|
- **devx package** (installed from git) — Reusable CI/CD tools: auto-merge, post-merge, release, publishing, molecule distribution, PR reviews, failure notifications
|
||||||
- **Versioning** (`cliff.toml`) — git-cliff configuration for automated semver versioning from conventional commits
|
- **Versioning** (`cliff.toml`) — git-cliff configuration for automated semver versioning from conventional commits
|
||||||
|
|
||||||
|
|
||||||
|
## Spec-Driven Development
|
||||||
|
|
||||||
|
Every change starts with a spec. No spec, no code.
|
||||||
|
|
||||||
|
**Workflow:**
|
||||||
|
1. Create Vikunja task → get `<PREFIX>-N` task ID
|
||||||
|
2. Write spec at `docs/specs/<TASK-ID>.md` (see template in `.devin/skills/spec-driven-development/SKILL.md`)
|
||||||
|
3. Create branch, implement with `# Implements: REQ-N` comments
|
||||||
|
4. Tick all acceptance criteria checkboxes in spec
|
||||||
|
5. Push and create PR — CI validates spec before expensive jobs
|
||||||
|
|
||||||
|
**CI gates (pre-merge):**
|
||||||
|
- `devx.ci.validate_spec` — checks spec exists, has required sections, REQ-IDs, all ACs checked
|
||||||
|
- `devx.ci.check_pr_size` — max 500 lines / 10 files (excludes CHANGELOG, badges, locks)
|
||||||
|
- `devx.ci.fast_molecule` — converge+verify only for changed roles, single platform
|
||||||
|
|
||||||
|
**Nightly (infra only):**
|
||||||
|
- Full molecule suite (all scenarios, all platforms) + staging deploy + integration tests
|
||||||
|
- On failure: sets `NIGHTLY_STATUS=failed`, blocks staging deploys
|
||||||
|
- Post-merge auto-deploy to staging checks this gate before deploying
|
||||||
|
|
||||||
|
**Post-merge:**
|
||||||
|
- Infra: auto-deploys to staging (if nightly gate is green)
|
||||||
|
- GRM/sso-bridge: auto-publishes package, auto-creates infra dependency PR to bump pinned version
|
||||||
|
|
||||||
|
**Skill:** `.devin/skills/spec-driven-development/SKILL.md` — full template and workflow details.
|
||||||
|
|
||||||
## PR Workflow (Mandatory)
|
## PR Workflow (Mandatory)
|
||||||
|
|
||||||
|
|
||||||
Every change to master goes through this workflow. No exceptions.
|
Every change to master goes through this workflow. No exceptions.
|
||||||
|
|
||||||
### Branch Protection (Required Gitea Settings)
|
### Branch Protection (Required Gitea Settings)
|
||||||
|
|
||||||
Branch protection and labels are automatically configured by
|
Branch protection and labels are automatically configured by
|
||||||
`devx.tools.configure_repo` (run as `python -m devx.tools.configure_repo`),
|
`devx.tools.configure_repo` (run as `python -m devx.tools.configure_repo`),
|
||||||
which runs as a `configure-repo` job in
|
which runs as a step in the `detect-and-configure` job in
|
||||||
the post-merge workflow on every push to master.
|
the post-merge workflow on every push to master.
|
||||||
|
|
||||||
The following rules are enforced for `master`:
|
The following rules are enforced for `master`:
|
||||||
- **Require pull request**: No direct pushes to master
|
- **Require pull request**: No direct pushes to master
|
||||||
- **Require approval review**: At least 1 `APPROVE` review before merge
|
- **Require approval review**: At least 1 `APPROVE` review before merge
|
||||||
- **Require status checks**: CI quality + molecule tests must pass
|
- **Require status checks**: CI validate + molecule tests must pass
|
||||||
- **Block force pushes**: No history rewriting on master
|
- **Block force pushes**: No history rewriting on master
|
||||||
|
|
||||||
The auto-merge workflow enforces the APPROVE review check programmatically
|
The auto-merge workflow enforces the APPROVE review check programmatically
|
||||||
@@ -70,6 +113,12 @@ as a defense-in-depth measure, but branch protection is the primary gate.
|
|||||||
### 1. Create Vikunja Task
|
### 1. Create Vikunja Task
|
||||||
Create a task in Vikunja project 6 via `make create-task -- --title "Task title" --description "<h2>...</h2>"` (requires `VIKUNJA_TOKEN` in `.env`). This prints the `GRM-N` identifier and next-step instructions.
|
Create a task in Vikunja project 6 via `make create-task -- --title "Task title" --description "<h2>...</h2>"` (requires `VIKUNJA_TOKEN` in `.env`). This prints the `GRM-N` identifier and next-step instructions.
|
||||||
|
|
||||||
|
**IMPORTANT:** The task title must NOT include the `GRM-N:` prefix.
|
||||||
|
The `make create-pr` and `check_auto_merge_ready` commands automatically
|
||||||
|
prepend `GRM-N: ` to the Vikunja task title when forming the PR title.
|
||||||
|
If the Vikunja task title already includes the prefix, the PR title will
|
||||||
|
have a double prefix and auto-merge validation will fail.
|
||||||
|
|
||||||
### 2. Create Branch
|
### 2. Create Branch
|
||||||
```bash
|
```bash
|
||||||
git checkout master && git pull
|
git checkout master && git pull
|
||||||
@@ -83,7 +132,7 @@ git checkout -b GRM-N-short-description
|
|||||||
|
|
||||||
### 4. Commit (Conventional Commits)
|
### 4. Commit (Conventional Commits)
|
||||||
Branch commits use conventional commit format (no `GRM-N:` prefix):
|
Branch commits use conventional commit format (no `GRM-N:` prefix):
|
||||||
```
|
```text
|
||||||
feat: add new feature
|
feat: add new feature
|
||||||
fix: resolve bug
|
fix: resolve bug
|
||||||
docs: update README
|
docs: update README
|
||||||
@@ -98,76 +147,30 @@ docs: update README
|
|||||||
|
|
||||||
### 6. Review the PR (Mandatory — Before Adding ready-to-merge Label)
|
### 6. Review the PR (Mandatory — Before Adding ready-to-merge Label)
|
||||||
|
|
||||||
**Review checklist:** Every PR is reviewed against 13 categories covering
|
**Review checklist:** Every PR is reviewed against 8 categories covering
|
||||||
architecture, code quality, security, i18n, testing, performance,
|
functional correctness, completeness, architecture, reliability,
|
||||||
UX, documentation, workflow compliance, maintainability, resource
|
robustness, security, technical excellence, and test quality.
|
||||||
management, backwards compatibility, and logging.
|
|
||||||
|
|
||||||
**Automated review (CI `pr-review` job):** Every PR triggers an automated
|
**Deep review (agent-invoked `pr-review` skill):** The agent invokes
|
||||||
review via `devx.ci.pr_review` (run as `python -m devx.ci.pr_review`). This job posts a review with
|
the `pr-review` skill to perform a deep, critical review of the PR.
|
||||||
`COMMENT` (no issues) or `REQUEST_CHANGES` (issues found) based on
|
The skill posts inline comments for each issue found via the Gitea MCP,
|
||||||
the **[auto]** items in the checklist:
|
auto-fixes them, pushes fixes to the PR branch, resolves discussion
|
||||||
|
threads, and posts a brief summary. When no blocking issues remain,
|
||||||
|
the PR is marked `ready-to-merge`.
|
||||||
|
|
||||||
- Architecture compliance (no subprocess in CLI, no hardcoded URLs)
|
See `.devin/skills/pr-review/SKILL.md` for the full review procedure,
|
||||||
- Best practices (no `print()`, no bare `except`, no `TODO`/`FIXME`,
|
categories, and MCP tool reference.
|
||||||
no functions > 50 lines)
|
|
||||||
- Security (no hardcoded secrets, no `shell=True`, no `eval`/`exec`)
|
|
||||||
- i18n (no raw strings in `click.echo()` without `_()` wrapper)
|
|
||||||
- Resource management (no `open()` without `with`, no `Popen()` without cleanup)
|
|
||||||
- Documentation (source changes must include doc updates)
|
|
||||||
- Test coverage (source changes must include test updates)
|
|
||||||
- Commit conventions (conventional commit format on PR commits)
|
|
||||||
|
|
||||||
The automated review posts inline comments on specific lines and
|
|
||||||
includes a summary of the checklist categories. The agent **must** address all
|
|
||||||
`REQUEST_CHANGES` issues before proceeding.
|
|
||||||
|
|
||||||
**Manual review (agent):** After the automated review passes, the agent
|
|
||||||
must go through **every category** listed above and verify
|
|
||||||
the **[manual]** items by reviewing the full diff
|
|
||||||
(`git diff master...HEAD`).
|
|
||||||
|
|
||||||
Post review comments using `devx.ci.pr_review` (run as `python -m devx.ci.pr_review`):
|
|
||||||
```bash
|
|
||||||
CI_GITEA_TOKEN=<token> python -m devx.ci.pr_review <pr_number> <owner/repo> \
|
|
||||||
--event REQUEST_CHANGES \
|
|
||||||
--body "Review summary"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 7. Address Review Comments
|
### 7. Address Review Comments
|
||||||
Fix each comment one by one, commit, and push. Re-review until satisfied.
|
Fix each comment one by one, commit, and push. Re-review until satisfied.
|
||||||
|
|
||||||
### 8. Approve and Merge
|
### 8. Mark Ready to Merge
|
||||||
Once all checklist items are verified and comments are addressed, post
|
Once all issues are addressed, add the `ready-to-merge` label:
|
||||||
an approval review with `--checklist-confirmed` and `--checklist-categories`:
|
|
||||||
```bash
|
```bash
|
||||||
CI_GITEA_TOKEN=<token> python -m devx.ci.pr_review <pr_number> <owner/repo> \
|
make devx-pr-label
|
||||||
--event APPROVE --checklist-confirmed \
|
|
||||||
--checklist-categories 1,2,3,4,5,6,7,8,9,10,11,12,13 \
|
|
||||||
--body "All 13 checklist categories verified. Architecture: <summary>. Security: <summary>. Tests: <summary>. Docs: <summary>."
|
|
||||||
```
|
```
|
||||||
|
The auto-merge workflow posts an APPROVE review via the Gitea API
|
||||||
The `--checklist-confirmed` flag is **required** for APPROVE events —
|
and squash-merges with title `GRM-N: <conventional commit message>`.
|
||||||
it attests that the reviewer has gone through every checklist category.
|
|
||||||
The `--checklist-categories` flag is also **required** — it must list at
|
|
||||||
least 8 of the 13 category numbers, ensuring the reviewer actually
|
|
||||||
checked each category rather than rubber-stamping. The review body must
|
|
||||||
be substantive (> 50 characters) — trivial approvals like "LGTM" are
|
|
||||||
rejected.
|
|
||||||
|
|
||||||
Then add the `ready-to-merge` label. The auto-merge workflow will:
|
|
||||||
1. **Validate** PR title format (`GRM-N: <vikunja task title>`) and match against Vikunja task title
|
|
||||||
2. **Check** that at least one substantive APPROVE review exists (body > 20 chars or has inline comments)
|
|
||||||
3. Wait for all CI checks to pass (including the `pr-review` job)
|
|
||||||
4. Squash-merge with title: `GRM-N: <conventional commit message>`
|
|
||||||
5. The post-merge workflow marks the Vikunja task as done
|
|
||||||
6. The release workflow automatically versions, tags, and publishes (see below)
|
|
||||||
|
|
||||||
**If the branch is behind master** (another PR merged first), auto-merge
|
|
||||||
automatically rebases the PR's head branch via the Gitea API. This triggers
|
|
||||||
a new CI run. The next auto-merge attempt will merge successfully.
|
|
||||||
No manual rebase needed. To rebase manually: `make rebase` (local) or
|
|
||||||
`make pr-rebase` (server-side via API).
|
|
||||||
|
|
||||||
> **IMPORTANT**: Never manually merge PRs via the API. Always use the auto-merge
|
> **IMPORTANT**: Never manually merge PRs via the API. Always use the auto-merge
|
||||||
> workflow by adding the `ready-to-merge` label. Manual merges bypass the
|
> workflow by adding the `ready-to-merge` label. Manual merges bypass the
|
||||||
@@ -175,23 +178,38 @@ No manual rebase needed. To rebase manually: `make rebase` (local) or
|
|||||||
> The auto-merge script validates the PR title matches the Vikunja task ID
|
> The auto-merge script validates the PR title matches the Vikunja task ID
|
||||||
> and conventional commit format before merging.
|
> and conventional commit format before merging.
|
||||||
|
|
||||||
|
The auto-merge workflow will:
|
||||||
|
1. **Validate** PR title format (`GRM-N: <vikunja task title>`) and match against Vikunja task title
|
||||||
|
2. **Post** an APPROVE review via the Gitea API (to satisfy branch protection)
|
||||||
|
3. Wait for all CI checks to pass (including the `validate` job)
|
||||||
|
4. Squash-merge with title: `GRM-N: <conventional commit message>`
|
||||||
|
5. The post-merge workflow marks the Vikunja task as done
|
||||||
|
6. The release-and-maintain job automatically versions, tags, and publishes (see below)
|
||||||
|
|
||||||
|
**If the branch is behind master** (another PR merged first), auto-merge
|
||||||
|
automatically rebases the PR's head branch via the Gitea API. This triggers
|
||||||
|
a new CI run. The next auto-merge attempt will merge successfully.
|
||||||
|
No manual rebase needed. To rebase manually: `make rebase` (local) or
|
||||||
|
`make pr-rebase` (server-side via API).
|
||||||
|
|
||||||
### CI Path Filtering
|
### CI Path Filtering
|
||||||
|
|
||||||
The CI workflow includes a `pre-merge-check` job (runs after quality +
|
The CI workflow's `validate` job includes a pre-merge validation step
|
||||||
detect-changes) that validates branch format, PR title, and Vikunja task
|
that validates branch format, PR title, and Vikunja task match. This
|
||||||
match. This fails fast before expensive molecule tests run.
|
fails fast before expensive molecule tests run.
|
||||||
|
|
||||||
The CI workflow includes a `detect-changes` job that checks whether any files
|
The `validate` job also includes a `detect-changes` step that checks
|
||||||
under `ansible/` or `.ansible-lint` have changed. If no Ansible files are
|
whether any files under `ansible/` or `.ansible-lint` have changed. If
|
||||||
changed, molecule tests are skipped — this prevents non-Ansible changes
|
no Ansible files are changed, molecule tests are skipped — this prevents
|
||||||
(e.g., Python scripts, workflow YAML, docs) from being blocked by molecule
|
non-Ansible changes (e.g., Python scripts, workflow YAML, docs) from
|
||||||
test infrastructure flakiness.
|
being blocked by molecule test infrastructure flakiness.
|
||||||
|
|
||||||
### Dynamic Runner Discovery
|
### Dynamic Runner Discovery
|
||||||
|
|
||||||
Molecule tests are distributed across available Gitea Actions runners
|
Molecule tests are distributed across available Gitea Actions runners
|
||||||
dynamically via `devx.molecule.discover_runners`. The `discover-runners`
|
dynamically via `devx.molecule.discover_runners`. The `validate` job
|
||||||
job queries the Gitea API for runners at all levels (repo, org, instance)
|
includes a `discover-runners` step (conditional on ansible-changed) that
|
||||||
|
queries the Gitea API for runners at all levels (repo, org, instance)
|
||||||
and generates a dynamic matrix. If the API can't see instance-level runners
|
and generates a dynamic matrix. If the API can't see instance-level runners
|
||||||
(no admin scope), it falls back to the `MOLECULE_RUNNERS` repo variable,
|
(no admin scope), it falls back to the `MOLECULE_RUNNERS` repo variable,
|
||||||
then to a default of 3.
|
then to a default of 3.
|
||||||
@@ -204,47 +222,27 @@ then to a default of 3.
|
|||||||
### Automated Release Pipeline
|
### Automated Release Pipeline
|
||||||
|
|
||||||
After a PR is merged to master, the **post-merge workflow**
|
After a PR is merged to master, the **post-merge workflow**
|
||||||
(`.gitea/workflows/post-merge.yml`) runs automatically. This single
|
(`.gitea/workflows/post-merge.yml`) runs automatically. Consolidated
|
||||||
workflow consolidates release, wiki sync, badge generation, and
|
into 2 jobs (from 7) to reduce runner overhead:
|
||||||
Vikunja task updates:
|
|
||||||
|
|
||||||
1. **detect-type** — Checks if the commit is a regular merge or a
|
1. **detect-and-configure** — Configures repo (branch protection, labels),
|
||||||
release commit (`release: vX.Y.Z`). All subsequent jobs skip for
|
detects release commit, validates commit message. Outputs `is-release`
|
||||||
release commits (the `[skip ci]` tag also prevents re-triggering).
|
and `is-automated` for the next job.
|
||||||
|
|
||||||
2. **release** — Runs `devx.ci.release` which:
|
2. **release-and-maintain** — Runs all post-merge maintenance as
|
||||||
- **Checks for user-facing changes** via `devx.ci.classify_changes` — if only
|
conditional steps:
|
||||||
workflow/infrastructure files changed (`.gitea/`, `docs/`, `tests/`,
|
- **release** (if not a release commit) — Runs `devx.ci.release` which
|
||||||
`AGENTS.md`, `Makefile`, etc.), the release is **skipped entirely** — no version
|
checks for user-facing changes via `classify_changes` (skips if only
|
||||||
bump, no tag, no publish. This prevents unnecessary releases for CI/docs-only changes.
|
workflow/infrastructure files changed), uses git-cliff for semver,
|
||||||
- Uses **git-cliff** to calculate the next semver version from conventional commits
|
updates `__version__`, updates `CHANGELOG.md`, runs lint+tests, commits
|
||||||
- Updates `__version__` in `src/gitea_runner_manager/__init__.py` (single source of truth)
|
with `release: vX.Y.Z [skip ci]`, creates annotated tag, pushes to master.
|
||||||
- Updates `CHANGELOG.md` with the new version section
|
- **publish** (if release created a tag) — Builds and publishes the
|
||||||
- **Runs `make lint-ruff` and `make pytest-cov`** to verify the release is healthy
|
package to the Gitea PyPI registry. Checks out the release tag
|
||||||
- If lint or tests fail, **aborts immediately** — no commit, no tag
|
within the same job.
|
||||||
- Commits with `release: vX.Y.Z [skip ci]` prefix (the `[skip ci]` prevents
|
- **sync-wiki** (if not automated) — Syncs documentation to the Gitea wiki.
|
||||||
re-triggering post-merge on the release commit)
|
- **vikunja** (if not automated) — Marks the corresponding Vikunja task as done.
|
||||||
- Creates an annotated tag `vX.Y.Z` on the release commit
|
- **badges** (always) — Generates and pushes quality badge SVGs to the
|
||||||
- Pushes both the commit and tag to master
|
`badges` branch. Fetches latest master first to pick up release commits.
|
||||||
- `--skip-tests` flag bypasses test verification (emergency use only, not recommended)
|
|
||||||
- Loops are prevented by `has_unreleased_changes` — after a release commit is tagged, the next run finds no unreleased changes and exits
|
|
||||||
|
|
||||||
3. **sync-wiki** — Syncs documentation to the Gitea wiki. Runs for ALL
|
|
||||||
non-release commits (not just when release succeeds), so docs-only
|
|
||||||
changes still update the wiki.
|
|
||||||
|
|
||||||
4. **badges** — Generates and pushes quality badge SVGs to the `badges` branch.
|
|
||||||
Uses `if: always()` so it runs on every push, including release commits.
|
|
||||||
The script fetches the latest master before generating badges to pick up
|
|
||||||
any release commits.
|
|
||||||
|
|
||||||
5. **vikunja** — Marks the corresponding Vikunja task as done. Runs for ALL
|
|
||||||
non-release commits (not just when release succeeds), so infrastructure-only
|
|
||||||
changes still update the task tracker.
|
|
||||||
|
|
||||||
6. **publish** — Runs after release succeeds (needs: release). Builds and
|
|
||||||
publishes the package to the Gitea PyPI registry. Gets the tag from the
|
|
||||||
release job's `tag` output.
|
|
||||||
|
|
||||||
### Smart CI: User-Facing vs Workflow-Only Changes
|
### Smart CI: User-Facing vs Workflow-Only Changes
|
||||||
|
|
||||||
@@ -270,15 +268,15 @@ via `[tool.devx.classify]` in `pyproject.toml`.
|
|||||||
- `activate.sh`, `activate.fish`, `activate.zsh` — Generated venv scripts
|
- `activate.sh`, `activate.fish`, `activate.zsh` — Generated venv scripts
|
||||||
|
|
||||||
**User-facing paths** (tool changes → release needed) — everything else:
|
**User-facing paths** (tool changes → release needed) — everything else:
|
||||||
- `src/gitea_runner_manager/**` — Python CLI source (except `__init__.py`)
|
- `src/grm/**` — Python CLI source (except `__init__.py`)
|
||||||
- `ansible/**` — Ansible role
|
- `ansible/**` — Ansible role
|
||||||
- `pyproject.toml` — Package metadata
|
- `pyproject.toml` — Package metadata
|
||||||
- Any new file type not in the allowlist
|
- Any new file type not in the allowlist
|
||||||
|
|
||||||
**devx module structure** (installed from git, not in this repo):
|
**devx module structure** (installed from git, not in this repo):
|
||||||
- `devx.ci.*` — CI/CD automation (run by workflows): release, publish, auto_merge, classify_changes, detect_release_commit, push_badges, doc_coverage, sync_wiki, distribute_molecule, molecule_ci_guard, discover_runners, notify_failure, post_merge, pr_review, validate_commit_msg
|
- `devx.ci.*` — CI/CD automation (run by workflows): release, publish, auto_merge, classify_changes, detect_release_commit, push_badges, doc_coverage, sync_wiki, distribute_molecule, discover_runners, notify_failure, post_merge, validate_commit_msg
|
||||||
- `devx.tools.*` — Dev tools (run locally): check_test_speed, configure_repo, install_checkmake, install_tools, setup, generate_badges, create_task, create_pr, pr_status, pr_logs, pr_label, rebase, pr_rebase
|
- `devx.tools.*` — Dev tools (run locally): check_test_speed, configure_repo, install_checkmake, install_tools, setup, generate_badges, create_task, create_pr, pr_status, pr_logs, pr_label, rebase, pr_rebase
|
||||||
- `devx.molecule.*` — Molecule helpers: molecule_all, platforms, discover_runners, distribute_molecule, molecule_ci_guard
|
- `devx.molecule.*` — Molecule helpers: molecule_all, platforms, discover_runners, distribute_molecule
|
||||||
- `devx.gitea_cli` — Tea CLI wrapper
|
- `devx.gitea_cli` — Tea CLI wrapper
|
||||||
- `devx.i18n` — i18n translation system
|
- `devx.i18n` — i18n translation system
|
||||||
- `devx.config` — Shared configuration (DEVX_* env vars)
|
- `devx.config` — Shared configuration (DEVX_* env vars)
|
||||||
@@ -304,14 +302,14 @@ The codebase enforces strict separation between the GRM tool and the devx packag
|
|||||||
|
|
||||||
| Directory | Purpose | Release impact |
|
| Directory | Purpose | Release impact |
|
||||||
|-----------|---------|----------------|
|
|-----------|---------|----------------|
|
||||||
| `src/gitea_runner_manager/` | User-facing GRM CLI tool | Changes trigger release |
|
| `src/grm/` | User-facing GRM CLI tool | Changes trigger release |
|
||||||
| `devx` package (installed from git) | Reusable CI/CD and dev tools | Not in this repo (no release impact) |
|
| `devx` package (installed from git) | Reusable CI/CD and dev tools | Not in this repo (no release impact) |
|
||||||
| `ansible/` | Ansible role for runner setup | Changes trigger release |
|
| `ansible/` | Ansible role for runner setup | Changes trigger release |
|
||||||
|
|
||||||
### Import Rules
|
### Import Rules
|
||||||
|
|
||||||
1. **`src/gitea_runner_manager/` NEVER imports from devx** — the GRM tool is self-contained
|
1. **`src/grm/` NEVER imports from devx** — the GRM tool is self-contained
|
||||||
2. **devx MAY import from `gitea_runner_manager`** — one-way dependency (devx uses the tool's API clients, config, i18n)
|
2. **devx MAY import from `grm`** — one-way dependency (devx uses the tool's API clients, config, i18n)
|
||||||
3. **Cross-module imports within devx** are allowed (devx modules importing from other devx modules) and must be documented
|
3. **Cross-module imports within devx** are allowed (devx modules importing from other devx modules) and must be documented
|
||||||
4. **`devx.gitea_cli`** is a shared wrapper around the `tea` CLI — devx modules import from it for Gitea API operations (issues, labels, PRs, releases, reviews)
|
4. **`devx.gitea_cli`** is a shared wrapper around the `tea` CLI — devx modules import from it for Gitea API operations (issues, labels, PRs, releases, reviews)
|
||||||
|
|
||||||
@@ -332,21 +330,19 @@ The `tea` Gitea CLI tool is used for Gitea API interactions in devx. It is insta
|
|||||||
- `devx.tools.configure_repo` — Creates labels via `tea labels create` (falls back to `GiteaClient` if tea fails; branch protection still uses `GiteaClient` since tea only supports basic protect/unprotect)
|
- `devx.tools.configure_repo` — Creates labels via `tea labels create` (falls back to `GiteaClient` if tea fails; branch protection still uses `GiteaClient` since tea only supports basic protect/unprotect)
|
||||||
|
|
||||||
**Operations still using `GiteaClient` (not supported by tea):**
|
**Operations still using `GiteaClient` (not supported by tea):**
|
||||||
- PR reviews (`devx.ci.pr_review`) — tea v0.14.1 only supports interactive reviews
|
|
||||||
- Wiki page management (`devx.ci.sync_wiki`)
|
- Wiki page management (`devx.ci.sync_wiki`)
|
||||||
- Commit status checks (`devx.ci.auto_merge`)
|
- Commit status checks (`devx.ci.auto_merge`)
|
||||||
- Runner discovery (`devx.molecule.discover_runners`)
|
- Runner discovery (`devx.molecule.discover_runners`)
|
||||||
- Branch protection with detailed config (`devx.tools.configure_repo`)
|
- Branch protection with detailed config (`devx.tools.configure_repo`)
|
||||||
- PR file/commit listing (`devx.ci.pr_review`)
|
|
||||||
|
|
||||||
### PYTHONPATH Configuration
|
### PYTHONPATH Configuration
|
||||||
|
|
||||||
Since devx is installed as a package (via `pip install` from git), it is importable directly. Workflows only need `PYTHONPATH=src` when a devx module imports from `gitea_runner_manager`:
|
Since devx is installed as a package (via `pip install` from git), it is importable directly. Workflows only need `PYTHONPATH=src` when a devx module imports from `grm`:
|
||||||
|
|
||||||
| PYTHONPATH | When to use | Example modules |
|
| PYTHONPATH | When to use | Example modules |
|
||||||
|------------|-------------|-----------------|
|
|------------|-------------|-----------------|
|
||||||
| `src` | Module imports from `gitea_runner_manager` | `devx.ci.auto_merge`, `devx.ci.pr_review`, `devx.ci.pr_review`, `devx.ci.sync_wiki`, `devx.ci.post_merge`, `devx.ci.classify_changes`, `devx.molecule.discover_runners`, `devx.ci.doc_coverage` |
|
| `src` | Module imports from `grm` | `devx.ci.auto_merge`, `devx.ci.sync_wiki`, `devx.ci.post_merge`, `devx.ci.classify_changes`, `devx.molecule.discover_runners`, `devx.ci.doc_coverage` |
|
||||||
| (none) | Module has no GRM imports | `devx.ci.detect_release_commit`, `devx.molecule.distribute_molecule`, `devx.molecule.molecule_ci_guard`, `devx.ci.push_badges`, `devx.ci.validate_commit_msg` |
|
| (none) | Module has no GRM imports | `devx.ci.detect_release_commit`, `devx.molecule.distribute_molecule`, `devx.ci.push_badges`, `devx.ci.validate_commit_msg` |
|
||||||
|
|
||||||
**In workflows**, always use `env:` blocks (not inline `PYTHONPATH=value`):
|
**In workflows**, always use `env:` blocks (not inline `PYTHONPATH=value`):
|
||||||
```yaml
|
```yaml
|
||||||
@@ -356,7 +352,7 @@ Since devx is installed as a package (via `pip install` from git), it is importa
|
|||||||
run: python -m devx.ci.example
|
run: python -m devx.ci.example
|
||||||
```
|
```
|
||||||
|
|
||||||
**Locally**, devx is installed as a package, so only `PYTHONPATH=src` is needed if importing from `gitea_runner_manager`.
|
**Locally**, devx is installed as a package, so only `PYTHONPATH=src` is needed if importing from `grm`.
|
||||||
|
|
||||||
### Shared Constants
|
### Shared Constants
|
||||||
|
|
||||||
@@ -365,9 +361,9 @@ platform matrix. Both `devx.molecule.distribute_molecule` (CI) and
|
|||||||
`devx.molecule.molecule_all` (dev tool) import `PLATFORMS` from it — this
|
`devx.molecule.molecule_all` (dev tool) import `PLATFORMS` from it — this
|
||||||
avoids dev tools importing directly from CI modules.
|
avoids dev tools importing directly from CI modules.
|
||||||
|
|
||||||
2. **Publish job** (in `post-merge.yml`, needs: release):
|
2. **Publish step** (in the `release-and-maintain` job, runs after the release step creates a tag):
|
||||||
- Runs after the release job creates a tag
|
- Runs after the release step creates a tag
|
||||||
- Gets the tag from `needs.release.outputs.tag`
|
- Gets the tag from the release step's output
|
||||||
- Builds the Python package
|
- Builds the Python package
|
||||||
- Publishes to the Gitea PyPI registry
|
- Publishes to the Gitea PyPI registry
|
||||||
- Creates a Gitea release with git-cliff-generated release notes
|
- Creates a Gitea release with git-cliff-generated release notes
|
||||||
@@ -389,7 +385,7 @@ ensures all merged work appears in the changelog.
|
|||||||
| `feat!:` or `BREAKING CHANGE` | minor (pre-1.0: major would be 1.0.0) |
|
| `feat!:` or `BREAKING CHANGE` | minor (pre-1.0: major would be 1.0.0) |
|
||||||
| `chore:`, `ci:`, `docs:` | no bump (excluded by cliff.toml) |
|
| `chore:`, `ci:`, `docs:` | no bump (excluded by cliff.toml) |
|
||||||
|
|
||||||
The version source is `__version__` in `src/gitea_runner_manager/__init__.py`, read by setuptools via `dynamic = ["version"]` in `pyproject.toml`. The release script only updates `__init__.py` — no need to touch `pyproject.toml`. `grm --version` reports this version.
|
The version source is `__version__` in `src/grm/__init__.py`, read by setuptools via `dynamic = ["version"]` in `pyproject.toml`. The release script only updates `__init__.py` — no need to touch `pyproject.toml`. `grm --version` reports this version.
|
||||||
|
|
||||||
### Title Format Summary
|
### Title Format Summary
|
||||||
|
|
||||||
@@ -405,7 +401,7 @@ The version source is `__version__` in `src/gitea_runner_manager/__init__.py`, r
|
|||||||
The devx package is configured via `DEVX_*` environment variables:
|
The devx package is configured via `DEVX_*` environment variables:
|
||||||
- `DEVX_TASK_PREFIX=GRM` — Prefix for Vikunja task identifiers
|
- `DEVX_TASK_PREFIX=GRM` — Prefix for Vikunja task identifiers
|
||||||
- `DEVX_VIKUNJA_PROJECT_ID=6` — Vikunja project ID for task tracking
|
- `DEVX_VIKUNJA_PROJECT_ID=6` — Vikunja project ID for task tracking
|
||||||
- `DEVX_VERSION_FILE=src/gitea_runner_manager/__init__.py` — Path to the version source file
|
- `DEVX_VERSION_FILE=src/grm/__init__.py` — Path to the version source file
|
||||||
|
|
||||||
Change classification is config-driven via `[tool.devx.classify]` in `pyproject.toml`, which defines the infrastructure and user-facing path patterns.
|
Change classification is config-driven via `[tool.devx.classify]` in `pyproject.toml`, which defines the infrastructure and user-facing path patterns.
|
||||||
|
|
||||||
@@ -419,16 +415,66 @@ Change classification is config-driven via `[tool.devx.classify]` in `pyproject.
|
|||||||
- Secrets are passed via temp JSON files, never on the command line (CWE-214)
|
- Secrets are passed via temp JSON files, never on the command line (CWE-214)
|
||||||
- CI triggers only on `opened` and `synchronize` PR events (not `labeled`)
|
- CI triggers only on `opened` and `synchronize` PR events (not `labeled`)
|
||||||
|
|
||||||
|
### Testing Conventions
|
||||||
|
|
||||||
|
- **Always run `make pytest-cov` before pushing** — CI enforces 100%
|
||||||
|
coverage and will fail the PR if any lines are uncovered. The pre-push
|
||||||
|
hook only validates Vikunja task existence, not tests.
|
||||||
|
- **Never use `is True`/`is False` identity checks on API response
|
||||||
|
values** — many APIs return boolean values as strings (`"true"`/
|
||||||
|
`"false"`). Use string comparison or truthy/falsy helpers instead.
|
||||||
|
- **Always mock `time.sleep` and `time.monotonic` in unit tests** — real
|
||||||
|
sleep calls make tests slow and exceed test speed limits. Use
|
||||||
|
`@patch("time.sleep")` and `@patch("time.monotonic")` decorators.
|
||||||
|
- **Extract complex inline shell from workflows to tested Python tools**
|
||||||
|
— SSH loops, curl polling, docker exec chains, and multi-line
|
||||||
|
if/then/else shell blocks should be Python scripts in `scripts/`
|
||||||
|
with unit tests. Simple variable checks and venv activation are fine
|
||||||
|
as inline shell.
|
||||||
|
|
||||||
|
### Container-Level Fix Verification (Mandatory)
|
||||||
|
|
||||||
|
**Rule:** Before pushing any fix that modifies container state (CA certs,
|
||||||
|
config files, installed packages, daemon restarts), reproduce the exact
|
||||||
|
sequence locally with the actual Docker image. Do not push to CI as the
|
||||||
|
first test.
|
||||||
|
|
||||||
|
This is a hard rule, not a suggestion. CI cycles take 20+ minutes and
|
||||||
|
ephemeral staging VMs are destroyed after each run, making interactive
|
||||||
|
debugging impossible. A local reproduction takes 30 seconds and catches
|
||||||
|
silent failures immediately.
|
||||||
|
|
||||||
|
**Procedure:**
|
||||||
|
1. `docker pull <actual_image>`
|
||||||
|
2. `docker run -d --name <test> ...` and wait for it to start
|
||||||
|
3. Run the exact commands from the Ansible task or script
|
||||||
|
4. Verify the state change took effect
|
||||||
|
5. Clean up: `docker rm -f <test>`
|
||||||
|
|
||||||
|
### Verified State Modification (Mandatory)
|
||||||
|
|
||||||
|
Ansible tasks that modify container state with `changed_when: false`
|
||||||
|
MUST include a post-task verification step that confirms the state
|
||||||
|
change took effect. `changed_when: false` suppresses both change
|
||||||
|
detection AND failure visibility — a task can silently do nothing and
|
||||||
|
report `ok`.
|
||||||
|
|
||||||
## Ansible Role Structure
|
## Ansible Role Structure
|
||||||
|
|
||||||
```
|
```text
|
||||||
main.yml → systemd_check → user_setup → rootless_docker → install_runner → prune → integration_test
|
main.yml → systemd_check → user_setup → rootless_docker → install_runner → prune → integration_test
|
||||||
```
|
```
|
||||||
|
|
||||||
- `install_runner.yml` handles: download, config, validate, register, service
|
- `install_runner.yml` handles: download, config, validate, register, service
|
||||||
- `main.yml` handles: prune, integration_test (NOT install_runner — avoids duplicates)
|
- `main.yml` handles: prune, integration_test (NOT install_runner — avoids duplicates)
|
||||||
- `systemctl --user` tasks must be guarded by `docker_rootless_setup`
|
- `systemctl --user` tasks must be guarded by `docker_rootless_setup`
|
||||||
- Template creation tasks are NOT guarded by `docker_rootless_setup` (they just create files)
|
- Template creation tasks are NOT guarded by `docker_rootless_setup` (they only create files)
|
||||||
|
- On Arch Linux, `rootless_docker.yml` fetches the rootless setup scripts
|
||||||
|
(`dockerd-rootless-setuptool.sh`, `dockerd-rootless.sh`) from `moby/moby` `contrib/`
|
||||||
|
at a pinned ref (`gitea_runner_rootless_scripts_ref`) into `/usr/bin` and installs
|
||||||
|
`rootlesskit` — Arch's `docker` package ships neither. These fetch tasks run
|
||||||
|
regardless of `docker_rootless_setup` so CI exercises them on the archlinux platform.
|
||||||
|
See ADR-011 in the decision log.
|
||||||
|
|
||||||
## Molecule Scenarios
|
## Molecule Scenarios
|
||||||
|
|
||||||
@@ -449,7 +495,7 @@ All documentation lives in `/docs/` and is synced to the Gitea wiki automaticall
|
|||||||
|
|
||||||
### Structure
|
### Structure
|
||||||
|
|
||||||
```
|
```text
|
||||||
docs/
|
docs/
|
||||||
├── index.md # Wiki homepage
|
├── index.md # Wiki homepage
|
||||||
├── mapping.json # File-to-wiki-page title mapping
|
├── mapping.json # File-to-wiki-page title mapping
|
||||||
@@ -478,7 +524,7 @@ docs/
|
|||||||
### Documentation Coverage
|
### Documentation Coverage
|
||||||
|
|
||||||
- `devx.ci.doc_coverage` checks that all CLI commands, Python modules, and CI scripts are documented
|
- `devx.ci.doc_coverage` checks that all CLI commands, Python modules, and CI scripts are documented
|
||||||
- Runs as a CI step in the quality job with `--fail-on-missing` (blocks CI if docs are missing)
|
- Runs as a CI step in the validate job with `--fail-on-missing` (blocks CI if docs are missing)
|
||||||
- Enforced: 100% coverage for public CLI commands and major architectural components
|
- Enforced: 100% coverage for public CLI commands and major architectural components
|
||||||
|
|
||||||
### Updating Documentation
|
### Updating Documentation
|
||||||
@@ -497,7 +543,7 @@ the user should not need to specify which profile to use.
|
|||||||
|
|
||||||
### Available Profiles
|
### Available Profiles
|
||||||
|
|
||||||
**Global** (shared with infra and devx):
|
**Global** (shared across all projects):
|
||||||
|
|
||||||
| Profile | Location | Purpose |
|
| Profile | Location | Purpose |
|
||||||
|---------|----------|---------|
|
|---------|----------|---------|
|
||||||
@@ -508,21 +554,21 @@ the user should not need to specify which profile to use.
|
|||||||
|
|
||||||
| Profile | Purpose |
|
| Profile | Purpose |
|
||||||
|---------|---------|
|
|---------|---------|
|
||||||
| `ci-investigator` | Investigate CI failures (quality, molecule, release, publish, wiki sync) |
|
| `ci-investigator` | Investigate CI failures (validate, molecule-tests, release-and-maintain) |
|
||||||
| `molecule-runner` | Run 7 molecule scenarios across 4 platforms, report pass/fail |
|
| `molecule-runner` | Run 7 molecule scenarios across 4 platforms, report pass/fail |
|
||||||
| `dep-upgrader` | Python + Ansible dependency upgrades with molecule verification |
|
| `dep-upgrader` | Python + Ansible dependency upgrades with molecule verification |
|
||||||
| `doc-syncer` | Doc coverage, doc linting, wiki sync for grm docs |
|
| `doc-sync-specialist` | Doc coverage, doc linting, wiki sync for grm docs |
|
||||||
| `workflow-validator` | actionlint + act_runner dry-run for grm workflows |
|
| `workflow-validator` | actionlint + act_runner dry-run for grm workflows |
|
||||||
|
|
||||||
### When to Delegate Automatically
|
### When to Delegate Automatically
|
||||||
|
|
||||||
| Trigger | Profile | Mode |
|
| Trigger | Profile | Mode |
|
||||||
|---------|---------|------|
|
|---------|---------|------|
|
||||||
| CI run failure (quality, molecule-tests, release, publish, sync-wiki) | `ci-investigator` | Background |
|
| CI run failure (validate, molecule-tests, release-and-maintain) | `ci-investigator` | Background |
|
||||||
| PR ready for review | `pr-reviewer` | Foreground |
|
| PR ready for review | `pr-reviewer` | Foreground |
|
||||||
| Molecule tests need to run | `molecule-runner` | Background |
|
| Molecule tests need to run | `molecule-runner` | Background |
|
||||||
| Dependency upgrade requested | `dep-upgrader` | Background |
|
| Dependency upgrade requested | `dep-upgrader` | Background |
|
||||||
| Doc coverage failure or wiki sync issue | `doc-syncer` | Background |
|
| Doc coverage failure or wiki sync issue | `doc-sync-specialist` | Background |
|
||||||
| Workflow YAML modified or validation needed | `workflow-validator` | Background |
|
| Workflow YAML modified or validation needed | `workflow-validator` | Background |
|
||||||
| Branch ready for merge | `release-check` | Foreground |
|
| Branch ready for merge | `release-check` | Foreground |
|
||||||
|
|
||||||
@@ -532,7 +578,7 @@ the user should not need to specify which profile to use.
|
|||||||
2. **Background by default, foreground when blocking.**
|
2. **Background by default, foreground when blocking.**
|
||||||
3. **Provide full context in the prompt** — subagents don't inherit conversation history.
|
3. **Provide full context in the prompt** — subagents don't inherit conversation history.
|
||||||
4. **One subagent per concern.** Chain: investigate → fix in main session → review.
|
4. **One subagent per concern.** Chain: investigate → fix in main session → review.
|
||||||
5. **Don't delegate trivial work** (<30s, <50 lines of context).
|
5. **Don't delegate minor work** (<30s, <50 lines of context).
|
||||||
6. **Compact after subagent returns.**
|
6. **Compact after subagent returns.**
|
||||||
7. **Never skip delegation to save time** — it keeps main context small.
|
7. **Never skip delegation to save time** — it keeps main context small.
|
||||||
|
|
||||||
@@ -544,8 +590,9 @@ tool, workflow, or process issues that warrant follow-up. These issues
|
|||||||
use the `feedback` label plus a category label (`tooling`,
|
use the `feedback` label plus a category label (`tooling`,
|
||||||
`ci-improvement`, `doc-improvement`, `workflow-improvement`).
|
`ci-improvement`, `doc-improvement`, `workflow-improvement`).
|
||||||
|
|
||||||
Standard labels are created automatically by `configure_repo` (runs in
|
Standard labels are created automatically by `configure_repo` (runs as
|
||||||
post-merge on every master push). If a label does not exist yet, the
|
a step in `detect-and-configure` in post-merge on every master push).
|
||||||
|
If a label does not exist yet, the
|
||||||
subagent's issue creation will still succeed — labels can be added
|
subagent's issue creation will still succeed — labels can be added
|
||||||
afterwards.
|
afterwards.
|
||||||
|
|
||||||
|
|||||||
+155
@@ -2,6 +2,161 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.23.0] - 2026-08-28
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Add pre-cache timer, force_pull, and Docker socket options to runner config
|
||||||
|
|
||||||
|
## [0.22.1] - 2026-08-26
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Use kireto token for auto-merge approval review
|
||||||
|
|
||||||
|
## [0.22.0] - 2026-08-25
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Adopt spec-driven CI gates, create_dependency_pr, and pr-review skill
|
||||||
|
|
||||||
|
## [0.21.1] - 2026-08-24
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Use runuser for systemctl --user tasks in gitea_runner role
|
||||||
|
|
||||||
|
## [0.21.0] - 2026-08-09
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- *(healthcheck)* Add two-tier disk prune with critical threshold
|
||||||
|
|
||||||
|
## [0.20.0] - 2026-08-09
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- *(healthcheck)* Add two-tier disk prune with critical threshold
|
||||||
|
|
||||||
|
## [0.19.0] - 2026-08-08
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Use Gitea mirror for Ansible collection installs
|
||||||
|
|
||||||
|
## [0.18.8] - 2026-08-06
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Pin containerd.io to compatible version for Docker 28.x
|
||||||
|
|
||||||
|
|
||||||
|
## [0.18.7] - 2026-08-06
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Move StartLimit to [Unit] and make prune timer reload conditional
|
||||||
|
|
||||||
|
## [0.18.6] - 2026-08-05
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Pre-configure daemon.json before rootless setuptool + add DBUS_SESSION_BUS_ADDRESS
|
||||||
|
|
||||||
|
## [0.18.5] - 2026-08-05
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Pin Docker 28.x + disable containerd snapshotter + tune prune/disk
|
||||||
|
|
||||||
|
## [0.18.4] - 2026-08-05
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Harden rootless Docker daemon resilience on CI runners
|
||||||
|
|
||||||
|
## [0.18.3] - 2026-08-04
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Switch default network driver to slirp4netns (pasta TCP RST bug)
|
||||||
|
|
||||||
|
## [0.18.2] - 2026-07-16
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Load tun module and pre-configure systemd override for Arch rootless Docker
|
||||||
|
|
||||||
|
## [0.18.1] - 2026-07-16
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Fetch rootless Docker scripts on Arch Linux
|
||||||
|
|
||||||
|
## [0.18.0] - 2026-07-12
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- *(runner)* Enable IPv6 in rootless Docker via pasta network driver
|
||||||
|
|
||||||
|
## [0.17.2] - 2026-07-11
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Adopt devx v0.40.0
|
||||||
|
|
||||||
|
## [0.17.1] - 2026-07-09
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Disable IPv6 in rootless Docker daemon on runners
|
||||||
|
|
||||||
|
## [0.17.0] - 2026-07-08
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Bump devx to 0.38.0 and migrate to role-based Gitea tokens
|
||||||
|
|
||||||
|
## [0.16.0] - 2026-07-07
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Consolidate docs checks into devx-docs-check target
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Replace --strict with --verify for sync_wiki
|
||||||
|
|
||||||
|
## [0.15.0] - 2026-07-06
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Adopt documentation-as-code enhancements from devx
|
||||||
|
|
||||||
|
## [0.14.4] - 2026-07-06
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove project-specific references from grm
|
||||||
|
|
||||||
|
## [0.14.3] - 2026-07-06
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Rename PyPI package from gitea-runner-manager to grm
|
||||||
|
|
||||||
|
## [0.14.2] - 2026-07-05
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Add pre-commit hooks for quality gates matching CI
|
||||||
|
|
||||||
|
## [0.14.1] - 2026-07-01
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Align venv management to devx.mak targets
|
||||||
|
|
||||||
## [0.14.0] - 2026-07-01
|
## [0.14.0] - 2026-07-01
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
+2
-2
@@ -19,7 +19,7 @@ The `GRM-N` prefix is mandatory — CI extracts it for merge messages and Vikunj
|
|||||||
### Feature branches
|
### Feature branches
|
||||||
Use **conventional commits** on feature branches:
|
Use **conventional commits** on feature branches:
|
||||||
|
|
||||||
```
|
```text
|
||||||
feat: add new command
|
feat: add new command
|
||||||
fix: resolve timeout issue
|
fix: resolve timeout issue
|
||||||
chore: update dependencies
|
chore: update dependencies
|
||||||
@@ -33,7 +33,7 @@ Allowed types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `perf`, `tes
|
|||||||
### Master branch (squash merges)
|
### Master branch (squash merges)
|
||||||
Squash commits on `master` must follow:
|
Squash commits on `master` must follow:
|
||||||
|
|
||||||
```
|
```text
|
||||||
GRM-N: <conventional commit message>
|
GRM-N: <conventional commit message>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ If you develop a new program, and you want it to be of the greatest possible use
|
|||||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
grm
|
grm
|
||||||
Copyright (C) 2026 emil
|
Copyright (C) 2026 oblachno-oss
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|||||||
|
|
||||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
grm Copyright (C) 2026 emil
|
grm Copyright (C) 2026 oblachno-oss
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
.PHONY: all setup setup-ci setup-quality setup-molecule setup-release setup-image install update lint ansible-lint makefile-lint lint-all lint-ruff lint-format lint-bandit lint-deps typecheck checkmake install-hooks test test-unit pytest-cov molecule molecule-all test-all clean workflow-lint workflow-dryrun workflow-check install-tools
|
.PHONY: all setup setup-ci setup-quality setup-molecule setup-release setup-image install update lint ansible-lint makefile-lint lint-all lint-ruff lint-format lint-bandit lint-deps typecheck checkmake install-hooks test test-unit pytest-cov molecule molecule-all test-all clean workflow-lint workflow-dryrun workflow-check install-tools check-api-identity-checks
|
||||||
.PHONY: configure-gitea-pypi
|
.PHONY: configure-gitea-pypi
|
||||||
.PHONY: create-task create-pr push-with-pr git-push
|
.PHONY: create-task create-pr push-with-pr git-push
|
||||||
|
.PHONY: check-docs docs-check
|
||||||
|
|
||||||
PYTHON := python3
|
PYTHON := python3
|
||||||
VENV := .venv
|
VENV := .venv
|
||||||
@@ -14,7 +15,7 @@ all: setup
|
|||||||
DEVX_PYTHON := $(BIN)/python
|
DEVX_PYTHON := $(BIN)/python
|
||||||
DEVX_VENV := $(VENV)
|
DEVX_VENV := $(VENV)
|
||||||
DEVX_BIN := $(BIN)
|
DEVX_BIN := $(BIN)
|
||||||
DEVX_COV_PKG := src/gitea_runner_manager
|
DEVX_COV_PKG := src/grm
|
||||||
DEVX_TEST_PATHS := tests/ scripts/tests/
|
DEVX_TEST_PATHS := tests/ scripts/tests/
|
||||||
DEVX_LINT_PATHS := src/ scripts/ tests/
|
DEVX_LINT_PATHS := src/ scripts/ tests/
|
||||||
|
|
||||||
@@ -25,6 +26,18 @@ DEVX_LINT_PATHS := src/ scripts/ tests/
|
|||||||
DEVX_MAK := $(shell $(BIN)/python -c \
|
DEVX_MAK := $(shell $(BIN)/python -c \
|
||||||
"from pathlib import Path; import devx; print(Path(devx.__file__).parent / 'make' / 'devx.mak')" \
|
"from pathlib import Path; import devx; print(Path(devx.__file__).parent / 'make' / 'devx.mak')" \
|
||||||
2>/dev/null)
|
2>/dev/null)
|
||||||
|
# Fallback: when the venv doesn't exist yet, try system python3 or /opt/venv.
|
||||||
|
# In CI, /opt/venv has devx pre-installed; locally, devx may be in system python.
|
||||||
|
ifeq ($(strip $(DEVX_MAK)),)
|
||||||
|
DEVX_MAK := $(shell python3 -c \
|
||||||
|
"from pathlib import Path; import devx; print(Path(devx.__file__).parent / 'make' / 'devx.mak')" \
|
||||||
|
2>/dev/null)
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(DEVX_MAK)),)
|
||||||
|
DEVX_MAK := $(shell /opt/venv/bin/python -c \
|
||||||
|
"from pathlib import Path; import devx; print(Path(devx.__file__).parent / 'make' / 'devx.mak')" \
|
||||||
|
2>/dev/null)
|
||||||
|
endif
|
||||||
-include $(DEVX_MAK)
|
-include $(DEVX_MAK)
|
||||||
|
|
||||||
# Full setup for local development (all deps, tools, collections, hooks)
|
# Full setup for local development (all deps, tools, collections, hooks)
|
||||||
@@ -37,13 +50,14 @@ setup: $(VENV)/bin/activate .env activate-scripts configure-gitea-pypi
|
|||||||
$(BIN)/python -m devx.tools.setup --bin "$(BIN)" --skip-install
|
$(BIN)/python -m devx.tools.setup --bin "$(BIN)" --skip-install
|
||||||
|
|
||||||
# Lean setup for CI jobs that need pytest + lint tools + runtime deps
|
# Lean setup for CI jobs that need pytest + lint tools + runtime deps
|
||||||
# (detect-changes, discover-runners, pr-review, sync-wiki, badges)
|
# (validate job steps: detect-changes, discover-runners, pr-review;
|
||||||
# badges job runs generate_badges.py which needs ruff, pyright, bandit
|
# release-and-maintain job steps: sync-wiki, badges)
|
||||||
|
# badges step runs generate_badges.py which needs ruff, pyright, bandit
|
||||||
setup-ci: $(VENV)/bin/activate .env configure-gitea-pypi
|
setup-ci: $(VENV)/bin/activate .env configure-gitea-pypi
|
||||||
@$(PIP_INSTALL) install -e '.[ci,lint]'
|
@$(PIP_INSTALL) install -e '.[ci,lint]'
|
||||||
@$(BIN)/python -m devx.tools.setup --bin "$(BIN)" --skip-install --no-ansible-collections --no-pre-commit --no-tea-login
|
@$(BIN)/python -m devx.tools.setup --bin "$(BIN)" --skip-install --no-ansible-collections --no-pre-commit --no-tea-login
|
||||||
|
|
||||||
# Setup for the quality job (lint + test deps, actionlint tool)
|
# Setup for the validate CI job (lint + test deps, actionlint tool)
|
||||||
setup-quality: $(VENV)/bin/activate .env configure-gitea-pypi
|
setup-quality: $(VENV)/bin/activate .env configure-gitea-pypi
|
||||||
@$(PIP_INSTALL) install -e '.[ci,lint]'
|
@$(PIP_INSTALL) install -e '.[ci,lint]'
|
||||||
@$(BIN)/python -m devx.tools.install_tools
|
@$(BIN)/python -m devx.tools.install_tools
|
||||||
@@ -73,32 +87,19 @@ setup-release: $(VENV)/bin/activate .env configure-gitea-pypi
|
|||||||
# the venv symlink first, then installs the project.
|
# the venv symlink first, then installs the project.
|
||||||
setup-image:
|
setup-image:
|
||||||
@if [ -d /opt/venv ]; then ln -sf /opt/venv .venv; . .venv/bin/activate; \
|
@if [ -d /opt/venv ]; then ln -sf /opt/venv .venv; . .venv/bin/activate; \
|
||||||
if [ -n "$$CI_GITEA_TOKEN" ]; then export PIP_EXTRA_INDEX_URL="https://$$CI_GITEA_USERNAME:$$CI_GITEA_TOKEN@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"; fi; \
|
_TOKEN="$$CI_GITEA_API_TOKEN"; [ -z "$$_TOKEN" ] && _TOKEN="$$DEVELOPER_GITEA_API_TOKEN"; [ -z "$$_TOKEN" ] && _TOKEN="$$CI_GITEA_TOKEN"; \
|
||||||
|
if [ -n "$$_TOKEN" ]; then export PIP_EXTRA_INDEX_URL="https://$$CI_GITEA_USERNAME:$${_TOKEN}@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"; git config --global url."https://$$CI_GITEA_USERNAME:$${_TOKEN}@git.oblachno.oblachno.fyi/".insteadOf "https://git.oblachno.oblachno.fyi/"; fi; \
|
||||||
pip install -e .$(if $(EXTRAS),[$(EXTRAS)],); \
|
pip install -e .$(if $(EXTRAS),[$(EXTRAS)],); \
|
||||||
else echo "[setup-image] /opt/venv not found — falling back to setup-ci"; $(MAKE) setup-ci; fi
|
else echo "[setup-image] /opt/venv not found — falling back to setup-ci"; $(MAKE) setup-ci; fi
|
||||||
|
|
||||||
# Helper: run pip install with Gitea registry configured
|
# venv, .env, activate-scripts, and PIP_INSTALL are provided by devx.mak
|
||||||
# Usage: $(PIP_INSTALL) install -e '.[ci,lint]'
|
# (devx-venv, devx-env, devx-activate-scripts, DEVX_PIP_INSTALL)
|
||||||
PIP_INSTALL := if [ -z "$$CI_GITEA_TOKEN" ]; then . ./.env 2>/dev/null; fi; \
|
# Aliases for convenience and backward compatibility:
|
||||||
CI_GITEA_TOKEN="$$CI_GITEA_TOKEN"; \
|
.PHONY: venv activate-scripts
|
||||||
if [ -n "$$CI_GITEA_TOKEN" ]; then export PIP_EXTRA_INDEX_URL="https://$$CI_GITEA_USERNAME:$$CI_GITEA_TOKEN@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"; fi; \
|
PIP_INSTALL := $(DEVX_PIP_INSTALL)
|
||||||
$(BIN)/pip
|
venv: devx-venv
|
||||||
|
.env: devx-env
|
||||||
$(VENV)/bin/activate:
|
activate-scripts: devx-activate-scripts
|
||||||
@python3 -c "import sys; v=sys.version_info; assert v >= (3, 12), f'Python 3.12+ required, found {v.major}.{v.minor}'; print(f'Python {v.major}.{v.minor}.{v.micro} OK')"
|
|
||||||
$(PYTHON) -m venv $(VENV)
|
|
||||||
$(BIN)/pip install --upgrade pip setuptools wheel
|
|
||||||
|
|
||||||
.env:
|
|
||||||
@if [ ! -f .env ]; then \
|
|
||||||
cp .env.example .env; \
|
|
||||||
echo "Created .env from .env.example — please edit it with your credentials."; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
activate-scripts: $(VENV)/bin/activate
|
|
||||||
@test -f activate.sh || (echo '#!/usr/bin/env bash' > activate.sh && echo 'source "$$(cd "$$(dirname "$${BASH_SOURCE[0]}")" && pwd)/.venv/bin/activate"' >> activate.sh && chmod +x activate.sh)
|
|
||||||
@test -f activate.fish || (echo '#!/usr/bin/env fish' > activate.fish && echo 'set -l script_dir (dirname (status --current-filename))' >> activate.fish && echo 'source "$$script_dir/.venv/bin/activate.fish"' >> activate.fish && chmod +x activate.fish)
|
|
||||||
@test -f activate.zsh || (echo '#!/usr/bin/env zsh' > activate.zsh && echo '0="$${ZERO:-$${0:#$$ZSH_ARGZERO}}"' >> activate.zsh && echo '0="$${$${(M)0:#/*}:-$$PWD/$$0}"' >> activate.zsh && echo 'source "$${0:A:h}/.venv/bin/activate"' >> activate.zsh && chmod +x activate.zsh)
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@if [ -z "$(HOST)" ]; then echo "HOST is required. Example: make install HOST=192.168.1.10"; exit 1; fi
|
@if [ -z "$(HOST)" ]; then echo "HOST is required. Example: make install HOST=192.168.1.10"; exit 1; fi
|
||||||
@@ -154,16 +155,15 @@ test-unit: devx-test-unit
|
|||||||
|
|
||||||
# Override devx-pytest-cov to cover both src/ and scripts/
|
# Override devx-pytest-cov to cover both src/ and scripts/
|
||||||
pytest-cov:
|
pytest-cov:
|
||||||
@$(BIN)/pytest $(DEVX_TEST_PATHS) -v --cov=src/gitea_runner_manager --cov=scripts --cov-report=term-missing --cov-fail-under=100
|
@$(BIN)/pytest $(DEVX_TEST_PATHS) -v --cov=src/grm --cov=scripts --cov-report=term-missing --cov-fail-under=100
|
||||||
workflow-lint: devx-workflow-lint
|
workflow-lint: devx-workflow-lint
|
||||||
workflow-dryrun: devx-workflow-dryrun
|
workflow-dryrun: devx-workflow-dryrun
|
||||||
workflow-check: devx-workflow-check
|
workflow-check: devx-workflow-check
|
||||||
|
|
||||||
configure-gitea-pypi:
|
configure-gitea-pypi:
|
||||||
@if [ -z "$$CI_GITEA_TOKEN" ]; then . ./.env 2>/dev/null; fi; \
|
_TOKEN="$$CI_GITEA_API_TOKEN"; [ -z "$$_TOKEN" ] && _TOKEN="$$DEVELOPER_GITEA_API_TOKEN"; [ -z "$$_TOKEN" ] && _TOKEN="$$CI_GITEA_TOKEN"; \
|
||||||
CI_GITEA_TOKEN="$$CI_GITEA_TOKEN"; \
|
if [ -z "$$_TOKEN" ]; then echo "[configure-gitea-pypi] Gitea API token not set — skipping (devx must be on public PyPI)"; exit 0; fi; \
|
||||||
if [ -z "$$CI_GITEA_TOKEN" ]; then echo "[configure-gitea-pypi] CI_GITEA_TOKEN not set — skipping (devx must be on public PyPI)"; exit 0; fi; \
|
echo "[configure-gitea-pypi] Gitea PyPI registry configured (token present)."
|
||||||
echo "[configure-gitea-pypi] Gitea PyPI registry configured (CI_GITEA_TOKEN present)."
|
|
||||||
|
|
||||||
ansible-lint:
|
ansible-lint:
|
||||||
PATH="$(PWD)/$(BIN):$$PATH" $(BIN)/ansible-lint ansible/
|
PATH="$(PWD)/$(BIN):$$PATH" $(BIN)/ansible-lint ansible/
|
||||||
@@ -175,13 +175,41 @@ makefile-lint:
|
|||||||
echo "checkmake not found, skipping Makefile lint"; \
|
echo "checkmake not found, skipping Makefile lint"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lint-all: lint ansible-lint makefile-lint workflow-lint
|
lint-all: lint ansible-lint makefile-lint workflow-lint check-api-identity-checks check-ansible-no-log check-ansible-no-state-absent-on-db check-ansible-patterns check-jinja-expr check-ansible-set-fact-to-json
|
||||||
|
|
||||||
|
check-api-identity-checks:
|
||||||
|
@$(BIN)/python -m devx.tools.check_api_identity_checks
|
||||||
|
|
||||||
|
check-ansible-no-log:
|
||||||
|
@echo "[check-ansible-no-log] Checking Ansible tasks for missing no_log on secret-handling tasks..."
|
||||||
|
@$(BIN)/python -m devx.tools.check_ansible_no_log
|
||||||
|
@echo "[check-ansible-no-log] Passed."
|
||||||
|
|
||||||
|
check-ansible-no-state-absent-on-db:
|
||||||
|
@echo "[check-ansible-no-state-absent-on-db] Checking for state: absent on DB data directories..."
|
||||||
|
@$(BIN)/python -m devx.tools.check_ansible_no_state_absent_on_db
|
||||||
|
@echo "[check-ansible-no-state-absent-on-db] Passed."
|
||||||
|
|
||||||
|
check-ansible-patterns:
|
||||||
|
@echo "[check-ansible-patterns] Checking for dangerous failure-masking patterns..."
|
||||||
|
@$(BIN)/python -m devx.tools.check_ansible_patterns
|
||||||
|
@echo "[check-ansible-patterns] Passed."
|
||||||
|
|
||||||
|
check-jinja-expr:
|
||||||
|
@echo "[check-jinja-expr] Validating Jinja2 expressions in Ansible files..."
|
||||||
|
@$(BIN)/python -m devx.tools.check_jinja_expr
|
||||||
|
@echo "[check-jinja-expr] Passed."
|
||||||
|
|
||||||
|
check-ansible-set-fact-to-json:
|
||||||
|
@echo "[check-ansible-set-fact-to-json] Checking set_fact tasks for to_json misuse..."
|
||||||
|
@$(BIN)/python -m devx.tools.check_ansible_set_fact_to_json
|
||||||
|
@echo "[check-ansible-set-fact-to-json] Passed."
|
||||||
|
|
||||||
test-integration:
|
test-integration:
|
||||||
$(BIN)/pytest tests/integration/ -v --no-cov
|
$(BIN)/pytest tests/integration/ -v --no-cov
|
||||||
|
|
||||||
MOLECULE := $(realpath $(BIN))/molecule
|
MOLECULE := $(realpath $(BIN))/molecule
|
||||||
MOLECULE_BASE := cd $(CURDIR)/ansible/roles/gitea-runner && ANSIBLE_ALLOW_BROKEN_CONDITIONALS=true ANSIBLE_INJECT_INVOCATION=1 $(MOLECULE)
|
MOLECULE_BASE := cd $(CURDIR)/ansible/roles/gitea_runner && ANSIBLE_ALLOW_BROKEN_CONDITIONALS=true ANSIBLE_INJECT_INVOCATION=1 $(MOLECULE)
|
||||||
|
|
||||||
# Quick local test: Ubuntu 22.04 only, all scenarios
|
# Quick local test: Ubuntu 22.04 only, all scenarios
|
||||||
molecule:
|
molecule:
|
||||||
@@ -201,3 +229,7 @@ create-task: devx-create-task
|
|||||||
create-pr: devx-create-pr
|
create-pr: devx-create-pr
|
||||||
push-with-pr: devx-push-with-pr
|
push-with-pr: devx-push-with-pr
|
||||||
git-push: devx-push
|
git-push: devx-push
|
||||||
|
|
||||||
|
# --- Documentation checks (via devx.mak fragment) -----------------------------
|
||||||
|
check-docs: devx-check-docs
|
||||||
|
docs-check: devx-docs-check
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ Each runner runs in an isolated **rootless Docker** environment under a dedicate
|
|||||||
|
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/src/branch/master/LICENSE)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/src/branch/master/LICENSE)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/wiki)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/wiki)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/actions)
|
||||||
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/releases)
|
[](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/releases)
|
||||||
[](https://www.python.org/downloads/)
|
[](https://www.python.org/downloads/)
|
||||||
|
|
||||||
## Why GRM?
|
## Why GRM?
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ The registry is publicly readable — no authentication required to install.
|
|||||||
**Quick install (one-off):**
|
**Quick install (one-off):**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install gitea-runner-manager --index-url https://git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple
|
pip install grm --index-url https://git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple
|
||||||
```
|
```
|
||||||
|
|
||||||
**Persistent configuration (recommended):**
|
**Persistent configuration (recommended):**
|
||||||
@@ -115,7 +115,7 @@ extra-index-url = https://git.oblachno.oblachno.fyi/api/packages/oblachno-oss/py
|
|||||||
Then install normally:
|
Then install normally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install gitea-runner-manager
|
pip install grm
|
||||||
```
|
```
|
||||||
|
|
||||||
This installs the `grm` CLI and its Python dependencies. The Ansible playbooks
|
This installs the `grm` CLI and its Python dependencies. The Ansible playbooks
|
||||||
@@ -147,7 +147,7 @@ GRM provides a single `grm` command with subcommands for the full runner lifecyc
|
|||||||
| `grm enable <name>` | Enable a runner to start on boot |
|
| `grm enable <name>` | Enable a runner to start on boot |
|
||||||
| `grm disable <name>` | Disable and deregister a runner |
|
| `grm disable <name>` | Disable and deregister a runner |
|
||||||
| `grm status <name>` | Check the status of a registered runner |
|
| `grm status <name>` | Check the status of a registered runner |
|
||||||
| `grm remove <name>` | Remove a runner completely (with remote cleanup) |
|
| `grm remove <name>` | Remove a runner entirely (with remote cleanup) |
|
||||||
| `grm remove <name> --force` | Remove only the local registry entry (skip remote cleanup) |
|
| `grm remove <name> --force` | Remove only the local registry entry (skip remote cleanup) |
|
||||||
| `grm list` | List all registered runners with live status |
|
| `grm list` | List all registered runners with live status |
|
||||||
| `grm list --no-status` | List registered runners without SSH status checks |
|
| `grm list --no-status` | List registered runners without SSH status checks |
|
||||||
@@ -187,7 +187,7 @@ GRM reads configuration from a `.env` file in the current directory (loaded auto
|
|||||||
|
|
||||||
### Sudo Password Handling
|
### Sudo Password Handling
|
||||||
|
|
||||||
GRM delegates remote operations to Ansible, which uses `sudo` (become) on the target host. There are several ways to provide the sudo password, in priority order:
|
GRM delegates remote operations to Ansible, which uses `sudo` (become) on the target host. There are multiple ways to provide the sudo password, in priority order:
|
||||||
|
|
||||||
1. **`--become-password-file <path>`** (CLI flag, global) — Read sudo password from a file. Works for all commands including `grm list`.
|
1. **`--become-password-file <path>`** (CLI flag, global) — Read sudo password from a file. Works for all commands including `grm list`.
|
||||||
2. **`GRM_BECOME_PASSWORD_FILE`** (env var) — Same as above, set in `.env` or environment.
|
2. **`GRM_BECOME_PASSWORD_FILE`** (env var) — Same as above, set in `.env` or environment.
|
||||||
@@ -266,8 +266,8 @@ One of GRM's core features is the ability to run multiple isolated runners on th
|
|||||||
|
|
||||||
- **Dedicated system user**: `grm-<name>` with its own home directory at `/home/grm-<name>/`
|
- **Dedicated system user**: `grm-<name>` with its own home directory at `/home/grm-<name>/`
|
||||||
- **Rootless Docker daemon**: Isolated Docker socket at `/run/user/<UID>/docker.sock`
|
- **Rootless Docker daemon**: Isolated Docker socket at `/run/user/<UID>/docker.sock`
|
||||||
- **Data directory**: `/var/lib/gitea-runner/<name>/`
|
- **Data directory**: `/var/lib/gitea_runner/<name>/`
|
||||||
- **Config directory**: `/etc/gitea-runner/<name>/`
|
- **Config directory**: `/etc/gitea_runner/<name>/`
|
||||||
- **Systemd user service**: `gitea-runner.service` (independent start/stop/enable)
|
- **Systemd user service**: `gitea-runner.service` (independent start/stop/enable)
|
||||||
- **Docker prune timer**: Per-instance daily cleanup
|
- **Docker prune timer**: Per-instance daily cleanup
|
||||||
|
|
||||||
@@ -339,15 +339,15 @@ See the [Development Setup](https://git.oblachno.oblachno.fyi/oblachno-oss/grm/w
|
|||||||
|
|
||||||
GRM consists of two layers:
|
GRM consists of two layers:
|
||||||
|
|
||||||
1. **Python CLI** (`src/gitea_runner_manager/`) — Built with Click, handles argument parsing, environment loading, i18n translations, and delegates to Ansible via the `ansible-playbook` subprocess. Secrets are passed via temporary JSON files to avoid exposure in the process list.
|
1. **Python CLI** (`src/grm/`) — Built with Click, handles argument parsing, environment loading, i18n translations, and delegates to Ansible via the `ansible-playbook` subprocess. Secrets are passed via temporary JSON files to avoid exposure in the process list.
|
||||||
|
|
||||||
2. **Ansible Role** (`ansible/roles/gitea-runner/`) — Idempotent role that creates a dedicated system user, sets up rootless Docker, installs the runner binary, creates a systemd user service, registers the runner with Gitea, and sets up a Docker prune timer.
|
2. **Ansible Role** (`ansible/roles/gitea_runner/`) — Idempotent role that creates a dedicated system user, sets up rootless Docker, installs the runner binary, creates a systemd user service, registers the runner with Gitea, and sets up a Docker prune timer.
|
||||||
|
|
||||||
```
|
```text
|
||||||
grm install <host>
|
grm install <host>
|
||||||
└── RunnerManager.install()
|
└── RunnerManager.install()
|
||||||
└── ansible-playbook ansible/install-runner.yml
|
└── ansible-playbook ansible/install-runner.yml
|
||||||
└── role: gitea-runner
|
└── role: gitea_runner
|
||||||
├── user_setup.yml (create per-runner system user + lingering)
|
├── user_setup.yml (create per-runner system user + lingering)
|
||||||
├── rootless_docker.yml (rootless Docker setup under runner user)
|
├── rootless_docker.yml (rootless Docker setup under runner user)
|
||||||
├── install_runner.yml (download binary, config, register, service)
|
├── install_runner.yml (download binary, config, register, service)
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Include systemd availability check
|
- name: Include systemd availability check
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: systemd_check.yml
|
tasks_from: systemd_check.yml
|
||||||
|
|
||||||
- name: Stop gitea-runner user service
|
- name: Stop gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user stop gitea-runner
|
ansible.builtin.command: systemctl --user stop gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: systemd_available.stat.exists
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
- name: Stop and disable healthcheck timer
|
- name: Stop and disable healthcheck timer
|
||||||
ansible.builtin.command: systemctl --user stop --disable runner-healthcheck.timer
|
ansible.builtin.command: systemctl --user stop --disable runner-healthcheck.timer
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: systemd_available.stat.exists
|
||||||
@@ -30,14 +30,14 @@
|
|||||||
|
|
||||||
- name: Include deregistration
|
- name: Include deregistration
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: deregister.yml
|
tasks_from: deregister.yml
|
||||||
when: not skip_runner_registration | default(false)
|
when: not gitea_runner_skip_registration | default(false)
|
||||||
|
|
||||||
- name: Disable gitea-runner user service
|
- name: Disable gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user disable gitea-runner
|
ansible.builtin.command: systemctl --user disable gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: systemd_available.stat.exists
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Include systemd availability check
|
- name: Include systemd availability check
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: systemd_check.yml
|
tasks_from: systemd_check.yml
|
||||||
|
|
||||||
- name: Enable gitea-runner user service
|
- name: Enable gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user enable gitea-runner
|
ansible.builtin.command: systemctl --user enable gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: systemd_available.stat.exists
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
- name: Start gitea-runner user service
|
- name: Start gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user start gitea-runner
|
ansible.builtin.command: systemctl --user start gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: systemd_available.stat.exists
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- role: gitea-runner
|
- role: gitea_runner
|
||||||
|
|||||||
+34
-34
@@ -6,11 +6,11 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Include systemd availability check
|
- name: Include systemd availability check
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: systemd_check.yml
|
tasks_from: systemd_check.yml
|
||||||
|
|
||||||
- name: Get runner user UID
|
- name: Get runner user UID
|
||||||
ansible.builtin.command: id -u "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
ansible.builtin.command: id -u "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
register: runner_uid_result
|
register: runner_uid_result
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
@@ -23,20 +23,20 @@
|
|||||||
- name: Stop gitea-runner user service
|
- name: Stop gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user stop gitea-runner
|
ansible.builtin.command: systemctl --user stop gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: gitea_runner_systemd_available.stat.exists
|
||||||
changed_when: true
|
changed_when: true
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Disable gitea-runner user service
|
- name: Disable gitea-runner user service
|
||||||
ansible.builtin.command: systemctl --user disable gitea-runner
|
ansible.builtin.command: systemctl --user disable gitea-runner
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: gitea_runner_systemd_available.stat.exists
|
||||||
changed_when: true
|
changed_when: true
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default('') }}/docker.sock"
|
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default('') }}/docker.sock"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
- name: Prune all Docker images, volumes, and build cache (rootless)
|
- name: Prune all Docker images, volumes, and build cache (rootless)
|
||||||
ansible.builtin.command: docker system prune -af --volumes
|
ansible.builtin.command: docker system prune -af --volumes
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default('') }}/docker.sock"
|
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default('') }}/docker.sock"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
- name: Stop rootless Docker daemon
|
- name: Stop rootless Docker daemon
|
||||||
ansible.builtin.command: systemctl --user stop docker
|
ansible.builtin.command: systemctl --user stop docker
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
@@ -75,120 +75,120 @@
|
|||||||
|
|
||||||
- name: Include deregistration
|
- name: Include deregistration
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: deregister.yml
|
tasks_from: deregister.yml
|
||||||
when: not skip_runner_registration | default(false)
|
when: not gitea_runner_skip_registration | default(false)
|
||||||
|
|
||||||
- name: Stop and disable healthcheck timer
|
- name: Stop and disable healthcheck timer
|
||||||
ansible.builtin.command: systemctl --user stop --disable runner-healthcheck.timer
|
ansible.builtin.command: systemctl --user stop --disable runner-healthcheck.timer
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
become_user: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
environment:
|
environment:
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default('') }}"
|
||||||
when: systemd_available.stat.exists
|
when: gitea_runner_systemd_available.stat.exists
|
||||||
changed_when: true
|
changed_when: true
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove docker-prune user service file
|
- name: Remove docker-prune user service file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user/docker-prune.service"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user/docker-prune.service"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove docker-prune user timer file
|
- name: Remove docker-prune user timer file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user/docker-prune.timer"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user/docker-prune.timer"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove healthcheck user service file
|
- name: Remove healthcheck user service file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user/runner-healthcheck.service"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user/runner-healthcheck.service"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove healthcheck user timer file
|
- name: Remove healthcheck user timer file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user/runner-healthcheck.timer"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user/runner-healthcheck.timer"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove healthcheck script
|
- name: Remove healthcheck script
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_config_dir | default('/etc/gitea-runner/' ~ runner_name) }}/healthcheck.sh"
|
path: "{{ gitea_runner_config_dir | default('/etc/gitea-runner/' ~ gitea_runner_name) }}/healthcheck.sh"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove systemd user unit file
|
- name: Remove systemd user unit file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user/gitea-runner.service"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user/gitea-runner.service"
|
||||||
state: absent
|
state: absent
|
||||||
when: remove_systemd_template | default(true)
|
when: remove_systemd_template | default(true)
|
||||||
|
|
||||||
- name: Kill remaining processes of runner user
|
- name: Kill remaining processes of runner user
|
||||||
ansible.builtin.command: loginctl terminate-user "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
ansible.builtin.command: loginctl terminate-user "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
- name: Wait for processes to terminate
|
- name: Wait for processes to terminate
|
||||||
ansible.builtin.command: "pkill -u {{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
ansible.builtin.command: "pkill -u {{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Disable lingering for runner user
|
- name: Disable lingering for runner user
|
||||||
ansible.builtin.command: loginctl disable-linger "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
ansible.builtin.command: loginctl disable-linger "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
- name: Remove runner user and home directory
|
- name: Remove runner user and home directory
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}"
|
name: "{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}"
|
||||||
state: absent
|
state: absent
|
||||||
remove: true
|
remove: true
|
||||||
when: remove_runner_user | default(true)
|
when: gitea_runner_remove_user | default(true)
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove Docker data root when user is kept
|
- name: Remove Docker data root when user is kept
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.local/share/docker"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.local/share/docker"
|
||||||
state: absent
|
state: absent
|
||||||
when: not (remove_runner_user | default(true))
|
when: not (gitea_runner_remove_user | default(true))
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove act cache when user is kept
|
- name: Remove act cache when user is kept
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.cache/act"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.cache/act"
|
||||||
state: absent
|
state: absent
|
||||||
when: not (remove_runner_user | default(true))
|
when: not (gitea_runner_remove_user | default(true))
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove systemd user config dir when user is kept
|
- name: Remove systemd user config dir when user is kept
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_home | default('/home/grm-' ~ runner_name) }}/.config/systemd/user"
|
path: "{{ gitea_runner_home | default('/home/grm-' ~ gitea_runner_name) }}/.config/systemd/user"
|
||||||
state: absent
|
state: absent
|
||||||
when: not (remove_runner_user | default(true))
|
when: not (gitea_runner_remove_user | default(true))
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove subuid entry for runner user
|
- name: Remove subuid entry for runner user
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/subuid
|
path: /etc/subuid
|
||||||
regexp: "^{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}:"
|
regexp: "^{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}:"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove subgid entry for runner user
|
- name: Remove subgid entry for runner user
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/subgid
|
path: /etc/subgid
|
||||||
regexp: "^{{ gitea_runner_service_user | default('grm-' ~ runner_name) }}:"
|
regexp: "^{{ gitea_runner_service_user | default('grm-' ~ gitea_runner_name) }}:"
|
||||||
state: absent
|
state: absent
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Remove runner data directory
|
- name: Remove runner data directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_data_dir | default('/var/lib/gitea-runner/' ~ runner_name) }}"
|
path: "{{ gitea_runner_data_dir | default('/var/lib/gitea-runner/' ~ gitea_runner_name) }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Remove runner config directory
|
- name: Remove runner config directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ gitea_runner_config_dir | default('/etc/gitea-runner/' ~ runner_name) }}"
|
path: "{{ gitea_runner_config_dir | default('/etc/gitea-runner/' ~ gitea_runner_name) }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
---
|
||||||
collections:
|
collections:
|
||||||
- name: community.general
|
- name: community.general
|
||||||
version: "==13.1.0"
|
type: url
|
||||||
|
source: https://git.oblachno.oblachno.fyi/api/packages/emil/generic/ansible-collections/13.1.0/community-general-13.1.0.tar.gz
|
||||||
- name: ansible.posix
|
- name: ansible.posix
|
||||||
version: "==2.2.0"
|
type: url
|
||||||
|
source: https://git.oblachno.oblachno.fyi/api/packages/emil/generic/ansible-collections/2.2.1/ansible-posix-2.2.1.tar.gz
|
||||||
- name: community.docker
|
- name: community.docker
|
||||||
version: "==5.2.1"
|
type: url
|
||||||
|
source: https://git.oblachno.oblachno.fyi/api/packages/emil/generic/ansible-collections/5.2.1/community-docker-5.2.1.tar.gz
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Include systemd availability check
|
- name: Include systemd availability check
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: systemd_check.yml
|
tasks_from: systemd_check.yml
|
||||||
|
|
||||||
- name: Resolve runner UID
|
- name: Resolve runner UID
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: gitea-runner
|
name: gitea_runner
|
||||||
tasks_from: resolve_uid.yml
|
tasks_from: resolve_uid.yml
|
||||||
|
|
||||||
- name: Stop gitea-runner user service
|
- name: Stop gitea-runner user service
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
gitea_runner_version: "1.0.8"
|
|
||||||
runner_labels: "docker,ubuntu-latest:docker://runner-images:ubuntu-26.04"
|
|
||||||
skip_runner_registration: false
|
|
||||||
|
|
||||||
# Per-runner user (rootless isolation)
|
|
||||||
gitea_runner_user_prefix: "grm-"
|
|
||||||
gitea_runner_base_home: "/home"
|
|
||||||
gitea_runner_service_user: "{{ gitea_runner_user_prefix }}{{ runner_name }}"
|
|
||||||
gitea_runner_home: "{{ gitea_runner_base_home }}/{{ gitea_runner_service_user }}"
|
|
||||||
|
|
||||||
# Base paths (instance-scoped via runner_name)
|
|
||||||
gitea_runner_base_data_dir: "/var/lib/gitea-runner"
|
|
||||||
gitea_runner_base_config_dir: "/etc/gitea-runner"
|
|
||||||
gitea_runner_data_dir: "{{ gitea_runner_base_data_dir }}/{{ runner_name }}"
|
|
||||||
gitea_runner_config_dir: "{{ gitea_runner_base_config_dir }}/{{ runner_name }}"
|
|
||||||
gitea_runner_binary_path: "/usr/local/bin/gitea_runner"
|
|
||||||
|
|
||||||
# Prune configuration
|
|
||||||
gitea_runner_prune_until: "24h"
|
|
||||||
gitea_runner_prune_schedule: "daily"
|
|
||||||
gitea_runner_prune_label: "gitea-runner=true"
|
|
||||||
|
|
||||||
# Service configuration
|
|
||||||
gitea_runner_service_restart_sec: "5"
|
|
||||||
|
|
||||||
# Health check configuration
|
|
||||||
gitea_runner_healthcheck_interval: "5min"
|
|
||||||
gitea_runner_healthcheck_boot_delay: "2min"
|
|
||||||
gitea_runner_healthcheck_disk_threshold: 85
|
|
||||||
gitea_runner_healthcheck_script_path: "{{ gitea_runner_config_dir }}/healthcheck.sh"
|
|
||||||
|
|
||||||
# Admin token for runner deregistration via Gitea API.
|
|
||||||
# If not set, falls back to registration_token (which likely lacks admin scope).
|
|
||||||
# Set this to a token with admin scope to enable automatic runner cleanup on removal.
|
|
||||||
gitea_admin_token: ""
|
|
||||||
|
|
||||||
# Removal defaults
|
|
||||||
remove_systemd_template: true
|
|
||||||
remove_runner_user: true
|
|
||||||
|
|
||||||
# Runner configuration
|
|
||||||
gitea_runner_log_level: "info"
|
|
||||||
gitea_runner_container_label: "gitea-runner=true"
|
|
||||||
gitea_runner_file: ".runner"
|
|
||||||
|
|
||||||
# Docker installation (for rootless dependencies)
|
|
||||||
docker_gpg_key_path: "/etc/apt/keyrings/docker.gpg"
|
|
||||||
docker_apt_arch: "{{ 'amd64' if ansible_facts['architecture'] == 'x86_64' else ansible_facts['architecture'] }}"
|
|
||||||
docker_apt_source_line: >-
|
|
||||||
deb [arch={{ docker_apt_arch }} signed-by={{ docker_gpg_key_path }}]
|
|
||||||
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
|
|
||||||
{{ ansible_facts['distribution_release'] }} stable
|
|
||||||
# Set to false in CI/molecule to skip rootless daemon startup (needs kernel userns)
|
|
||||||
docker_rootless_setup: true
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "molecule-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "deregister-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "lifecycle-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "remove-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "template-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars:
|
|
||||||
gitea_url: "http://localhost:3000"
|
|
||||||
registration_token: "fake-token-for-testing"
|
|
||||||
runner_name: "update-test-runner"
|
|
||||||
skip_runner_registration: true
|
|
||||||
docker_rootless_setup: false
|
|
||||||
roles:
|
|
||||||
- role: gitea-runner
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Check if runner registration file exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
register: runner_file_stat
|
|
||||||
|
|
||||||
- name: Read runner registration file
|
|
||||||
ansible.builtin.slurp:
|
|
||||||
src: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
register: runner_file_content
|
|
||||||
when: runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
|
|
||||||
- name: Parse runner registration data
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
runner_reg: >
|
|
||||||
{{ (runner_file_content.content | b64decode | from_json)
|
|
||||||
if (runner_file_content is defined and runner_file_content.content is defined)
|
|
||||||
else {} }}
|
|
||||||
when: runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
|
|
||||||
- name: Deregister runner from Gitea via API
|
|
||||||
ansible.builtin.command: >
|
|
||||||
curl -sf --connect-timeout 5 --max-time 10 -X DELETE
|
|
||||||
-H "Authorization: token {{ gitea_admin_token | default(registration_token) }}"
|
|
||||||
"{{ gitea_url }}/api/v1/admin/actions/runners/{{ runner_reg.id }}"
|
|
||||||
args:
|
|
||||||
chdir: "{{ gitea_runner_data_dir }}"
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default(0) }}"
|
|
||||||
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default(0) }}/docker.sock"
|
|
||||||
when:
|
|
||||||
- runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
- not skip_runner_registration
|
|
||||||
- runner_reg.id is defined
|
|
||||||
register: deregister_output
|
|
||||||
changed_when: deregister_output.rc == 0
|
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
- name: Warn if deregistration failed
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: >-
|
|
||||||
WARNING: Runner deregistration from Gitea failed (rc={{ deregister_output.rc | default('N/A') }}).
|
|
||||||
The runner entry may remain in Gitea's admin UI as offline.
|
|
||||||
Use an admin token (gitea_admin_token var) to enable automatic cleanup,
|
|
||||||
or remove it manually from {{ gitea_url }}/-/admin/actions/runners
|
|
||||||
when:
|
|
||||||
- runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
- not skip_runner_registration
|
|
||||||
- deregister_output is defined
|
|
||||||
- deregister_output.rc | default(1) != 0
|
|
||||||
|
|
||||||
- name: Remove runner registration file
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
state: absent
|
|
||||||
when: runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Create healthcheck script
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: runner-healthcheck.sh.j2
|
|
||||||
dest: "{{ gitea_runner_healthcheck_script_path }}"
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- name: Create healthcheck user service file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: runner-healthcheck.service.j2
|
|
||||||
dest: "{{ gitea_runner_home }}/.config/systemd/user/runner-healthcheck.service"
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Create healthcheck user timer file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: runner-healthcheck.timer.j2
|
|
||||||
dest: "{{ gitea_runner_home }}/.config/systemd/user/runner-healthcheck.timer"
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Reload systemd user daemon for healthcheck timer
|
|
||||||
ansible.builtin.command: systemctl --user daemon-reload
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when:
|
|
||||||
- systemd_available.stat.exists
|
|
||||||
- docker_rootless_setup
|
|
||||||
|
|
||||||
- name: Enable and start healthcheck user timer
|
|
||||||
ansible.builtin.command: systemctl --user enable --now runner-healthcheck.timer
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when:
|
|
||||||
- systemd_available.stat.exists
|
|
||||||
- docker_rootless_setup
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Check runner registration file exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
register: runner_file_stat
|
|
||||||
|
|
||||||
- name: Read runner registration file
|
|
||||||
ansible.builtin.slurp:
|
|
||||||
src: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
register: runner_file_content
|
|
||||||
when: runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
|
|
||||||
- name: Parse runner registration data
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
runner_reg: >
|
|
||||||
{{ (runner_file_content.content | b64decode | from_json)
|
|
||||||
if (runner_file_content is defined and runner_file_content.content is defined)
|
|
||||||
else {} }}
|
|
||||||
when: runner_file_stat.stat.exists | default(false) | bool
|
|
||||||
|
|
||||||
- name: Verify runner user service active
|
|
||||||
ansible.builtin.command: systemctl --user is-active gitea-runner
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
register: service_check
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- systemd_available.stat.exists
|
|
||||||
- docker_rootless_setup
|
|
||||||
|
|
||||||
- name: Validate runner installation
|
|
||||||
ansible.builtin.fail:
|
|
||||||
msg: >
|
|
||||||
Runner '{{ runner_name }}' is not properly installed:
|
|
||||||
{% if not (runner_file_stat.stat.exists | default(false)) %}
|
|
||||||
- Registration file (.runner) is missing. Registration may have failed.
|
|
||||||
{% endif %}
|
|
||||||
{% if docker_rootless_setup and not (service_check.stdout | default('') | trim) == 'active' %}
|
|
||||||
- Systemd user service is not active.
|
|
||||||
{% endif %}
|
|
||||||
when: >
|
|
||||||
not (runner_file_stat.stat.exists | default(false))
|
|
||||||
or (docker_rootless_setup and not (service_check.stdout | default('') | trim) == 'active')
|
|
||||||
|
|
||||||
- name: Report runner status
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: >
|
|
||||||
Runner '{{ runner_name }}' is installed and running.
|
|
||||||
Registered: {{ runner_file_stat.stat.exists | default(false) }}
|
|
||||||
{% if runner_reg.id is defined %}Runner ID: {{ runner_reg.id }}{% endif %}
|
|
||||||
{% if runner_reg.uuid is defined %}UUID: {{ runner_reg.uuid }}{% endif %}
|
|
||||||
{% if runner_reg.address is defined %}Gitea: {{ runner_reg.address }}{% endif %}
|
|
||||||
Service: {{ service_check.stdout | default('unknown') | trim }}
|
|
||||||
|
|
||||||
- name: Optional Gitea API verification
|
|
||||||
when:
|
|
||||||
- gitea_url is defined
|
|
||||||
- gitea_admin_token is defined
|
|
||||||
- gitea_admin_token | length > 0
|
|
||||||
block:
|
|
||||||
- name: Check admin runners API
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: "{{ gitea_url }}/api/v1/admin/runners"
|
|
||||||
headers:
|
|
||||||
Authorization: "token {{ gitea_admin_token }}"
|
|
||||||
method: GET
|
|
||||||
status_code: [200, 401, 403, 404]
|
|
||||||
return_content: true
|
|
||||||
body_format: json
|
|
||||||
register: admin_api_response
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Check repo runners API
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: "{{ gitea_url }}/api/v1/repos/{{ gitea_runner_test_repo | default('oblachno-oss/grm') }}/actions/runners"
|
|
||||||
headers:
|
|
||||||
Authorization: "token {{ gitea_admin_token }}"
|
|
||||||
method: GET
|
|
||||||
status_code: [200, 401, 403, 404]
|
|
||||||
return_content: true
|
|
||||||
body_format: json
|
|
||||||
register: repo_api_response
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Report API status (informational only)
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: >
|
|
||||||
API checks (informational only — not used for pass/fail):
|
|
||||||
Admin API: {{ admin_api_response.status | default('no response') }}.
|
|
||||||
Repo API: {{ repo_api_response.status | default('no response') }}.
|
|
||||||
{% if admin_api_response.json.runners | default([]) | selectattr('name', 'equalto', runner_name) | list | length > 0 %}
|
|
||||||
Runner found in admin API.
|
|
||||||
{% endif %}
|
|
||||||
{% if repo_api_response.json.runners | default([]) | selectattr('name', 'equalto', runner_name) | list | length > 0 %}
|
|
||||||
Runner found in repo API.
|
|
||||||
{% endif %}
|
|
||||||
rescue:
|
|
||||||
- name: API check failed
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "API verification skipped due to connection or permission error."
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Create docker-prune user service file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: docker-prune.service.j2
|
|
||||||
dest: "{{ gitea_runner_home }}/.config/systemd/user/docker-prune.service"
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Create docker-prune user timer file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: docker-prune.timer.j2
|
|
||||||
dest: "{{ gitea_runner_home }}/.config/systemd/user/docker-prune.timer"
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Reload systemd user daemon for prune timer
|
|
||||||
ansible.builtin.command: systemctl --user daemon-reload
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when:
|
|
||||||
- systemd_available.stat.exists
|
|
||||||
- docker_rootless_setup
|
|
||||||
|
|
||||||
- name: Enable and start docker-prune user timer
|
|
||||||
ansible.builtin.command: systemctl --user enable --now docker-prune.timer
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when:
|
|
||||||
- systemd_available.stat.exists
|
|
||||||
- docker_rootless_setup
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure work directory exists
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ gitea_runner_data_dir }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ gitea_runner_service_user }}"
|
|
||||||
group: "{{ gitea_runner_service_user }}"
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- name: Check if runner is already registered
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ gitea_runner_data_dir }}/.runner"
|
|
||||||
register: runner_registered
|
|
||||||
|
|
||||||
- name: Register runner with Gitea
|
|
||||||
ansible.builtin.command: >
|
|
||||||
{{ gitea_runner_binary_path }} register
|
|
||||||
--token {{ registration_token }}
|
|
||||||
--name {{ runner_name }}
|
|
||||||
--instance {{ gitea_url }}
|
|
||||||
--labels {{ runner_labels }}
|
|
||||||
--no-interactive
|
|
||||||
args:
|
|
||||||
chdir: "{{ gitea_runner_data_dir }}"
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid | default(0) }}"
|
|
||||||
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid | default(0) }}/docker.sock"
|
|
||||||
when: not runner_registered.stat.exists
|
|
||||||
register: register_output
|
|
||||||
changed_when: "'already exists' not in register_output.stdout | default('')"
|
|
||||||
timeout: 60
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure keyrings directory exists (Debian/Ubuntu)
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "/etc/apt/keyrings"
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
|
||||||
|
|
||||||
- name: Download and dearmor Docker GPG key (Debian/Ubuntu)
|
|
||||||
ansible.builtin.shell: |
|
|
||||||
set -o pipefail
|
|
||||||
curl -fsSL "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg" | gpg --dearmor --yes -o {{ docker_gpg_key_path }}
|
|
||||||
args:
|
|
||||||
creates: "{{ docker_gpg_key_path }}"
|
|
||||||
executable: /bin/bash
|
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
|
||||||
|
|
||||||
- name: Add Docker APT repository (Debian/Ubuntu)
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: /etc/apt/sources.list.d/docker.list
|
|
||||||
content: "{{ docker_apt_source_line }}\n"
|
|
||||||
mode: "0644"
|
|
||||||
register: docker_apt_repo
|
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
|
||||||
|
|
||||||
- name: Update apt cache after adding Docker repo (Debian/Ubuntu)
|
|
||||||
ansible.builtin.apt:
|
|
||||||
update_cache: true
|
|
||||||
when:
|
|
||||||
- ansible_facts['os_family'] == 'Debian'
|
|
||||||
- docker_apt_repo is changed
|
|
||||||
|
|
||||||
- name: Install rootless Docker dependencies (Debian/Ubuntu)
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name:
|
|
||||||
- uidmap
|
|
||||||
- slirp4netns
|
|
||||||
- fuse-overlayfs
|
|
||||||
- docker-ce
|
|
||||||
- docker-ce-cli
|
|
||||||
- docker-ce-rootless-extras
|
|
||||||
- containerd.io
|
|
||||||
- docker-compose-plugin
|
|
||||||
- rsync
|
|
||||||
state: present
|
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
|
||||||
|
|
||||||
- name: Update pacman cache (Arch Linux)
|
|
||||||
community.general.pacman:
|
|
||||||
update_cache: true
|
|
||||||
when: ansible_facts['os_family'] == 'Archlinux'
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Install rootless Docker dependencies (Arch Linux)
|
|
||||||
community.general.pacman:
|
|
||||||
name:
|
|
||||||
- docker
|
|
||||||
- docker-compose
|
|
||||||
- slirp4netns
|
|
||||||
- fuse-overlayfs
|
|
||||||
- rsync
|
|
||||||
state: present
|
|
||||||
when: ansible_facts['os_family'] == 'Archlinux'
|
|
||||||
|
|
||||||
- name: Check if rootless Docker is already set up
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ gitea_runner_home }}/.config/systemd/user/docker.service"
|
|
||||||
register: rootless_docker_check
|
|
||||||
|
|
||||||
- name: Set up rootless Docker for runner user
|
|
||||||
ansible.builtin.command: dockerd-rootless-setuptool.sh install
|
|
||||||
args:
|
|
||||||
creates: "{{ gitea_runner_home }}/.config/systemd/user/docker.service"
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
when:
|
|
||||||
- docker_rootless_setup
|
|
||||||
- not rootless_docker_check.stat.exists
|
|
||||||
|
|
||||||
- name: Start rootless Docker daemon (systemd user service)
|
|
||||||
ansible.builtin.command: systemctl --user start docker
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when: docker_rootless_setup
|
|
||||||
|
|
||||||
- name: Enable rootless Docker daemon (systemd user service)
|
|
||||||
ansible.builtin.command: systemctl --user enable docker
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
changed_when: true
|
|
||||||
when: docker_rootless_setup
|
|
||||||
|
|
||||||
- name: Wait for rootless Docker daemon to be ready
|
|
||||||
ansible.builtin.command: docker version
|
|
||||||
become: true
|
|
||||||
become_user: "{{ gitea_runner_service_user }}"
|
|
||||||
environment:
|
|
||||||
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid }}/docker.sock"
|
|
||||||
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
||||||
register: docker_ready
|
|
||||||
until: docker_ready.rc == 0
|
|
||||||
retries: 10
|
|
||||||
delay: 2
|
|
||||||
changed_when: false
|
|
||||||
when: docker_rootless_setup
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user