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
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
color: "24292E"
description: "GitHub Projects v2, Views, Milestones, Labels, and PR automation"

- name: "scope/git"
color: "24292E"
description: "Git commands, git configuration, and git credential handling"

- name: "scope/release"
color: "1D76DB"
description: "The release-please workflow, the changelog and the published artifacts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-10-31
skip_specs: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Design: Declare scope/git in labels.yml

## Context
Conventional commit titles can use the scope `git` (such as `test(git): ...` or `feat(git): ...`).
The `devops pr create` command matches the scope from the title against declared labels in `.github/labels.yml`.
When a scope has no entry in `.github/labels.yml`, `devops pr create` skips adding the scope label and warns the user.

## Design Decisions
- Add `scope/git` directly after `scope/github` in `.github/labels.yml`.
- Re-use the color `24292E` to match `scope/github`.
- Description: `Git commands, git configuration, and git credential handling`.
- Test that `.github/labels.yml` declares `scope/git` and that `devops pr create` attaches `scope/git` without warning.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Proposal

## Why
The command `devops pr create` warns when a pull request title uses scope `git`:
`The scope git of the title has no label: .github/labels.yml does not declare scope/git. The pull request gets no scope label.`
The file `.github/labels.yml` declares `scope/github` and other scopes, but does not declare `scope/git`. A pull request with a `git` scope receives no scope label.

## What Changes
- Add `scope/git` to `.github/labels.yml` in the Scope Labels section directly after `scope/github`.
- Set label color to `24292E` and description to `Git commands, git configuration, and git credential handling`.
- Add test coverage in `tests/test_pr_title_labels.py` verifying `scope/git` declaration and PR label assignment without warnings.

## Capabilities

### New Capabilities
- None.

### Modified Capabilities
- None.

## Impact
Pull requests with titles using `scope/git` receive the `scope/git` label automatically and emit no warning.

## Feasibility
Confirmed against `.github/labels.yml`:
- `.github/labels.yml` contains `scope/github` at lines 74-76 with color `24292E`.
- `grep -n "scope/git" .github/labels.yml` confirms that `scope/git` is not present.
- Adding the label entry satisfies the taxonomy requirement of `devops pr create`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Tasks

## 1. Write Failing Test
- [x] Add failing tests for `scope/git` declaration and application in `tests/test_pr_title_labels.py` <!-- id: 1-failing-test -->
- [x] Verify test fails against current `origin/main` <!-- id: 1-verify-fail -->

## 2. Declare Label
- [x] Add `scope/git` entry to `.github/labels.yml` after `scope/github` <!-- id: 2-add-label -->
- [x] Verify test passes <!-- id: 2-verify-pass -->

## 3. Verification & PR
- [x] Run `devops ci fail-to-pass --base origin/main` <!-- id: 3-fail-to-pass -->
- [x] Run fast checks, archive change, and open draft PR <!-- id: 3-pr -->
- [x] Monitor checks and mark PR ready <!-- id: 3-ready -->
34 changes: 34 additions & 0 deletions tests/test_pr_title_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,37 @@ def test_a_dry_run_lists_the_label_requests_of_the_title(
),
any("placeholder" in line for line in lines),
] == [True, True, True, True]


def test_labels_file_declares_scope_git() -> None:
"""The repository's .github/labels.yml declares scope/git (#2800)."""
import yaml

from tests.support.paths import REPO_ROOT

text = (REPO_ROOT / ".github" / "labels.yml").read_text(encoding="utf-8")
labels = yaml.safe_load(text)
git_labels = [
label for label in labels if isinstance(label, dict) and label.get("name") == "scope/git"
]
assert len(git_labels) == 1
assert git_labels[0]["color"] == "24292E"
assert git_labels[0]["description"] != ""


@pytest.mark.usefixtures("status")
def test_a_title_with_git_scope_gets_the_scope_git_label(
runner: CliRunner, roadmap_store: InMemoryRoadmapStore, status: MagicMock
) -> None:
"""A PR whose title scope is git receives scope/git when declared (#2800)."""
from tests.support.paths import REPO_ROOT

text = (REPO_ROOT / ".github" / "labels.yml").read_text(encoding="utf-8")
roadmap_store.seed_file(LABELS_PATH, text)
pull = roadmap_store.seed_issue("test(git): example", pull_request=True)
result, _ = _create(runner, "test(git): example")
assert (
result.exit_code,
"does not declare scope/git" in result.output,
_labeled(roadmap_store),
) == (0, False, {(pull, "type/test"), (pull, "scope/git")})
Loading