CodeWhale icon indicating copy to clipboard operation
CodeWhale copied to clipboard

chore: add contribution gate workflows

Open nightt5879 opened this issue 6 months ago • 5 comments

Summary

  • add a scoped .github/APPROVED_CONTRIBUTORS allowlist for PR, issue, and all-access entries
  • add PR and issue gate workflows that default to dry-run / comment-only mode, with CONTRIBUTION_GATE_MODE: enforce as the explicit close switch
  • add a maintainer approval workflow that opens an allowlist update PR from exact /lgtm / /lgtmi commands and avoids duplicate pending allowlist PRs across paginated open PRs
  • document the contribution gate, dry-run rollout, active-contributor seeding expectation, and mistaken-gate restoration flow in CONTRIBUTING.md

Closes #2086 Closes #688

Testing

  • [x] Parsed .github/workflows/pr-gate.yml, .github/workflows/issue-gate.yml, and .github/workflows/approve-contributor.yml with PyYAML
  • [x] Ran node --check on each embedded actions/github-script block after wrapping it the way GitHub Script executes async code
  • [x] git diff --check
  • [x] git diff --cached --check
  • [x] cargo fmt --all -- --check
  • [x] PR CI Lint
  • [x] PR CI Test (ubuntu-latest)
  • [x] PR CI Test (macos-latest)
  • [x] PR CI Test (windows-latest)
  • [x] PR CI Mobile runtime smoke
  • [x] PR CI Version drift
  • [x] PR CI npm wrapper smoke (ubuntu-latest)
  • [x] PR CI GitGuardian Security Checks
  • [x] PR CI Greptile Review

Note: actionlint and Ruby were not installed on this Windows checkout, so local workflow validation used PyYAML plus Node syntax checks. The broader Rust validation is covered by the green PR CI jobs above.

Checklist

  • [x] Updated docs or comments as needed
  • [x] Added or updated tests where relevant
    • Covered by local workflow YAML parsing, embedded GitHub Script syntax checks, and green PR CI.
  • [x] Verified TUI behavior manually if UI changes
    • No TUI behavior changes.

nightt5879 avatar Jun 02 '26 02:06 nightt5879

[!WARNING] You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

gemini-code-assist avatar Jun 02 '26 02:06 gemini-code-assist

Follow-up review fixes are now in 0ebfcb7b and c70c350c:

  • Removed the branch-prefix-only PR gate bypass; legitimate approval PRs are covered by the github-actions[bot] exemption.
  • Added the reciprocal /lgtmi guard so issue approval commands used on pull requests produce a corrective hint instead of silently granting issue-only access.
  • Removed undocumented bare-username allowlist checks from both gates.
  • Aligned pr-gate.yml with issue-gate.yml by reading .github/APPROVED_CONTRIBUTORS from the repository default branch, matching where approve-contributor.yml writes updates.

Re-ran workflow YAML parsing, embedded GitHub Script node --check, git diff --check, staged diff check, and cargo fmt --all -- --check after the fixes.

nightt5879 avatar Jun 02 '26 02:06 nightt5879

Thanks @nightt5879. There is real effort here, and the /lgtm / /lgtmi approval flow is a thoughtful way to turn drive-by contribution control into a maintainable process instead of a hard-coded blocklist.

I am not pulling this into v0.8.50 because it changes community policy and can automatically close contributor work. For the next review pass, the path I would like to see is:

  • Add a dry-run/comment-only mode first, so maintainers can observe the gate before it closes PRs/issues.
  • Seed the allowlist broadly enough for existing active contributors before enabling enforcement.
  • Keep reading the allowlist from the default branch, as the latest commit now does.
  • Document exactly how a good external contributor gets restored if the gate fires incorrectly.

CI is green now, so this is not being skipped for code quality; it is being held for rollout safety.

Hmbown avatar Jun 02 '26 02:06 Hmbown

Thanks, I adjusted the PR along that rollout-safety path.

Follow-up changes are now in 433a8eae and 22f602d0:

  • The PR/issue gates now default to CONTRIBUTION_GATE_MODE: dry-run, so merge-time behavior is comment-only and does not close contributor work. Switching to enforce is now an explicit workflow change after maintainers are ready.
  • The allowlist header and CONTRIBUTING.md now call out the active-contributor seeding step before enforcement is enabled.
  • The gates continue reading .github/APPROVED_CONTRIBUTORS from the repository default branch.
  • CONTRIBUTING.md now documents the mistaken-gate recovery path: approve with /lgtm or /lgtmi, merge the generated allowlist PR, then reopen or ask the contributor to resubmit if reopening is not available.
  • I also handled the latest Greptile follow-up by paginating the pending allowlist PR lookup, so duplicate-PR suppression is not capped at the first 100 open PRs.

Validation after the changes:

  • local workflow YAML parsing passed
  • embedded GitHub Script node --check passed
  • git diff --check and staged diff check passed
  • cargo fmt --all -- --check passed
  • PR CI is green across Lint, ubuntu/macos/windows tests, mobile smoke, version drift, npm wrapper smoke, GitGuardian, and Greptile

nightt5879 avatar Jun 02 '26 03:06 nightt5879

Hey @nightt5879 — the contribution gate workflows have been harvested into v0.8.50 (#2504)! The dry-run mode is a nice touch for testing without blocking real contributors. Thanks for building this — CI infrastructure is the kind of invisible work that keeps the project healthy. 🐋🔒

Hmbown avatar Jun 02 '26 04:06 Hmbown

This was harvested into the v0.8.50 release — thank you for the contribution!

Hmbown avatar Jun 03 '26 03:06 Hmbown