Skip to content

Commit 8265af7

Browse files
add github actions test workflow + branch protection prep (PR-3 fast loop) (#102)
* add github actions test workflow and update merge-gate doc (PR-3 fast loop) implements PR-3 from plans/PLAN-TEST-SUITE-FAST-LOOP.md. - .github/workflows/test.yml: pytest tests -v on pull_request and on push to master; python 3.11; pip install -r requirements.txt + pip install -e . (registers the java-codebase-rag cli entry point for shutil.which checks in tests/test_java_codebase_rag_cli.py); JAVA_CODEBASE_RAG_RUN_HEAVY=0. - workflow + job both named "test" so the check-context string is deterministic (verify with `gh pr checks` before applying branch protection per plan resolved-decisions table). - tests/README.md: tighten the "Merge gate (mechanical)" paragraph to point at the now-real workflow file; drop the "until that lands" hedge; document `enforce_admins: false` break-glass policy. tier tables, consumer matrix, and iteration-subset paragraph untouched (PR-1 / PR-2 own those). note: PR-1 (#100) and PR-2 (#101) merged before PR-3, contrary to the plan's stated PR-3 → PR-1 → PR-2 order. branch protection still requires the dummy-failure validation step before the gh api call that locks master. Co-authored-by: Cursor <cursoragent@cursor.com> * fix doc: actual check-context is "test" not "test / test" verified with `gh pr checks 102` after the first workflow run on this branch — github collapses the context when workflow name and job name match. update tests/README.md merge-gate paragraph to use the verbatim string so the gh-api branch-protection call in the PR body works. Co-authored-by: Cursor <cursoragent@cursor.com> * move test-suite-fast-loop propose + plan to completed/ whole effort landed: PR-1 (#100), PR-2 (#101), PR-3 (#102). per .cursor/rules/agent-workflow.mdc, move propose / plan into the completed/ trees once the *whole* effort is landed — not after each PR. - propose/TEST-SUITE-FAST-LOOP-PROPOSE.md → propose/completed/ (status header flipped to "locked — implemented across PR-1..PR-3") - plans/PLAN-TEST-SUITE-FAST-LOOP.md → plans/completed/ (status flipped to "completed"; tracking footer notes merged PRs and the PR-1 → PR-2 → PR-3 landing-order divergence) - update inbound links: - tests/README.md iteration-subset paragraph: point at the completed/ paths; drop the now-stale "once the merge gate from PR-3 exists" wording since it now exists. - .cursor/skills/plan-prompts/SKILL.md: bump the two cross-refs in the "Tests to run (iteration loop) — required subsection". - automation/cursor_propose_only/README.md: swap the autopilot example --proposal arg to TIER2-INCREMENTAL-REBUILD-PROPOSE.md so the copy-pasteable command keeps pointing at an active propose. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2738a84 commit 8265af7

6 files changed

Lines changed: 38 additions & 13 deletions

File tree

.cursor/skills/plan-prompts/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Each PR prompt must include all of:
5959

6060
### Tests to run (iteration loop) — required subsection
6161

62-
Per [`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md) and [`plans/PLAN-TEST-SUITE-FAST-LOOP.md`](../../../plans/PLAN-TEST-SUITE-FAST-LOOP.md) PR-2:
62+
Per [`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md) and [`plans/completed/PLAN-TEST-SUITE-FAST-LOOP.md`](../../../plans/completed/PLAN-TEST-SUITE-FAST-LOOP.md) PR-2:
6363

6464
- Add a markdown section with the **exact heading** `## Tests to run (iteration loop)` inside the fenced **Prompt** block, **immediately after** `## Deliverables` and **before** `## Tests`.
6565
- Content: bullet list of `tests/test_*.py` paths, each with a **one-line rationale** tied to the PR’s code paths.

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
test:
10+
name: test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.11"
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install -r requirements.txt
21+
pip install -e .
22+
- name: Run tests
23+
env:
24+
JAVA_CODEBASE_RAG_RUN_HEAVY: "0"
25+
run: pytest tests -v

automation/cursor_propose_only/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ use `autopilot.py`.
109109
--repo-root . \
110110
--proposal-dir propose \
111111
--output-dir reports/propose_automation_selected \
112-
--proposal TEST-SUITE-FAST-LOOP-PROPOSE.md \
112+
--proposal TIER2-INCREMENTAL-REBUILD-PROPOSE.md \
113113
--planning-rounds 2 \
114114
--planning-min-severity medium \
115115
--implementation-rounds 2 \

plans/PLAN-TEST-SUITE-FAST-LOOP.md renamed to plans/completed/PLAN-TEST-SUITE-FAST-LOOP.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Plan: test suite fast loop
22

3-
Status: **active (planning)**. This plan implements
4-
[`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md).
3+
Status: **completed**. This plan implements
4+
[`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md).
55

66
Depends on: **none** (first landing is CI so later fixture work is mechanically validated).
77

@@ -50,7 +50,7 @@ Depends on: **none** (first landing is CI so later fixture work is mechanically
5050
| `tests/_builders.py` | Thin wrappers importing **production** `build_ast_graph` passes — **no copied logic**. Several tests today run **pass5/6** (`pass5_imperative_edges`, `pass6_match_edges`); the shipped helper(s) must match each call site (appendix in propose shows pass1–4 + `write_kuzu` only — extend as needed for Tier-2 session builds and any Tier-3 caller that needs the full pipeline). |
5151
| Mixed files | **`test_ast_graph_build.py`**: most tests already use `kuzu_db_path`; two tests rebuild `route_extraction_smoke` into `tmp_path` — prefer **`kuzu_graph_route_extraction_smoke`** (session) if assertions are read-only, else Tier-3 helper. **`test_kuzu_queries.py`**: audit the `route_extraction_smoke` inline build (≈ line 403); same rule. |
5252
| **`test_call_edge_matching.py`** | Mostly pure `_match_call_edge` / `graph_enrich` source reads; `_build_tables` hits **`cross_service_smoke`** read-only — candidate for **Tier 2** session materialization or a **`build_graph_tables(root)`** helper (no Kuzu) per audit, even though propose listed it under Tier 3. **Audit outcome wins** over the propose table row. |
53-
| PR-2 delivery | **`plan-prompts`** and **`pr-review`** live under **`.cursor/skills/`** in git. **`tests/README.md` merged in PR-1** must already point at **[`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md)** (and this plan) and link both skills so contributors find the canonical copies. |
53+
| PR-2 delivery | **`plan-prompts`** and **`pr-review`** live under **`.cursor/skills/`** in git. **`tests/README.md` merged in PR-1** must already point at **[`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md)** (and this plan) and link both skills so contributors find the canonical copies. |
5454

5555
---
5656

@@ -147,7 +147,7 @@ Target modules from propose (verify no writes to fixture dirs / session DB):
147147
### 6. `tests/README.md`
148148

149149
- **Extend the same “CI merge gate” / testing doc section PR-3 started** — append, do not create a second competing “how tests work” chapter.
150-
- Document **three-tier model**, when to add a new session fixture, Tier-2 audit rule, **bank-chat consumer matrix** expectation for future edits, and the **iteration subset** convention with links to **[`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md)** + this plan; link the repo **`plan-prompts`** and **`pr-review`** skills under `.cursor/skills/` (PR-2 aligns both; either may land before the other if text already matches).
150+
- Document **three-tier model**, when to add a new session fixture, Tier-2 audit rule, **bank-chat consumer matrix** expectation for future edits, and the **iteration subset** convention with links to **[`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md)** + this plan; link the repo **`plan-prompts`** and **`pr-review`** skills under `.cursor/skills/` (PR-2 aligns both; either may land before the other if text already matches).
151151
- Document **before/after** timing capture expectation for the PR-1 description (per propose §9 #10).
152152

153153
## Tests for PR-1
@@ -194,7 +194,7 @@ Representative high-signal modules to re-run locally during implementation (not
194194

195195
### In this repository (`plan-prompts`)
196196

197-
1. **[`.cursor/skills/plan-prompts/`](../.cursor/skills/plan-prompts/)** — each generated **`plans/CURSOR-PROMPTS-*.md`** per-PR **Prompt** block includes **`## Tests to run (iteration loop)`** between **Deliverables** and **Tests**: bullet list of `tests/test_*.py` paths + one-line rationale; allow **empty / docs-only** pattern (UC15). Skill text, scaffold, and examples stay aligned with [`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md) §5.
197+
1. **[`.cursor/skills/plan-prompts/`](../.cursor/skills/plan-prompts/)** — each generated **`plans/CURSOR-PROMPTS-*.md`** per-PR **Prompt** block includes **`## Tests to run (iteration loop)`** between **Deliverables** and **Tests**: bullet list of `tests/test_*.py` paths + one-line rationale; allow **empty / docs-only** pattern (UC15). Skill text, scaffold, and examples stay aligned with [`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md) §5.
198198

199199
### In this repository (`pr-review`)
200200

@@ -249,6 +249,6 @@ Representative high-signal modules to re-run locally during implementation (not
249249

250250
# Tracking
251251

252-
- **PR-3 (CI + protection)**: _pending_
253-
- **PR-1 (fixtures)**: _pending_
254-
- **PR-2 (plan-prompts + pr-review)**: _pending_
252+
- **PR-1 (fixtures)**: merged in #100 (`d83cd30`)
253+
- **PR-2 (plan-prompts + pr-review)**: merged in #101 (`2738a84`)
254+
- **PR-3 (CI + protection)**: merged in #102 (`cursor/pr-3-ci-workflow``master`); branch protection on `master` requires the `test` status check, force-push disabled, `enforce_admins: false`. Landing order ended up PR-1 → PR-2 → PR-3 rather than the plan's stated PR-3 → PR-1 → PR-2; PR-3's green check closed the window.

propose/TEST-SUITE-FAST-LOOP-PROPOSE.md renamed to propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TEST-SUITE-FAST-LOOP — collapse repeated graph builds and ship per-PR test selection
22

3-
**Status**: under review
3+
**Status**: locked — implemented across PR-1 (#100), PR-2 (#101), and PR-3 (#102).
44
**Author**: Dmitriy Teriaev + Computer
55
**Date**: 2026-05-12 (v3)
66

tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ cd /path/to/java-codebase-rag
3131

3232
## CI merge gate and fixture tiers
3333

34-
**Merge gate (mechanical):** GitHub Actions is intended to run the full default suite (`pytest tests` with `JAVA_CODEBASE_RAG_RUN_HEAVY` unset or `0`) on every pull request and on pushes to `master`. The workflow file is added under `.github/workflows/` as part of PR-3 in [`plans/PLAN-TEST-SUITE-FAST-LOOP.md`](../plans/PLAN-TEST-SUITE-FAST-LOOP.md); until that lands, running the full suite locally before merge remains the safety check.
34+
**Merge gate (mechanical):** [`.github/workflows/test.yml`](../.github/workflows/test.yml) runs `pytest tests` with `JAVA_CODEBASE_RAG_RUN_HEAVY=0` on every pull request and on every push to `master`. Branch protection on `master` requires the `test` status check to pass before merge and disables force-push. Break-glass policy: `enforce_admins: false` so the sole maintainer can bypass for emergency hotfixes — explain the bypass in the merge commit.
3535

36-
**Iteration subset (convention):** During implementation, authors name a `pytest` file subset inside each per-PR execution prompt (for example in `plans/CURSOR-PROMPTS-*.md`). The repo **[`plan-prompts`](../.cursor/skills/plan-prompts/SKILL.md)** skill (`.cursor/skills/plan-prompts/`) requires a **`## Tests to run (iteration loop)`** section in that scaffold, placed **after Deliverables and before Tests**. Reviewers follow the repo **[`pr-review`](../.cursor/skills/pr-review/SKILL.md)** skill (`.cursor/skills/pr-review/`): pasted subset command + exit code, and a green full-suite CI link once the merge gate from [`plans/PLAN-TEST-SUITE-FAST-LOOP.md`](../plans/PLAN-TEST-SUITE-FAST-LOOP.md) PR-3 exists. Canonical skill sources live under `.cursor/skills/`; you may copy them into `~/.cursor/skills/` if your Cursor setup loads personal skills only. See [`propose/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/TEST-SUITE-FAST-LOOP-PROPOSE.md).
36+
**Iteration subset (convention):** During implementation, authors name a `pytest` file subset inside each per-PR execution prompt (for example in `plans/CURSOR-PROMPTS-*.md`). The repo **[`plan-prompts`](../.cursor/skills/plan-prompts/SKILL.md)** skill (`.cursor/skills/plan-prompts/`) requires a **`## Tests to run (iteration loop)`** section in that scaffold, placed **after Deliverables and before Tests**. Reviewers follow the repo **[`pr-review`](../.cursor/skills/pr-review/SKILL.md)** skill (`.cursor/skills/pr-review/`): pasted subset command + exit code, plus a green full-suite CI link from the now-real merge gate documented above. Canonical skill sources live under `.cursor/skills/`; you may copy them into `~/.cursor/skills/` if your Cursor setup loads personal skills only. See [`propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md`](../propose/completed/TEST-SUITE-FAST-LOOP-PROPOSE.md) and [`plans/completed/PLAN-TEST-SUITE-FAST-LOOP.md`](../plans/completed/PLAN-TEST-SUITE-FAST-LOOP.md).
3737

3838
**Fixture tiers (PR-1):**
3939

0 commit comments

Comments
 (0)