Skip to content

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

Merged
dan-petty merged 3 commits into
mainfrom
fix/3767-pr-create-fits-a-repository-without
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/3767-pr-create-fits-a-repository-without

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops pr create applied the body rules of devops-cli to every repository and had no --head, so pull requests in dan-petty/homelab were opened with a raw devops gh api call. devops pr ready refused a repository with no CI until --force was given.

Now pr create checks the body (Closes, Change:) only where the base branch holds openspec/config.yaml, the one switch of OpenSpec that openspec/project.py names. Another repository gets the title check only. --head goes to gh pr create and to the REST fallback. pr ready marks a pull request ready with no --force when its head commit reports no check and the repository has no GitHub Actions workflow. A repository with a workflow still waits, so devops-cli keeps every check.

Closes #3767

Change: openspec/changes/archive/2026-11-12-3767-pr-create-fits-a-repository-without/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/pr The devops pr commands labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main exits 0. 8 tests fail on the base and pass on the head, and 1 module does not load on the base:

  • tests.commands.test_pr_other_repository: test_a_repository_without_openspec_gets_a_draft_with_the_body_it_is_given, test_a_repository_with_openspec_still_needs_the_closes_and_change_lines, test_the_openspec_file_of_the_base_branch_decides, test_the_fallback_opens_the_draft_from_the_head_it_is_given, test_a_dry_run_names_the_head_and_checks_no_body_for_another_repository (base: "No such option: --head").
  • tests.commands.test_pr: test_pr_ready_exits_on_the_checks_of_the_verdict[no-ci-0-True], [workflows-unread-1-False], test_pr_ready_says_that_a_repository_with_no_ci_has_nothing_to_wait_for (base: "A check runs: no checks reported. Pass --force").
  • tests.openspec.test_openspec_project: collection failure on the base, because repository_uses_openspec does not exist there.

test_pr_ready_exits_on_the_checks_of_the_verdict[checks-not-started-8-False] passes on the base and on the head: a repository with workflows still waits for its checks, as devops-cli does.

Local checks

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all pass, after the rebase onto origin/main.
  • uv run devops ci test tests/github tests/commands/test_pr*.py tests/commands/test_gh_cmd.py tests/openspec tests/roadmap/test_roadmap_pull_form.py tests/roadmap/implement: 3413 passed.
  • uv run mypy on the changed files of src/: no issues.

Evidence for the switch

  • dan-petty/homelab: contents/openspec/config.yaml HTTP 404, actions/workflows total_count 0, the head commit of pull request 19 has 0 check runs and 0 statuses.
  • rules/branches/main of homelab answers HTTP 403 ("Upgrade to GitHub Pro or make this repository public"), so the required checks of the rulesets cannot decide for a private repository on the free plan. The change reads the workflow count instead.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 16:37
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 16:37
devops pr create checks the Closes and Change lines only where the base branch holds openspec/config.yaml, and takes --head for a pull request in another repository. devops pr ready marks a pull request ready with no --force when the head commit reports no check and the repository has no GitHub Actions workflow.

Refs #3767
The description of the tool pr_ready is the docstring of devops pr ready, which now states the rule for a repository with no CI.
@dan-petty
dan-petty force-pushed the fix/3767-pr-create-fits-a-repository-without branch from c207841 to 2b65121 Compare November 12, 2026 16:41
@dan-petty
dan-petty merged commit aed68b3 into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/3767-pr-create-fits-a-repository-without branch November 12, 2026 16:47
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.120.1](v0.120.0...v0.120.1)
(2026-11-12)


### Bug Fixes

* **github:** a paginated devops gh api read sends per_page=100
([#5141](#5141))
([621f24c](621f24c))
* **pr:** pr create fits a repository without openspec
([#5142](#5142))
([aed68b3](aed68b3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/pr The devops pr commands type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant