Loading
Remove unused scope Ci::Pipeline.where_not_sha
Summary
Removes the unused scope Ci::Pipeline.where_not_sha from app/models/ci/pipeline.rb.
Related to #542966
Verification
This scope was verified as unused by:
-
keela --type scopesflagged it as unused - Grep search found no callers
- Not used in scope chaining
- Not used in merge() calls
- Not used as default_scope or association scope
The only references in the codebase were the scope definition itself and its own spec block. No usages exist in app/, lib/, ee/, GraphQL, API, finders, workers, or presenters, and no dynamic/metaprogramming dispatch references it.
Cascade Removals
None - this was a standalone removal.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 2299.2 | 2294.9 | -4.3 (0.19%) |
| Scope flog score | 4.3 | N/A | -4.3 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 18777.7 | 18743.8 | -33.9 (0.18%) |
| Spec block flog score | 33.9 | N/A | -33.9 removed |
Test Suite Impact
- Specs removed: 2 examples
- Spec file:
spec/models/ci/pipeline_spec.rb - Time saved per run: 0.07 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 0.29 hrs/month | $0.53 | $6.30 |
| Moderate | 30,000 | 0.58 hrs/month | $1.05 | $12.60 |
| Optimistic | 50,000 | 0.97 hrs/month | $1.75 | $21.00 |
Based on 0.07 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/ci/pipeline.rb(scope removed - 1 line)spec/models/ci/pipeline_spec.rb(specs removed - 21 lines, 2 examples)scripts/lint/keela_baseline.yml(entry removed)
Related
- Related to #542966 (Improve unused helper methods workflow)
- Part of dead code cleanup effort
- Scope was listed in
scripts/lint/keela_baseline.yml