Skip to content

Add prtk PR automation#13

Open
msleigh wants to merge 2 commits into
ecmwf-ifs:mainfrom
msleigh:dims_main_add-prtk-automation
Open

Add prtk PR automation#13
msleigh wants to merge 2 commits into
ecmwf-ifs:mainfrom
msleigh:dims_main_add-prtk-automation

Conversation

@msleigh

@msleigh msleigh commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds prtk PR automation to openifs. This repository previously had no MAINTAINERS.yml and no PR check workflow, so this PR introduces both. openifs does not have a Jira project tied to it, so no require-jira-ticket / sync-jira checks are enabled.

MAINTAINERS.yml (new)

  • owner: ecmwf
  • maintainers: [Adehill] — assignee fallback for ensure-assignee, contributes to the reviewer pool
  • No lead_developers, no cycle_leads
  • Checks:
    • ensure-assignee — every non-draft PR gets one assignee (falls back to Adehill)
    • validate-target-branch — allowed bases are main, main_staging, and the patterns openifs-*, lts/*, mts/*, release/*. Mirrors the existing trigger filter used by docker-test.yml
    • assign-reviewers — with exclude-author and exclude-existing
    • copyright-audit — advisory; Adehill is the reviewer-of-record; allowed-holders is ECMWF only (no Météo-France, per the openifs distribution's scope); skippable via the prtk:skip-copyright label

.github/workflows/check-pr.yml (new)

  • pull_request_target triggered on opened, synchronize, reopened, edited, ready_for_review, converted_to_draft against the same branch set as validate-target-branch allows
  • Job gated by if: github.repository_owner == 'ecmwf-ifs' so the workflow does not fire on personal forks
  • Concurrency group cancels stale runs; 5-minute timeout
  • contents: read, pull-requests: write, issues: write
  • Installs prtk via uv tool install using the org-level PRTK_READ_ACCESS secret
  • No JIRA_TOKEN since this repo has no Jira integration
  • Calls prtk check ... with --default-branch and event metadata so prtk fetches canonical MAINTAINERS.yml from the default branch (main)

Required secrets

PRTK_READ_ACCESS is an org-level secret on ecmwf-ifs and is already inherited by this repo — no per-repo configuration needed.

When the new behaviour takes effect

This PR targets main, the repository's default branch. prtk check reads canonical MAINTAINERS.yml from the default branch, so once this PR merges the new policy is immediately what prtk consults — no main_staging → main propagation lag.

Test plan

Run these immediately after merge:

  • Open a draft PR to main and confirm the prtk job skips automation
  • Mark the PR ready for review and confirm: one assignee is set (Adehill), reviewers are requested per the rules
  • Open a PR to a non-allowed base (something outside main, main_staging, openifs-*, lts/*, mts/*, release/*) and confirm validate-target-branch fails

Workflow trigger / policy split

The workflow has no branches: filter on pull_request_target — it fires on every PR regardless of target. prtk's validate-target-branch (allowed: main, main_staging, openifs-*, lts/*, mts/*, release/*) is the sole policy gate. A narrower trigger would silently skip the check on disallowed bases (the workflow would simply never run on them), so users opening PRs to wrong targets would get no feedback at all.

Add MAINTAINERS.yml and a check-pr.yml workflow that runs prtk check
on PR events. This repository previously had no PR automation.

The checks: section enables:

  - ensure-assignee
  - validate-target-branch (main, main_staging, openifs-*, lts/*,
    mts/*, release/*)
  - assign-reviewers (exclude-author, exclude-existing)
  - copyright-audit (advisory; ECMWF holders allowed; Adehill as
    reviewer-of-record)

openifs does not use Jira, so no require-jira-ticket / sync-jira
checks are enabled and the workflow does not pass JIRA_TOKEN.

The workflow's pull_request_target trigger filter mirrors the
validate-target-branch allowed list, so the check fires on every PR
that should be policy-checked. The job is gated with
`if: github.repository_owner == 'ecmwf-ifs'` so PR automation does not
run on personal forks.
@msleigh msleigh force-pushed the main branch 2 times, most recently from 7e2559f to 7b8c12e Compare May 27, 2026 08:49
The workflow no longer filters PRs by base branch. It now fires on
every PR, leaving prtk's validate-target-branch check inside
MAINTAINERS.yml as the sole policy gate.

A narrower trigger would skip the workflow entirely on disallowed
bases, so validate-target-branch could never flag mis-targeted PRs
(the workflow would simply never run on them). Keeping the trigger
broad and letting prtk decide gives consistent feedback regardless of
target.
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