From 01d20a7bb52ea0101941a3ae59b273d4e055c104 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Sat, 31 Oct 2026 02:27:51 +0000 Subject: [PATCH] fix(ci): the scope git of a pull request title has no label Declare the scope/git label in .github/labels.yml so pull requests with git scope receive the taxonomy label without warning. - Add `scope/git` label to `.github/labels.yml` directly after `scope/github`. - Add test coverage in `tests/test_pr_title_labels.py` verifying label declaration and PR assignment. - Verified with fail-to-pass check (`devops ci fail-to-pass --base origin/main`). Change: `openspec/changes/archive/2026-10-31-2800-scope-git-label/` Closes #2800 --- .github/labels.yml | 4 +++ .../.openspec.yaml | 3 ++ .../2026-10-31-2800-scope-git-label/design.md | 12 +++++++ .../proposal.md | 28 +++++++++++++++ .../2026-10-31-2800-scope-git-label/tasks.md | 14 ++++++++ tests/test_pr_title_labels.py | 34 +++++++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 openspec/changes/archive/2026-10-31-2800-scope-git-label/.openspec.yaml create mode 100644 openspec/changes/archive/2026-10-31-2800-scope-git-label/design.md create mode 100644 openspec/changes/archive/2026-10-31-2800-scope-git-label/proposal.md create mode 100644 openspec/changes/archive/2026-10-31-2800-scope-git-label/tasks.md diff --git a/.github/labels.yml b/.github/labels.yml index 613ff2172e..89b3b87efe 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -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" diff --git a/openspec/changes/archive/2026-10-31-2800-scope-git-label/.openspec.yaml b/openspec/changes/archive/2026-10-31-2800-scope-git-label/.openspec.yaml new file mode 100644 index 0000000000..6257ed6ab2 --- /dev/null +++ b/openspec/changes/archive/2026-10-31-2800-scope-git-label/.openspec.yaml @@ -0,0 +1,3 @@ +schema: spec-driven +created: 2026-10-31 +skip_specs: true diff --git a/openspec/changes/archive/2026-10-31-2800-scope-git-label/design.md b/openspec/changes/archive/2026-10-31-2800-scope-git-label/design.md new file mode 100644 index 0000000000..08b08e2f48 --- /dev/null +++ b/openspec/changes/archive/2026-10-31-2800-scope-git-label/design.md @@ -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. diff --git a/openspec/changes/archive/2026-10-31-2800-scope-git-label/proposal.md b/openspec/changes/archive/2026-10-31-2800-scope-git-label/proposal.md new file mode 100644 index 0000000000..8dc0fa28ce --- /dev/null +++ b/openspec/changes/archive/2026-10-31-2800-scope-git-label/proposal.md @@ -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`. diff --git a/openspec/changes/archive/2026-10-31-2800-scope-git-label/tasks.md b/openspec/changes/archive/2026-10-31-2800-scope-git-label/tasks.md new file mode 100644 index 0000000000..064260658d --- /dev/null +++ b/openspec/changes/archive/2026-10-31-2800-scope-git-label/tasks.md @@ -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` +- [x] Verify test fails against current `origin/main` + +## 2. Declare Label +- [x] Add `scope/git` entry to `.github/labels.yml` after `scope/github` +- [x] Verify test passes + +## 3. Verification & PR +- [x] Run `devops ci fail-to-pass --base origin/main` +- [x] Run fast checks, archive change, and open draft PR +- [x] Monitor checks and mark PR ready diff --git a/tests/test_pr_title_labels.py b/tests/test_pr_title_labels.py index 1fb7f1b184..d29389ef26 100644 --- a/tests/test_pr_title_labels.py +++ b/tests/test_pr_title_labels.py @@ -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")})