Delete the os-sdlc code that has no callers #1216
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1216
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Three Ruby files in os-sdlc have no caller. They are
IssueSource.forwith its helpers,LintResultAssertions, andRecordingRubocopRunner.CRC run 3 found them. A second search confirmed it. The search covered
plugins/andbin/. It used the constant names, because Zeitwerk loads constants withoutrequirelines.The run 2 dead-code ticket was #1141. It is closed. These files are new to the list, or they lost their last caller after run 2.
lib/os_sdlc/lint.rbis not on the list. It definesOsSdlc::Lint, and the files underlib/os_sdlc/lint/reopen that namespace. Zeitwerk needs it.Evidence:
IssueSource.forhas no caller inlib,bin, orhooks. Onlytests/tracker/issue_source_test.rbcalls it (8 calls).tests/cops/query_method_reaches_write_test.rb:37holds the name inside a message string. Its private helpersbuild,tracker_required_error, andunsupported_tracker_error, and the constantTRACKER_CLASSES, serve onlyfor.LintResultAssertionshas noincludeand no other mention outside its own file.RecordingRubocopRunnerhas nonewcall and no other mention outside its own file.The
IssueSourcemodule itself stays.Forgejo,Github,Shell,TicketText, andTrackerLookuplive under it.tracker/forgejo.rb:11callsTrackerLookup, andtracker/backlog.rb:32callsShell.Reproduce
Only tests, the files themselves, and fixture history files match.
Approach
Delete the code. Delete the tests that cover only the deleted code.
Required work:
self.for, its three private helpers,TRACKER_CLASSES, and theprivate_class_methodline fromlib/os_sdlc/tracker/issue_source.rb. Keep the empty module. — check: absentdef self.forinplugins/os-sdlc/lib/os_sdlc/tracker/issue_source.rbtests/tracker/issue_source_test.rb. It tests onlyfor. Keepissue_source_api_test.rb,issue_source_forgejo_test.rb,issue_source_forgejo_host_test.rb, andissue_source_github_test.rb. If a case in the deleted file is the only test ofTrackerLookupbehavior, move that case intoissue_source_forgejo_host_test.rb.plugins/os-sdlc/tests/support/lint_result_assertions.rb. — check: absentmodule LintResultAssertionsinplugins/os-sdlc/tests/**/*.rbplugins/os-sdlc/tests/support/recording_rubocop_runner.rb. — check: absentclass RecordingRubocopRunnerinplugins/os-sdlc/tests/**/*.rbOrchestrator work: write
gone: <sha> <subject>notes into the evidence cells of the deleted rows. Useplugins/os-sdlc/bin/crc-records.Acceptance criteria
grep -rn "IssueSource\.for" plugins/os-sdlc/lib plugins/os-sdlc/testsruns, then no line matches except the message string intests/cops/query_method_reaches_write_test.rb.ls plugins/os-sdlc/tests/supportruns, thenlint_result_assertions.rbandrecording_rubocop_runner.rbare absent.lib/os_sdlc/lint.rb, when the change is complete, then the file still exists.Owner sketch
OsSdlc::Tracker::IssueSourcestays as a namespace module for the adapters. It has no methods.Origin
IssueSource.for)VERDICT: CREATE
Occurrence: Delete the dead Lint class body, Tracker::IssueSource.for chain, and three dead test support files
Seen: plugins/os-sdlc/lib/os_sdlc/lint.rb, plugins/os-sdlc/lib/os_sdlc/tracker/issue_source.rb, plugins/os-sdlc/tests/support/recording_rubocop_runner.rb
Run: CRC run 4 over os-sdlc, session c1bedec6-7e01-45ab-b9db-22d63652c19f
Adds: CRC run 4 final judgment round predicted delete (85-90%) for the three files here and for more dead code: the OsSdlc::Lint class body (namespace stays), IssueSource::Forgejo, IssueSource::Github, IssueSource::TicketText, and tests/support/fake_rubocop_runner.rb (only RecordingRubocopRunner uses it).