Remove unused attribute Gitlab::Git::Tag#object_sha

Summary

Removes the unused attribute Gitlab::Git::Tag#object_sha (an attr_reader) from lib/gitlab/git/tag.rb.

The instance variable @object_sha is never assigned in initialize, init_from_hash, or init_from_gitaly, so the reader always returned nil. It is not part of SERIALIZE_KEYS, so the serialization metaprogramming loop (send("#{key}=", ...)) never populated it, and it has no callers anywhere in the codebase.

Related to #542966

Verification

This attribute was verified as unused by:

  • keela --type attributes flagged it as unused
  • Grep search found no callers (only match was its own declaration; object_shape hits in ruby_sampler.rb are unrelated)
  • No metaprogramming patterns reference it (not in SERIALIZE_KEYS; @object_sha is never assigned)
  • Not a Rails convention method
  • Not a callback

Cascade Removals

None - this was a standalone removal.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 154.7 154.7 -0.0 (0%)
Attribute flog score 0.0 N/A -0.0 removed (an attr_reader adds no flog complexity)

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total 1129.1 1129.1 -0.0 (0%)
Spec block flog score 0.0 N/A -0.0 removed (no spec existed for object_sha)

Combined Flog Summary

File Flog Removed
lib/gitlab/git/tag.rb 0.0
spec/lib/gitlab/git/tag_spec.rb 0.0
Total 0.0

Test Suite Impact

  • Specs removed: 0 examples (the attribute was untested)
  • Spec file: spec/lib/gitlab/git/tag_spec.rb (unchanged; tag_spec.rb still passes: 53 examples, 0 failures)
  • Time saved per run: 0.00 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.00 hrs/month $0.00 $0.00
Moderate 30,000 0.00 hrs/month $0.00 $0.00
Optimistic 50,000 0.00 hrs/month $0.00 $0.00

Based on 0.00 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes). This removal drops dead code with no associated tests, so the CI saving is zero; the benefit is reduced surface area and clearer intent.

Files Modified

  • lib/gitlab/git/tag.rb (attribute removed from attr_reader - 1 line changed)
  • scripts/lint/keela_baseline.yml (entry removed - 2 lines)
  • Related to #542966 (Improve unused helper methods workflow)
  • Part of dead code cleanup effort
  • Attribute was listed in scripts/lint/keela_baseline.yml

Merge request reports

Loading
Loading