Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(changelog): simplify logic for get_oldest_and_newest_rev#1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
bearomorphism wants to merge2 commits intocommitizen-tools:v4-9-0-test
base:v4-9-0-test
Choose a base branch
Loading
frombearomorphism:get_oldest_and_newest_rev

Conversation

bearomorphism
Copy link
Contributor

@bearomorphismbearomorphism commentedJun 12, 2025
edited
Loading

Description

  • Refactorget_oldest_and_newest_rev
  • Since we only use the latest element of the result ofget_smart_range, I believe we can replace it with a simpler function.
  • The implementation of the functionget_next_tag_name_after_version is based on an assumption that "all GitTags are unique". If the oldest tag's name is the inputversion, then it returnsNone. The behavior aligns with "ReturnNone foroldest_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
  • Runpoetry 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

@codecovCodecov
Copy link

codecovbot commentedJun 12, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Pleaseupload report for BASE (v4-9-0-test@6a90185).Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff               @@##             v4-9-0-test    #1539   +/-   ##==============================================  Coverage               ?   97.94%           ==============================================  Files                  ?       58             Lines                  ?     2682             Branches               ?        0           ==============================================  Hits                   ?     2627             Misses                 ?       55             Partials               ?        0
FlagCoverage Δ
unittests97.94% <100.00%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

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

@bearomorphismbearomorphism marked this pull request as ready for reviewJune 12, 2025 09:32
@Lee-WLee-W added this to the4.9.0 milestoneJun 12, 2025
raise NoCommitsFoundError(f"Could not find a valid revision range. {version=}")


# TODO: unused, deprecate this?
def get_smart_tag_range(
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure if removing the function is a breaking change.

@bearomorphismbearomorphismforce-pushed theget_oldest_and_newest_rev branch from0b7774c to7316c2fCompareJune 13, 2025 03:02
Comment on lines 285 to 291
def get_next_tag_name_after_version(tags: Iterable[GitTag], version: str) -> str | None:
a, b = tee(chain((tag.name for tag in tags), [None]))
next(b, None)
try:
return next(y for x, y in zip(a, b) if x == version)
except StopIteration:
raise NoCommitsFoundError(f"Could not find a valid revision range. {version=}")
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks@gbaian10 for reminding me here we don't have to use a while loop.

@bearomorphismbearomorphismforce-pushed theget_oldest_and_newest_rev branch from7316c2f to1d9f4abCompareJune 13, 2025 05:42
@bearomorphismbearomorphismforce-pushed theget_oldest_and_newest_rev branch from1d9f4ab to277d8f9CompareJune 16, 2025 14:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@woilewoileAwaiting requested review from woilewoile is a code owner

@Lee-WLee-WAwaiting requested review from Lee-WLee-W is a code owner

@noirbizarrenoirbizarreAwaiting requested review from noirbizarrenoirbizarre is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
4.9.0
Development

Successfully merging this pull request may close these issues.

2 participants
@bearomorphism@Lee-W

[8]ページ先頭

©2009-2025 Movatter.jp