Compute the ClassLength backstop from unfiltered offenses #1391
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#1391
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
The backstop check in the gate reply can report a false "backstop hit". The gate lint step shows only offenses that are new against the base branch. The backstop check reads that filtered set. When a family cop offense already exists on base, the filter removes it. The check then sees
Metrics/ClassLengthwith no family cop and says no family cop explains the file, but one does.Observed
Gate::Reply#lint_outputpasses the lint step output toLintOutput.backstop_paths(plugins/os-sdlc/lib/os_sdlc/gate/reply.rb:30-37).The lint step command runs
bin/os-sdlc-lint --base <base>(plugins/os-sdlc/lib/os_sdlc/gate/commands.rb:84-88).NewOffenseReport#printwrites onlyadded_offensesas the JSON (plugins/os-sdlc/lib/os_sdlc/fast_gate/new_offense_report.rb:22-23).NewOffenseCheck#added_offensesdrops every head offense that matches a base offense by key (plugins/os-sdlc/lib/os_sdlc/fast_gate/new_offense_check.rb:17-39).The key is
[path, cop, message](plugins/os-sdlc/lib/os_sdlc/fast_gate/offense.rb:12).LintOutput.backstop?flags a file when it hasMetrics/ClassLengthand no cop of the family (plugins/os-sdlc/lib/os_sdlc/gate/lint_output.rb:29-32).Case: a class grows past the limit, so
Metrics/ClassLengthis new. A family cop offense in the same file exists on base with the same message, so the step filters it out.backstop_pathsreturns that file.Reproduce
n/a: found by reading the code in the orchestrator review of commit
cb4674b6; no run was made.Approach
Compute the family check from the unfiltered offenses of the flagged files. The ticket decides the exact design.
Required work:
Metrics/ClassLengthoffense.Acceptance criteria
Metrics/ClassLengthoffense and a family cop offense that already exists on base, when the gate renders the lint failure, then the reply shows no backstop hit for that file.Metrics/ClassLengthoffense and no family cop offense on head, when the gate renders the lint failure, then the reply shows a backstop hit for that file.Owner sketch
Origin
cb4674b6)plugins/os-sdlc/lib/os_sdlc/gate/reply.rb:30-37,plugins/os-sdlc/lib/os_sdlc/fast_gate/new_offense_check.rb:17-39)