commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

refactor(changelog): simplify logic for get_oldest_and_newest_rev

Open bearomorphism opened this issue 6 months ago • 1 comments

Description

  • Refactor get_oldest_and_newest_rev
  • Since we only use the latest element of the result of get_smart_range, I believe we can replace it with a simpler function.
  • The implementation of the function get_next_tag_name_after_version is based on an assumption that "all GitTags are unique". If the oldest tag's name is the input version, then it returns None. The behavior aligns with "Return None for oldest_rev if the oldest tag is the last tag in the list and matches the requested oldest tag"

Checklist

Code Changes

  • [ ] Add test cases to all the changes you introduce
  • [ ] Run poetry all locally to ensure this change passes linter check and tests
  • [ ] Manually test the changes:
    • [ ] Verify the feature/bug fix works as expected in real-world scenarios
    • [ ] Test edge cases and error conditions
    • [ ] Ensure backward compatibility is maintained
    • [ ] Document any manual testing steps performed
  • [ ] Update the documentation for the changes

bearomorphism avatar Jun 12 '25 08:06 bearomorphism

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :warning: Please upload report for BASE (v4-9-0-test@b313847). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff               @@
##             v4-9-0-test    #1539   +/-   ##
==============================================
  Coverage               ?   98.31%           
==============================================
  Files                  ?       58           
  Lines                  ?     2669           
  Branches               ?        0           
==============================================
  Hits                   ?     2624           
  Misses                 ?       45           
  Partials               ?        0           
Flag Coverage Δ
unittests 98.31% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 12 '25 08:06 codecov[bot]