Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The squash merge makes one commit on main: the title is its subject, and this body is its message. Write the body as it will read in `git log` after the merge: what the change does, and why. The title is a Conventional Commit (`feat:`, `fix:`, `perf:`, `refactor:`, `docs:`, `test:`, `build:`, `ci:`, `style:`, `chore:`, `revert:`), and release-please writes the changelog from it. Put test results, check status, steps for a person and the history of the issue in a comment on the pull request, not in the body. CONTRIBUTING.md section 4 sets the length of the title summary and of the body. End the body with the one issue this pull request delivers and its archived OpenSpec change. Archive the change in the last commit with `uv run devops openspec archive <issue>-<slug>`. `devops pr check-readiness` blocks a pull request whose body closes no issue or several, or that does not add `openspec/changes/archive/<date>-<issue>-<slug>/` for that issue. Delete this comment. -->
<!-- The squash merge makes one commit on main: the title is its subject, and this body is its message. Write the body as it will read in `git log` after the merge: what the change does, and why. The title is a Conventional Commit (`feat:`, `fix:`, `perf:`, `refactor:`, `docs:`, `test:`, `build:`, `ci:`, `style:`, `chore:`, `revert:`), and release-please writes the changelog from it. Put test results, check status, steps for a person and the history of the issue in a comment on the pull request, not in the body. CONTRIBUTING.md section 4 sets the length of the title summary and of the body. End the body with the one issue this pull request delivers and its archived OpenSpec change. Archive the change in the last commit with `uv run devops openspec archive <issue>-<slug>`. `devops pr check-readiness` blocks a pull request whose body closes no issue or several, or that does not add `openspec/changes/archive/<date>-<issue>-<slug>/` for that issue. Delete this comment. `devops pr describe <issue> --summary "<summary>"` builds the title and the body, and `devops pr create` refuses a title or a body that breaks the form. -->

Closes #<issue>

Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ uv run pre-commit install
- **Branch Targeting**: Every topic branch targets `main`. A maintainer squash-merges the pull request.
- **Drafts First**:
- Open every pull request with `devops pr create`. It always opens a draft.
- `devops pr create` adds the labels that the title gives, with the rule of intake: `fix(ai): ...` gets `type/bug` and `scope/ai`. A scope that `.github/labels.yml` does not declare gets no label and a warning. Do not add these labels by hand. When a label cannot be added, the command names the pull request and the labels, and exits 1. The pull request stays open.
- `devops pr create` adds the labels that the title gives, with the rule of intake: `fix(ai): ...` gets `type/bug` and `scope/ai`. Do not add these labels by hand. When a label cannot be added, the command names the pull request and the labels, and exits 1. The pull request stays open.
- When all checks pass, mark the pull request ready with `devops pr ready <pr-number>`. This is the only way out of the draft.
- `devops pr create` checks the title and the body before it opens anything, with the rules below, and exits 1 with every problem when one fails. `devops pr describe <issue> --summary "<summary>"` builds a title and a body that pass the check: the type and the scope come from the issue, the "why" from the proposal of the change folder, and it cuts no text. The module `src/devops_cli/roadmap/pull_form.py` holds the rules.
- **The Title Is the Changelog Line**:
The pull request title is a Conventional Commit, and the `Semantic PR title` check enforces it. The squash commit takes the title as its subject, and GitHub adds ` (#<number>)` to it. release-please writes the changelog from these titles, so write the title for a reader of the changelog. The scope is one of the `scope/*` labels of `.github/labels.yml`, or `main` for the release pull request, and the check refuses another scope. To use a new scope, declare its label in `.github/labels.yml` and add the scope to the `scopes` list of `.github/workflows/pr-title.yml` in the same pull request. The summary, the text after `<type>(<scope>): `, has at most 60 characters, and the `Semantic PR title` check refuses a longer one. The summary states the effect of the change. Put the evidence and the steps in the body or in the change folder:
The pull request title is a Conventional Commit, and the `Semantic PR title` check enforces it. The squash commit takes the title as its subject, and GitHub adds ` (#<number>)` to it. release-please writes the changelog from these titles, so write the title for a reader of the changelog. The scope is one of the `scope/*` labels of `.github/labels.yml`, or `main` for the release pull request, and the `Semantic PR title` check and `devops pr create` refuse another scope. To use a new scope, declare its label in `.github/labels.yml` and add the scope to the `scopes` list of `.github/workflows/pr-title.yml` in the same pull request. The summary, the text after `<type>(<scope>): `, has at most 60 characters, and both checks refuse a longer one, and a summary that ends with `...` or is a placeholder such as `x`. The summary states the effect of the change. Put the evidence and the steps in the body or in the change folder:
```
feat(k8s): add automated minikube helm adoption check
fix(ai): prevent thread pool executor blocking on tool timeout
Expand All @@ -101,7 +102,7 @@ uv run pre-commit install
| `revert` | Reverts |

The other types (`docs`, `test`, `build`, `ci`, `style`, `chore`) add no line. Do not edit `CHANGELOG.md`: release-please writes it in its release pull request. [`RELEASE_CYCLE.md`](RELEASE_CYCLE.md) tells what happens after the merge.
- **The Body Is the Commit Message**: The squash commit takes the pull request body as its message, so `git log` keeps the body after the merge. Write the body as it will read there: what the change does, and why, in at most 1,000 characters before the trailers. Do not repeat what the archived change folder holds, such as measurements, rejected alternatives and lists of files: the `Change:` line links to it. A reviewer checks the length of the body. End it with `Closes #<issue>` and the `Change:` line of the [template](.github/pull_request_template.md). Put test results, check status, steps for a person and the history of the issue in a comment on the pull request or on the issue, not in the body. When a push changes what the pull request does, change the body too.
- **The Body Is the Commit Message**: The squash commit takes the pull request body as its message, so `git log` keeps the body after the merge. Write the body as it will read there: what the change does, and why, in at most 1,000 characters before the trailers. Do not repeat what the archived change folder holds, such as measurements, rejected alternatives and lists of files: the `Change:` line links to it. `devops pr create` refuses a longer body, a body with a placeholder for the text, and a body that holds text of the template. End it with `Closes #<issue>` and the `Change:` line of the [template](.github/pull_request_template.md). The attribution lines of an agent come after the `Change:` line, never before `Closes`. Put test results, check status, steps for a person and the history of the issue in a comment on the pull request or on the issue, not in the body. When a push changes what the pull request does, change the body too.
- **Commits on the Branch**: Commits on a topic branch also follow the Conventional Commits format. The squash merge replaces them with one commit, with the title as its subject and the body as its message. So no hook checks the message of a commit on a branch.
- **Fail-to-Pass Evidence**: A fix pull request cites its `fail-to-pass` check run in a comment (`devops ci fail-to-pass --base <ref>`, `.github/workflows/fail-to-pass.yml`). Do not type failure counts by hand. The check runs only for a pull request whose title is a fix (`fix(<scope>):` or `fix:`) and that changes `src/` outside `src/devops_cli/ai/knowledge_base/`. A fix that changes only tests, documents or dependencies gets no check. The check passes when at least one changed test fails on the base. It fails a pull request whose replay could not run on the base: pytest stopped, did not start or wrote no complete JUnit report. Then merge the change to the test harness or the dependencies first, in a pull request that is not a fix, and replay the fix against the new base. No line in the body changes the result. A changed test that only fails to collect on the base counts as errored.
- **Helper Scripts**: A committed helper script goes in `scripts/` as a PEP 723 file, and Ruff checks it. The pull request that adds the first script adds `scripts` to the mypy and Bandit targets. Scratch scripts stay untracked under `.data/agent/scratch/`.
Expand All @@ -121,7 +122,7 @@ This table holds the naming rules of the project. Each rule names the check that
| Artifact | Form | Check |
| :--- | :--- | :--- |
| Branch | `<type>/<issue>-<slug>` | The `no-commit-to-branch` pre-commit hook refuses a commit on a branch that breaks the form. `devops repos worktrees add` makes a branch in this form. |
| Pull request title and commit subject | `<type>(<scope>): <summary>`, with a summary of at most 60 characters | The `Semantic PR title` check for the title: its form, its scope and the length of its summary. None for a commit on a branch. |
| Pull request title and commit subject | `<type>(<scope>): <summary>`, with a summary of at most 60 characters | The `Semantic PR title` check for the title: its form, its scope and the length of its summary. `devops pr create` checks the same rules before it opens the pull request. None for a commit on a branch. |
| Change folder | `<issue>-<slug>`, archived as `<YYYY-MM-DD>-<issue>-<slug>` | `devops openspec check` and `tests/test_change_folders.py`. |
| Python module, class, function and variable | PEP 8 | Ruff `N`. |
| Constant | `_<NAME>` in the one module that reads it. `<NAME>` in the `constants.py` of a package when several of its modules read it. `CONST_<NAME>` in `config/constants.py`, or `DEFAULT_<NAME>` for a tunable value in `config/defaults.py`, when modules of two or more packages import it ("Closed Lists and Standard Parsers" above). A `DEFAULT_<NAME>` that a settings field takes as its default is read only in `config/`: a module elsewhere reads the loaded setting, or `setting_default("<key>")` where it has no settings | `tests/invariants/test_source_tree.py` finds each read of a setting's default outside `config/`. |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ and excessive permissions fail it, and every other finding is shown. |
| | `devops pr wait [OPTIONS] <number>` | Wait until the checks of a PR settle, then name every blocker of its merge. |
| | `devops pr monitor [OPTIONS] <number>` | Wait until the checks of a PR settle, then name every blocker of its merge. |
| | `devops pr edit [OPTIONS] <number>` | Edit pull request base branch, title, body, or milestone. |
| | `devops pr describe [OPTIONS] <issue>` | Print the title and the body of the pull request that delivers an issue. The first line is the title, then a blank line, then the body. |
| | `devops pr create [OPTIONS]` | Open a draft pull request, into the default branch unless --base names another. |
| | `devops pr ready [OPTIONS] <number>` | Mark a draft pull request as ready for review once its checks pass. |
| | `devops pr diff [OPTIONS] <number>` | View diff of a pull request. |
Expand Down
62 changes: 60 additions & 2 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6973,6 +6973,30 @@ devops pr edit [OPTIONS] <number>
| `--milestone`, `-m` | `string` | - | Set the milestone for this pull request. |
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |

### `devops pr describe`

**Print the title and the body of the pull request that delivers an issue. The first line is the title, then a blank line, then the body.**

```bash
devops pr describe [OPTIONS] <issue>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<issue>` | `integer` | Yes | Number of the issue that the pull request closes. |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--summary`, `-s` | `string` | - | Summary of the title, at most 60 characters: what the change does. The command never cuts it. |
| `--why` | `string` | - | Text of the body: what the change does, and why. The section Why of the proposal when omitted. |
| `--attribution` | `string` | - | A paragraph for the end of the body, after the Change line. Repeat the option for more. |
| `--repo`, `-R` | `string` | - | Target repository in OWNER/REPO format. |
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |

### `devops pr create`

**Open a draft pull request, into the default branch unless --base names another.**
Expand All @@ -6982,7 +7006,12 @@ Open a draft pull request, into the default branch unless --base names another.
Every pull request opens as a draft. devops pr ready is the only way to mark it ready for
review. It sets the Status of the roadmap item the pull request closes to In Progress. It also
adds the labels that the Conventional Commit title gives, as intake does: fix(ai) gives type/bug
and scope/ai. A scope that .github/labels.yml does not declare gets no label and a warning.
and scope/ai.

It opens nothing when the title or the body breaks the form of CONTRIBUTING.md section 4: a
Conventional Commit title with a summary of at most 60 characters and a scope that
.github/labels.yml declares, and a body of at most 1,000 characters that ends with Closes
#\<issue\> and the Change line. devops pr describe builds a title and a body in that form.

```bash
devops pr create [OPTIONS]
Expand Down Expand Up @@ -8199,6 +8228,30 @@ devops gh pr edit [OPTIONS] <number>
| `--milestone`, `-m` | `string` | - | Set the milestone for this pull request. |
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |

#### `devops gh pr describe`

**Print the title and the body of the pull request that delivers an issue. The first line is the title, then a blank line, then the body.**

```bash
devops gh pr describe [OPTIONS] <issue>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<issue>` | `integer` | Yes | Number of the issue that the pull request closes. |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--summary`, `-s` | `string` | - | Summary of the title, at most 60 characters: what the change does. The command never cuts it. |
| `--why` | `string` | - | Text of the body: what the change does, and why. The section Why of the proposal when omitted. |
| `--attribution` | `string` | - | A paragraph for the end of the body, after the Change line. Repeat the option for more. |
| `--repo`, `-R` | `string` | - | Target repository in OWNER/REPO format. |
| `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. |

#### `devops gh pr create`

**Open a draft pull request, into the default branch unless --base names another.**
Expand All @@ -8208,7 +8261,12 @@ Open a draft pull request, into the default branch unless --base names another.
Every pull request opens as a draft. devops pr ready is the only way to mark it ready for
review. It sets the Status of the roadmap item the pull request closes to In Progress. It also
adds the labels that the Conventional Commit title gives, as intake does: fix(ai) gives type/bug
and scope/ai. A scope that .github/labels.yml does not declare gets no label and a warning.
and scope/ai.

It opens nothing when the title or the body breaks the form of CONTRIBUTING.md section 4: a
Conventional Commit title with a summary of at most 60 characters and a scope that
.github/labels.yml declares, and a body of at most 1,000 characters that ends with Closes
#\<issue\> and the Change line. devops pr describe builds a title and a body in that form.

```bash
devops gh pr create [OPTIONS]
Expand Down
18 changes: 18 additions & 0 deletions docs/MCP_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The `devops-cli` FastMCP server exposes DevOps automation and AI review capabili
| [`pr_check_readiness`](#pr-check-readiness) | `true` | Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding. Grounding applies where the base holds openspec/changes/. The PR targets the default branch. It closes exactly one issue, an open issue of its own repository that holds a priority/* label: a roadmap item. GitHub closes that issue when the PR merges. The PR adds openspec/changes/archive/\<date\>-\<issue\>-\<slug\>/, which uv run devops openspec archive writes for that issue's change. Only that archive writes openspec/specs/ and openspec/changes/archive/. |
| [`pr_checks`](#pr-checks) | `true` | Check remote CI quality gate status on a pull request. |
| [`pr_close`](#pr-close) | `false` | Close a pull request. |
| [`pr_describe`](#pr-describe) | `true` | Print the title and the body of the pull request that delivers an issue. The first line is the title, then a blank line, then the body. |
| [`pr_diff`](#pr-diff) | `true` | View diff of a pull request. |
| [`pr_edit`](#pr-edit) | `false` | Edit pull request base branch, title, body, or milestone. |
| [`pr_list`](#pr-list) | `true` | List pull requests with base targeting and review status. |
Expand Down Expand Up @@ -1491,6 +1492,23 @@ Close a pull request.
| `repo` | `string` | No | - | Target repository in OWNER/REPO format. |
| `dry_run` | `boolean` | No | `False` | Preview execution plan without mutating external state. |

### `pr_describe`

Print the title and the body of the pull request that delivers an issue. The first line is the title, then a blank line, then the body.

**Annotations:** `readOnlyHint: true`

**Parameters:**

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `issue` | `integer` | Yes | - | Number of the issue that the pull request closes. |
| `summary` | `string` | Yes | - | Summary of the title, at most 60 characters: what the change does. The command never cuts it. |
| `why` | `string` | No | - | Text of the body: what the change does, and why. The section Why of the proposal when omitted. |
| `attribution` | `array[string]` | No | - | A paragraph for the end of the body, after the Change line. Repeat the option for more. |
| `repo` | `string` | No | - | Target repository in OWNER/REPO format. |
| `dry_run` | `boolean` | No | `False` | Preview execution plan without mutating external state. |

### `pr_diff`

View diff of a pull request.
Expand Down
Loading
Loading