Consolidate git identity, git init, and rubocop AllCops literals in tests #1466

Closed
opened 2026-10-28 16:56:48 +00:00 by jared · 2 comments
Owner

Problem

Three literals repeat across os-sdlc tests.

  1. The git identity "-c", "user.name=t", "-c", "user.email=t@t" (and two email variants) appears in 13 test files.
  2. git init -q appears in about 24 files under five spellings (run_git, git, system, Open3).
  3. "AllCops:\n NewCops: disable\n" and variants appear in 7 files (plugins/os-sdlc/tests/lint_test.rb:24,34; plugins/os-sdlc/tests/support/lint_lesson_scenario.rb:56; plugins/os-sdlc/tests/support/fast_gate_scenario.rb:21).
  4. DISABLED_BY_DEFAULT is identical in plugins/os-sdlc/tests/lint/autocorrection_rubocop_run_test.rb:7 and plugins/os-sdlc/tests/gate/commands_sdlc_lint_base_commit_test.rb:7.
    GitRepoFixture already inits repos. It becomes GitRepoScenario in the rename ticket.

Approach

Route all git init and identity through GitRepoScenario: one init(dir) that carries the identity flags.
Add RubocopConfigFixture (a value) with minimal and disabled_by_default.
Migrate the sites.
This ticket depends on the rename ticket (GitRepoScenario).

Required work:

  1. GitRepoScenario gets the single init — check: absent user.email=t@t in plugins/os-sdlc/tests/*_test.rb
  2. Add RubocopConfigFixture — check: present module RubocopConfigFixture in plugins/os-sdlc/tests/support/rubocop_config_fixture.rb

Acceptance criteria

  1. Given the migrated tests, when the os-sdlc suite runs, then it is green.
  2. Given the three literals above, when they are searched in tests, then they appear only in the scenario or fixture file.

Owner sketch

GitRepoScenario.init(dir)
module RubocopConfigFixture
  def self.minimal
  def self.disabled_by_default
end

Route: fast-batch.

Origin

  • Trigger: tests/support inventory survey 2026-10-28 after fast-batch-21 (#1019)
  • Improvised this session: none
  • Chain: misnamed or hand-built test records ← convention adopted 2026-10-28 but only TicketFixture converted ← DESIGN (#1019 memo comment)
  • Root candidate: none found; searched git identity, user.email, git init, run_git, AllCops, DISABLED_BY_DEFAULT, GitRepoFixture, RubocopConfigFixture
  • Where: plugins/os-sdlc/tests/support/git_repo_fixture.rb
  • Session: 2dd497e0-555e-4518-9cdd-c68461c32463
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2dd497e0-555e-4518-9cdd-c68461c32463.jsonl

VERDICT: CREATE

Parent: #1019

## Problem Three literals repeat across os-sdlc tests. 1. The git identity `"-c", "user.name=t", "-c", "user.email=t@t"` (and two email variants) appears in 13 test files. 2. `git init -q` appears in about 24 files under five spellings (run_git, git, system, Open3). 3. `"AllCops:\n NewCops: disable\n"` and variants appear in 7 files (`plugins/os-sdlc/tests/lint_test.rb:24,34`; `plugins/os-sdlc/tests/support/lint_lesson_scenario.rb:56`; `plugins/os-sdlc/tests/support/fast_gate_scenario.rb:21`). 4. `DISABLED_BY_DEFAULT` is identical in `plugins/os-sdlc/tests/lint/autocorrection_rubocop_run_test.rb:7` and `plugins/os-sdlc/tests/gate/commands_sdlc_lint_base_commit_test.rb:7`. GitRepoFixture already inits repos. It becomes GitRepoScenario in the rename ticket. ## Approach Route all git init and identity through GitRepoScenario: one `init(dir)` that carries the identity flags. Add `RubocopConfigFixture` (a value) with `minimal` and `disabled_by_default`. Migrate the sites. This ticket depends on the rename ticket (GitRepoScenario). Required work: 1. GitRepoScenario gets the single init — check: absent `user.email=t@t` in `plugins/os-sdlc/tests/*_test.rb` 2. Add RubocopConfigFixture — check: present `module RubocopConfigFixture` in `plugins/os-sdlc/tests/support/rubocop_config_fixture.rb` ## Acceptance criteria 1. Given the migrated tests, when the os-sdlc suite runs, then it is green. 2. Given the three literals above, when they are searched in tests, then they appear only in the scenario or fixture file. ## Owner sketch ```ruby GitRepoScenario.init(dir) module RubocopConfigFixture def self.minimal def self.disabled_by_default end ``` Route: fast-batch. ## Origin - Trigger: tests/support inventory survey 2026-10-28 after fast-batch-21 (#1019) - Improvised this session: none - Chain: misnamed or hand-built test records ← convention adopted 2026-10-28 but only TicketFixture converted ← DESIGN (#1019 memo comment) - Root candidate: none found; searched git identity, user.email, git init, run_git, AllCops, DISABLED_BY_DEFAULT, GitRepoFixture, RubocopConfigFixture - Where: plugins/os-sdlc/tests/support/git_repo_fixture.rb - Session: 2dd497e0-555e-4518-9cdd-c68461c32463 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2dd497e0-555e-4518-9cdd-c68461c32463.jsonl VERDICT: CREATE Parent: #1019
Author
Owner

Work started on branch fast-batch-22.

Work started on branch fast-batch-22.
Author
Owner

Resolution

Done: GitRepoScenario.init(dir, initial_branch:) owns repo init and repo-local identity; RubocopConfigFixture.minimal and .disabled_by_default own the shared rubocop configs.

Evidence: fast-batch-22 merged to main 5f32ca8f; commits a118a27a, fff0229b, c089f320. 28 init sites migrated (15 + 10 -b main + 3 eval), identity flags dropped; 6 rubocop literal sites migrated; variants used in one file stay (ruling C2). Suites green: os-sdlc 2904, eval 608. Memo finding-c-git-and-rubocop-literals.md.

Follow-ups: none

## Resolution **Done:** GitRepoScenario.init(dir, initial_branch:) owns repo init and repo-local identity; RubocopConfigFixture.minimal and .disabled_by_default own the shared rubocop configs. **Evidence:** fast-batch-22 merged to main 5f32ca8f; commits a118a27a, fff0229b, c089f320. 28 init sites migrated (15 + 10 -b main + 3 eval), identity flags dropped; 6 rubocop literal sites migrated; variants used in one file stay (ruling C2). Suites green: os-sdlc 2904, eval 608. Memo finding-c-git-and-rubocop-literals.md. **Follow-ups:** none
jared closed this issue 2026-10-28 19:00:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1466
No description provided.