Sdlc/Sequel/InlineDatasetQuery flags a test file: scope the Sequel cops or correct the hit #917
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#917
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 cop
Sdlc/Sequel/InlineDatasetQueryreports an offense in a test file. The three new Sequel dataset cops have no path scope, so they run ontests/and onlib/. The older copSdlc/Sequel/RowIndexOnModelexempts tests.Observed
Full lint of
plugins/os-sdlcon main reports 21 offenses. One offense is new today.Line 202, with context:
The lint of commit
1360ffba(the HEAD before today's work) reports 20 offenses. The other 20 offenses on main are the same 20 offenses. This is the only offense that today's commits introduced.Scope facts:
plugins/os-sdlc/.rubocop.ymlenablesSdlc/Sequel/DatasetResultCompared,Sdlc/Sequel/RubyFilterAfterAll, andSdlc/Sequel/InlineDatasetQuerywithExclude: []and noInclude. They run on every path, tests included.Sdlc/Sequel/RowIndexOnModelsetsDEFAULT_ALLOWED_PATHS = %w[**/model/**/* **/*_test.rb **/tests/**/*]inlib/os_sdlc/cops/row_index_on_model.rb. It uses theAllowedPathsmixin inlib/os_sdlc/cops/sequel_allowed_paths.rb. It returns early for those paths.dataset_result_compared.rb,ruby_filter_after_all.rb,inline_dataset_query.rb) do not useAllowedPaths.The cop came from ticket #911 (commit
8087fdfc).Reproduce
Approach
Two options. This ticket does not choose between them.
Option A: exclude
tests/from the three Sequel dataset cops (for example withAllowedPathslikeRowIndexOnModel, orExcludein.rubocop.yml).Option B: keep tests in scope and correct the hit at
tests/model/dispatch_test.rb:202.The lint gate blocks the next change that touches
tests/model/dispatch_test.rbuntil the offense is gone or the scope changes.Required work: none beyond the acceptance criteria.
Acceptance criteria
plugins/os-sdlcruns, then it reports noSdlc/Sequel/InlineDatasetQueryoffense attests/model/dispatch_test.rb.Origin
plugins/os-sdlcon main after #911.8087fdfc,plugins/os-sdlc/.rubocop.yml)