Skip to content

fix: release_pr.draft Config Ignored — Release PR Always Created as Non-Draft #142

@pvandervelde

Description

@pvandervelde

Repository: pvandervelde/release_regent
Affects: Release PR creation on non-release PR merge
Date: 2026-05-18


Summary

When a non-release PR is merged into the default branch, release-regent creates or
updates a release PR. The PR is always created as a non-draft regardless of the
release_pr.draft setting in release-regent.toml. Setting draft = true under
[release_pr] has no effect.


Configuration (correct — not the cause)

[release_pr]
draft = true

The key release_pr.draft maps to ReleasePrConfig.draft in
crates/core/src/config.rs. The configuration is not the problem.


Root Cause

ReleaseOrchestrator hardcodes draft: false in create_pull_request

In crates/core/src/release_orchestrator.rs, the CreatePullRequestParams literal
always sets draft: false:

// (inside the create-new-PR path)
CreatePullRequestParams {
    title: title.clone(),
    body: body.clone(),
    head: branch_name.clone(),
    base: default_branch.to_string(),
    draft: false,                    // ← always false
}

OrchestratorConfig has no draft field

OrchestratorConfig contains no field for this setting, so there is no path from the
config to the call site even if lib.rs were to read it.

lib.rs never reads repo_config.release_pr.draft

OrchestratorConfig is constructed in handle_pr_comment and
handle_pull_request_merged without any reference to repo_config.release_pr.draft.
The other fields in ReleasePrConfig (title_template, body_template,
manifest_files, auto_detect_manifests) are wired up correctly; draft is the only
missing one.


Impact

Teams that use draft PRs as a review gate before a release PR becomes mergeable cannot
rely on release-regent to honour that workflow. The release_pr.draft setting is
silently ignored.


Fix

  1. Add a draft: bool field to OrchestratorConfig (default false).
  2. In lib.rs's handle_pr_comment and handle_pull_request_merged, set
    draft: repo_config.release_pr.draft when constructing OrchestratorConfig.
  3. In ReleaseOrchestrator, pass self.config.draft to every
    CreatePullRequestParams construction site (both the create-new and
    update-existing paths need checking).

Files to Change

  • crates/core/src/release_orchestrator.rs — add field, use it in create_pull_request calls
  • crates/core/src/lib.rs — thread repo_config.release_pr.draft into OrchestratorConfig
  • crates/core/src/release_orchestrator_tests.rs — add tests for draft: true path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions