Skip to content

Support skipping draft pull requests - #16

Merged
cgalibern merged 1 commit into
opensvc:mainfrom
arnaudveron:pr-skip-draft
Oct 26, 2026
Merged

cgalibern merged 1 commit into
opensvc:mainfrom
arnaudveron:pr-skip-draft

Conversation

@arnaudveron

Copy link
Copy Markdown
Contributor

Goal

Do not start the Rundeck QA runs for draft pull requests: start them only when the pull request is not a draft (opened ready, or marked ready for review).

Changes

  • swagger/github.yaml: accept the converted_to_draft action. Today GitHub deliveries for this action are rejected with HTTP 400 by the request validation. Declare pull_request.draft.
  • context/github_pull_request.py: new context.draft property (False when absent), also added to the job description.
  • New example payload lib extra_lib_examples/job_payload/opensvc_agent_qa_run_pull_request_skip_draft.py: same logic as the production opensvc_agent_qa_run_v3_pull_request lib, plus ConditionNotMet on draft pull requests.
  • README: how to skip drafts, and the pull_request:ready_for_review mapping that is needed to start the job when the draft is marked ready.

No behaviour change for existing payload libs: the skip only happens in libs that test context.draft.

Tested

The context and example lib were tested locally on simulated payloads:

action draft merged result
opened / synchronize / reopened true skipped
opened / synchronize false or absent run pull/N, publish false
ready_for_review false run pull/N, publish false
closed false true run main, publish true
closed false false skipped (unchanged)

Not tested: a real signed GitHub delivery through connexion.

Production follow-up (osvcprd/svc/rundeck, after a new image)

  • cfg/rundeck webhook/extra_lib/job_payload/opensvc_agent_qa_run_v3_pull_request.py (and the v2 lib if wanted): add the context.draft check.
  • sec/rundeck webhook/jobs-*-v3.json (10 files, om3): add pull_request:ready_for_review (copy of the opened block); same for the v2 files if wanted.
  • Bump gh_webhook_image, then restart the webhook subset.

Add converted_to_draft to the accepted pull_request actions (GitHub
deliveries for this action were rejected with 400), declare the
pull_request.draft property, expose it as context.draft and in the
job description.

Add an example payload lib raising ConditionNotMet on draft pull
requests, and document the pull_request:ready_for_review mapping
needed to start the job when the draft is marked ready.
@cgalibern
cgalibern merged commit a376179 into opensvc:main Oct 26, 2026
1 check passed
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.

2 participants