ONC-69: PR preview with manual acceptance #71

Merged
martin merged 16 commits from issue/69/onc-69-pr-vorschau-mit-manueller-abnahme into main 2026-12-05 12:39:21 +01:00
Owner

Closes #69

What changed

PR preview with manual acceptance (ADR 0035):

  • .forgejo/workflows/preview.yml: for every same-repo PR against main, on runner dev-docker:

    • waits for a green CI / build-and-test (pull_request), then deploys from scratch;
    • removes everything on merge or close; nightly cleanup of orphaned previews;
    • updates one PR comment (deploying / ready / failed / removed "Vorschau entfernt"). Not a required check, so it never blocks the merge. Forks get no preview.
  • scripts/preview/: compose stack per PR (onc-preview-<pr>, ports 10000/11000/12000 + pr) with:

    • Nextcloud with Collectives and a seeded collective "ONC Preview";
    • linuxserver/obsidian on HTTPS (self-signed);
    • nginx serving main.js, manifest.json and styles.css for a phone.

    configure-obsidian.mjs sets the vault up over CDP: restricted mode off, app password in the secret storage, first sync must succeed. lib.mjs holds the pure helpers (79 unit tests).

  • The Nextcloud accounts are the throwaway ones of scripts/dev-nextcloud/.env.example: alice and admin. They are known in advance, so they stand in the PR template, the comment, AGENTS.md and the guides.

  • tests/acceptance/onc-69/: example case (vault, collective, guide EN/DE), seeded in this PR's own preview.

  • AGENTS.md section "Manual acceptance", the CLAUDE.md line, the new .forgejo/pull_request_template.md.

  • Docs: ADR 0035, docs/architecture.md, docs/ci-runner.md (runner dev-docker, requirements, ports, RAM), docs/release.md, CONTRIBUTING.md.

Tests

  • Gate a): npm run build, npm run lint and npm test (2195/2195) are green; also node --check on the scripts and a YAML parse of the workflow.
    • npm run test:int (88/88) is green as of 4315ad3. The later commits only change preview scripts, docs and a comment line in .env.example.
    • The baseline on main cc3a04d was green.
  • Gate b), local end-to-end against a fake Forgejo API (real Docker, real Nextcloud and Obsidian):
    • deploy with the case: 5 notes in the vault, first sync verified, ready comment;
    • sign-in as alice and as admin works (HTTP 200);
    • a redeploy creates a fresh volume and edits the same comment;
    • teardown removes containers and volumes and writes "Vorschau entfernt";
    • a second PR deployed in parallel on separate ports;
    • red CI deploys nothing and writes a failed comment;
    • cleanup re-checks each PR before deleting (closed and 404);
    • a spoofed marker comment (PATCH 403) leads to exactly one own comment.
  • Gate c), agents:
    • Susanne → Claude (Haiku), standard.
    • Kalle → Claude (Haiku), standard.
    • Timo → Claude (Opus), standard.
    • Phil → OpenAI (GPT-6.2-Sol, high), standard: about 328k input tokens. Re-review at medium: about 142k.
    • Nils → OpenAI (GPT-6.2-Astra, high), standard: about 329k input tokens. Re-review at medium: about 86k.
    • Total OpenAI: about 885k input tokens. Pair rule met.
    • All findings fixed, except those named under "Open points".
    • The later change to the accounts was not reviewed again.
  • Gate d): story comment on #69 with the decisions.

Manual acceptance

  • Preview: https://192.168.6.138:10071 (Obsidian in the browser), http://192.168.6.138:11071 (Nextcloud). The preview comment on this PR is authoritative. It can only appear once runner dev-docker exists.
  • Nextcloud: alice / local-alice-pw, admin admin / local-admin-pw (throwaway, scripts/dev-nextcloud/.env.example)
  • Guide: tests/acceptance/onc-69/guide.en.md · tests/acceptance/onc-69/guide.de.md

Open points

Not verified:

  • The end-to-end run on Forgejo with two real PRs: runner dev-docker is not set up yet (docs/ci-runner.md).
  • A visual check of Obsidian in the browser: only checked through CDP and the vault contents.

Accepted risks (ADR 0035):

  • PR code runs on the host runner with Docker; the checkout keeps git credentials for the base fetch.
  • The Selkies desktop has no login.
  • The Nextcloud passwords are public in the repository.
  • The build files are served over HTTP on the LAN.
  • The setup relies on Obsidian internals and the latest image.
  • PR numbers above 999 get no preview.

Left from review, documented:

  • Several cases in one PR overwrite each other on overlapping files.
  • Case files can still set other .obsidian config.
  • A narrow race between cleanup and a reopen.
  • No orchestration tests for preview.mjs (it was checked end-to-end instead).

Follow-ups:

  • A workflow_dispatch redeploy input.
  • Pin the image tag.
  • A shared CDP module with scripts/screenshots.
  • scripts/affects-tests.sh treats acceptance cases as test-relevant.

🤖 Generated with Claude Code

Closes #69 ## What changed PR preview with manual acceptance (ADR 0035): - `.forgejo/workflows/preview.yml`: for every same-repo PR against `main`, on runner `dev-docker`: - waits for a green `CI / build-and-test (pull_request)`, then deploys from scratch; - removes everything on merge or close; nightly cleanup of orphaned previews; - updates one PR comment (deploying / ready / failed / removed "Vorschau entfernt"). Not a required check, so it never blocks the merge. Forks get no preview. - `scripts/preview/`: compose stack per PR (`onc-preview-<pr>`, ports 10000/11000/12000 + pr) with: - Nextcloud with Collectives and a seeded collective "ONC Preview"; - linuxserver/obsidian on HTTPS (self-signed); - nginx serving `main.js`, `manifest.json` and `styles.css` for a phone. `configure-obsidian.mjs` sets the vault up over CDP: restricted mode off, app password in the secret storage, first sync must succeed. `lib.mjs` holds the pure helpers (79 unit tests). - The Nextcloud accounts are the throwaway ones of `scripts/dev-nextcloud/.env.example`: `alice` and `admin`. They are known in advance, so they stand in the PR template, the comment, `AGENTS.md` and the guides. - `tests/acceptance/onc-69/`: example case (vault, collective, guide EN/DE), seeded in this PR's own preview. - `AGENTS.md` section "Manual acceptance", the `CLAUDE.md` line, the new `.forgejo/pull_request_template.md`. - Docs: ADR 0035, `docs/architecture.md`, `docs/ci-runner.md` (runner `dev-docker`, requirements, ports, RAM), `docs/release.md`, `CONTRIBUTING.md`. ## Tests - Gate a): `npm run build`, `npm run lint` and `npm test` (2195/2195) are green; also `node --check` on the scripts and a YAML parse of the workflow. - `npm run test:int` (88/88) is green as of 4315ad3. The later commits only change preview scripts, docs and a comment line in `.env.example`. - The baseline on main cc3a04d was green. - Gate b), local end-to-end against a fake Forgejo API (real Docker, real Nextcloud and Obsidian): - deploy with the case: 5 notes in the vault, first sync verified, ready comment; - sign-in as `alice` and as `admin` works (HTTP 200); - a redeploy creates a fresh volume and edits the same comment; - teardown removes containers and volumes and writes "Vorschau entfernt"; - a second PR deployed in parallel on separate ports; - red CI deploys nothing and writes a failed comment; - cleanup re-checks each PR before deleting (closed and 404); - a spoofed marker comment (PATCH 403) leads to exactly one own comment. - Gate c), agents: - Susanne → Claude (Haiku), standard. - Kalle → Claude (Haiku), standard. - Timo → Claude (Opus), standard. - Phil → OpenAI (GPT-6.2-Sol, high), standard: about 328k input tokens. Re-review at medium: about 142k. - Nils → OpenAI (GPT-6.2-Astra, high), standard: about 329k input tokens. Re-review at medium: about 86k. - Total OpenAI: about 885k input tokens. Pair rule met. - All findings fixed, except those named under "Open points". - The later change to the accounts was not reviewed again. - Gate d): story comment on #69 with the decisions. ## Manual acceptance - Preview: https://192.168.6.138:10071 (Obsidian in the browser), http://192.168.6.138:11071 (Nextcloud). The preview comment on this PR is authoritative. It can only appear once runner `dev-docker` exists. - Nextcloud: `alice` / `local-alice-pw`, admin `admin` / `local-admin-pw` (throwaway, `scripts/dev-nextcloud/.env.example`) - Guide: `tests/acceptance/onc-69/guide.en.md` · `tests/acceptance/onc-69/guide.de.md` ## Open points Not verified: - The end-to-end run on Forgejo with two real PRs: runner `dev-docker` is not set up yet (docs/ci-runner.md). - A visual check of Obsidian in the browser: only checked through CDP and the vault contents. Accepted risks (ADR 0035): - PR code runs on the host runner with Docker; the checkout keeps git credentials for the base fetch. - The Selkies desktop has no login. - The Nextcloud passwords are public in the repository. - The build files are served over HTTP on the LAN. - The setup relies on Obsidian internals and the `latest` image. - PR numbers above 999 get no preview. Left from review, documented: - Several cases in one PR overwrite each other on overlapping files. - Case files can still set other `.obsidian` config. - A narrow race between cleanup and a reopen. - No orchestration tests for `preview.mjs` (it was checked end-to-end instead). Follow-ups: - A `workflow_dispatch` redeploy input. - Pin the image tag. - A shared CDP module with `scripts/screenshots`. - `scripts/affects-tests.sh` treats acceptance cases as test-relevant. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ONC-69: Try every marked comment before writing a new one; one failed PR lookup no longer stops the cleanup
All checks were successful
Preview / Remove (pull_request) Has been skipped
Preview / Remove orphaned previews (pull_request) Has been skipped
Integration (Nextcloud versions) / Nextcloud latest (pull_request) Successful in 2s
CI / build-and-test (pull_request) Successful in 1m23s
CI / mirror-github (pull_request) Has been skipped
Integration (Nextcloud versions) / Nextcloud 35 (pull_request) Successful in 7m47s
Preview / Deploy (pull_request) Successful in 1m17s
4315ad386e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

PR preview: removed (Vorschau entfernt)

The pull request is closed or merged, so its preview environment was removed.

Commit f2e0d7e3d3a379d704eaf0ae68e36f1d106eeb77 · Workflow run

<!-- onc-preview --> ### PR preview: removed (Vorschau entfernt) The pull request is closed or merged, so its preview environment was removed. Commit `f2e0d7e3d3a379d704eaf0ae68e36f1d106eeb77` · [Workflow run](https://forgejo.home.msc.wtf/keineantwort.de/nextcloud-collectives/actions/runs/215)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ONC-69: Name the preview accounts in the PR template, AGENTS.md, ADR 0035 and the guides
All checks were successful
Preview / Remove orphaned previews (pull_request) Has been skipped
Integration (Nextcloud versions) / Nextcloud latest (pull_request) Successful in 4s
CI / build-and-test (pull_request) Successful in 1m51s
CI / mirror-github (pull_request) Has been skipped
Integration (Nextcloud versions) / Nextcloud 35 (pull_request) Successful in 12m1s
Preview / Deploy (pull_request) Has been skipped
Preview / Remove (pull_request) Successful in 7s
f2e0d7e3d3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
martin merged commit 3119d0dc63 into main 2026-12-05 12:39:21 +01:00
martin deleted branch issue/69/onc-69-pr-vorschau-mit-manueller-abnahme 2026-12-05 12:39:22 +01:00
Sign in to join this conversation.
No reviewers
No labels
factory:go
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keineantwort.de/nextcloud-collectives!71
No description provided.