Skip to content

ci(pull-request): hardening — concurrency, draft-skip, permissions, timeout#450

Merged
TaprootFreak merged 2 commits into
developfrom
feat/ci-hardening
May 20, 2026
Merged

ci(pull-request): hardening — concurrency, draft-skip, permissions, timeout#450
TaprootFreak merged 2 commits into
developfrom
feat/ci-hardening

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Adopt the CI-check patterns from zkcoins/server ci.yaml in pull-request.yaml.

  • Concurrency group keyed by PR head SHA with cancel-in-progress: true so a new push aborts the obsolete macOS run (~10 min saved per push).
  • Skip on draft PRs via if: github.event.pull_request.draft == false. ready_for_review added to pull_request.types so toggling draft → ready triggers CI immediately. Matches our gh pr create --draft workflow.
  • push: develop trigger as authoritative post-merge gate, independent of PR state.
  • Workflow-level permissions: contents: read (least privilege).
  • Explicit timeout-minutes: 30 to bound stuck macOS runs.
  • Inline comments document the WHY for every non-obvious choice (mirrors the zkcoins/server style).

What is intentionally NOT included

  • Linux migration of the job — kept macos-latest for now. Native-plugin surface (bitbox_flutter Go-FFI, Sumsub) is risky to validate inside this PR; the existing macOS baseline is preserved as-is.
  • Coverage-threshold gate — README "Coverage infrastructure roadmap" calls it out as still aspirational. Lcov filter + upload behavior unchanged.
  • Heavy/label-gated job — zkcoins/server splits cheap lint + heavy tests behind ci:full. RealUnit has no self-hosted-runner gate to justify the split today.
  • Handbook smoke tests — would require canonical realuni.app URLs which currently do not resolve (Infomaniak NS swap pending). Will follow up once DNS is live.

Test plan

  • CI runs on this draft PR? → should NOT (draft-skip).
  • Mark PR ready for review → CI fires once.
  • Push a follow-up commit while CI is running → previous run is cancelled.
  • Post-merge: push: develop run is green.

…imeout

Adopt zkcoins/server ci.yaml patterns:
- Concurrency group keyed by PR head SHA with cancel-in-progress so a
  new push aborts the obsolete macOS run (~10 min saved per push).
- Skip workflow on draft PRs (matches our `gh pr create --draft` flow);
  `ready_for_review` added to types so toggling draft → ready fires CI
  immediately.
- `push: develop` added as authoritative post-merge gate (independent
  of PR state).
- Workflow-level `permissions: contents: read` (least privilege).
- Explicit `timeout-minutes: 30` to bound stuck macOS runs.
- Inline comments document the WHY for each non-obvious choice.
…en comments

- Drop `main` from `pull_request.branches`: the release PR (develop → main)
  is auto-opened by `auto-release-pr.yaml`, so every push to develop would
  otherwise fire a duplicate `pull_request` run on the release PR for the
  same SHA — concurrency cancels one and surfaces a red check. Matches
  the comment block and the zkcoins/server reference.
- Rename concurrency group prefix `pr-` → `ci-` (the group covers `push`
  and `workflow_dispatch` events too; `pr-` was misleading on those).
- Document why `labeled` / `unlabeled` types are intentionally omitted
  (no label-gated heavy job in realunit-app).
- Document that `workflow_dispatch` is a manual override and is NOT
  draft-gated.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 19, 2026 21:00
@TaprootFreak TaprootFreak merged commit 905b7d1 into develop May 20, 2026
2 of 3 checks passed
@TaprootFreak TaprootFreak deleted the feat/ci-hardening branch May 20, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant