Skip to content

fix(pr): pr create fits a repository without openspec #3767

Closed
1 of 1 issue completed
Closed

Description

@dan-petty

Problem

devops pr create refuses to open a pull request in a repository that does not use the devops-cli conventions. On 2026-11-06 an agent worked in dan-petty/homelab, which has no OpenSpec folder, no Closes #N rule and no CI. The command demanded a Closes #N trailer and an OpenSpec Change: line, and --repo did not skip this. The agent then opened both pull requests with devops gh api and marked them ready with devops pr ready --force.

So the rules of one repository block the use of the tool in another, and the way around them is a raw API call and a force flag. That removes the checks that the tool exists to run.

Expected

The body and Closes checks apply only where the repository uses the convention (for example, it has openspec/config.yaml). For another repository the command opens a plain draft pull request with a valid title, and devops pr ready needs no --force when the repository has no required checks.

Acceptance criteria

  • In a repository with no openspec/config.yaml, devops pr create opens a draft pull request without a Closes #N trailer or a Change: line.
  • In a repository with openspec/config.yaml, the checks stay as they are.
  • devops pr ready on a repository with no required checks needs no --force.
  • A test covers both repository kinds.

Existing tool considered

None applies: the rule is in this repository's command. The cost is about 150,000 tokens and 1 hour.

Related

#3215 (the jobs build pull request text with pull_form), #1359 (onboard a repository).

Proposed design

Problem statement

The devops pr create command applies the OpenSpec and Closes #N rules to every repository. A repository that does not use these conventions cannot open a pull request without a raw API call. The devops pr ready command also needs --force when the repository has no required checks. The change makes both commands follow the target repository's conventions.

Acceptance criteria

Requirement: Draft pull request in a repository without OpenSpec

devops pr create SHALL open a draft pull request without a Closes #N trailer or a Change: line when the target repository has no openspec/config.yaml.

Scenario: Repository without OpenSpec config

  • WHEN the target repository, named by --repo or by the current checkout, has no openspec/config.yaml at its default branch and the title passes the existing title check
  • THEN the command creates a draft pull request whose body has no Closes #N trailer and no Change: line

Requirement: Existing checks in a repository with OpenSpec

devops pr create SHALL keep the existing Closes #N and Change: checks when the target repository has openspec/config.yaml.

Scenario: Repository with OpenSpec config

  • WHEN the target repository has openspec/config.yaml at its default branch and the body lacks the required Closes #N trailer or Change: line
  • THEN the command refuses to create the pull request with the existing error message

Requirement: Ready without required checks

devops pr ready SHALL mark a draft pull request ready without --force when the target repository has no required checks.

Scenario: Repository without required checks

  • WHEN the target repository has no required checks configured in its rulesets and the draft pull request passes draft readiness
  • THEN the command marks the pull request ready and exits successfully without --force

Requirement: Force guard with required checks

devops pr ready SHALL keep the --force guard when the target repository has a required check that has not passed.

Scenario: Repository with a pending required check

  • WHEN the target repository has a required check that has not passed and the command runs without --force
  • THEN the command refuses to mark the pull request ready

Requirement: Tests for both repository kinds

The test suite SHALL cover pr create and pr ready for a repository with openspec/config.yaml and for one without it.

Scenario: Offline repository fixtures

  • WHEN the tests run with a fake GitHub client for each repository kind
  • THEN the tests assert the pr create body rules and the pr ready force behavior for both kinds

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need. The rule is in this repository's command. The written cost is about 150,000 tokens and 1 hour.

Key questions

  • Which file decides that the OpenSpec rules apply?: The presence of openspec/config.yaml at the target repository's default branch decides that the OpenSpec rules apply. (best practice) [sources: openspec/config.yaml, AGENTS.md:9]
    • Chosen: Presence of openspec/config.yaml. The issue names this file as the marker, and this repository has it.
    • Rejected: A new --openspec flag. It adds a manual step and does not fix the default behavior.
    • Rejected: The local checkout only. It fails when --repo names another repository.
  • Which checks stay for a repository without openspec/config.yaml?: The command keeps the existing title check and the draft pull request creation. It omits only the Closes #N trailer and the Change: line. (best practice) [sources: src/devops_cli/commands/pr.py, src/devops_cli/roadmap/pull_form.py, AGENTS.md:9]
    • Chosen: Keep the title check and omit the OpenSpec body checks. The issue requires a valid title and a plain draft pull request.
    • Rejected: Skip all checks. A malformed title would still create a pull request.
    • Rejected: Keep all checks. The repository cannot satisfy the OpenSpec body checks.
  • How does devops pr create read the marker for the target repository?: It reads openspec/config.yaml from the target repository's default branch through the GitHub client, so --repo works outside a local checkout. (best practice) [sources: src/devops_cli/commands/pr.py, src/devops_cli/roadmap/pull_form.py]
    • Chosen: Read the file through the GitHub client. It works for the current repository and for a repository named by --repo.
    • Rejected: Read the local filesystem. It misses a target repository that is not checked out.
    • Rejected: Require a local clone of the target repository. It adds a precondition and does not fix --repo.
  • How does devops pr ready find the required checks?: It reads the required checks that the repository rulesets configure for the base branch. An empty list means that the command needs no --force. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, src/devops_cli/commands/pr.py]
    • Chosen: Read required checks from the repository rulesets. ADR 0004 says the rulesets hold the required checks.
    • Rejected: Treat every pending check as required. A repository with no required checks would still need --force.
    • Rejected: Always require --force. The issue reports this as the defect.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-08: none.
Tool: none found.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    source/agent
    type/bug
    scope/pr
    status/new
    value/medium
    effort/medium
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/pr. The (pr) scope of the title gives the scope.
    • Priority: P2-Medium. The tool works for its primary use case, but agents must fall back to raw API calls in other repos, which removes the checks the tool exists to run.
    • Value: Medium. It extends the tool to any repository, removing the need for raw gh api workarounds.
    • Effort: Medium. The change needs a convention-detection gate, conditional skip of two checks, a pr ready fix, and tests for both repo kinds.
    • Related: fix(pr): pr create refuses the body of a plan pull request #3314, which asks for a different change. Both change how devops pr create validates the body, but #3314 handles plan PRs inside a convention repo while this candidate skips checks for repos without openspec/config.yaml.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 72c52c6 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches found no open, maintained tool or library that reads a target repository's conventions (openspec/config.yaml, required checks in its rulesets) and gates pr create body checks or pr ready's force flag accordingly; the closest option, driving gh directly, is exactly the raw-call workaround the issue says drops the checks the tool exists to run. The rule lives in this repository's own devops pr create and devops pr ready commands, so the fix is internal to them.

    Tool: none found

    Lacks:

    • No tool decides from the target repository whether the Closes #N and Change: checks apply
    • No tool makes devops pr ready skip --force when the repository configures no required checks
    • Opening the pull request with a raw gh/API call covers the create step only by bypassing the title and body checks entirely

    Searches run:

    • OpenSpec openspec/config.yaml validate pull request body checks, results: 5
    • tool that opens draft pull request with conditional body checks per repository convention, results: 5
    • OpenSpec spec-driven development CLI tool GitHub repository, results: 5
    • GitHub CLI gh pr ready mark ready for review required checks, results: 5
    • tool check pull request body has issue reference trailer before creating PR, results: 5
    • openspec validate CLI Fission-AI spec driven, results: 5
    • "gh pr ready" cli/cli documentation draft pull request, results: 5

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  7. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    It occurred again on 2026-11-12 in dan-petty/homelab (pull request 19). devops gh pr create --repo dan-petty/homelab refused with "The body has no line Closes #<issue>" and "The body has no line Change:". The repository has no OpenSpec folder and no CI. Also, devops gh pr create has no --head option, so a pull request of another repository cannot be opened from the devops-cli checkout. The agent opened the draft with devops gh api -X POST repos/dan-petty/homelab/pulls, and devops pr ready 19 --repo dan-petty/homelab refused with "A check runs: no checks reported" (0 check runs, 0 statuses), so it used --force.

  8. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    New evidence, 2026-11-12: dan-petty/homelab#19 and dan-petty/homelab#20 were opened with a raw devops gh api -X POST repos/dan-petty/homelab/pulls, because devops pr create --repo dan-petty/homelab requires the Closes # and Change: lines of devops-cli and has no --head option. devops pr ready refused the repo with no checks unless --force was given.

    Please add to the scope: a --head option for devops pr create, and the rules of the target repository (no OpenSpec, maybe no CI) in place of the devops-cli rules.

    The infra-repo tracker #5120 depends on this item: every homelab item (dan-petty/homelab#8, dan-petty/homelab#21, dan-petty/homelab#22, dan-petty/homelab#23) opens a pull request in a repository with no OpenSpec.

  9. added
    owner/agent
    on Nov 12, 2026
  10. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Seen again on 2026-11-12 with dan-petty/homelab#24. devops pr ready 24 --repo dan-petty/homelab refused with A check runs: no checks reported. The repository has no CI. --force then marked the pull request ready. The pull request was opened with devops gh api repos/dan-petty/homelab/pulls -X POST, as this issue describes.

  11. added
    status/in-progress
    and removed
    status/ready
    on Nov 12, 2026
  12. removed
    status/in-progress
    owner/agent
    on Nov 12, 2026
  13. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor
  14. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 17:00 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions