-
-
Notifications
You must be signed in to change notification settings - Fork 299
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4-9-0-test
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1535,6 +1535,24 @@ def test_get_smart_tag_range_returns_an_extra_for_a_single_tag(tags): | |
assert 2 == len(res) | ||
|
||
|
||
def test_get_next_tag_name_after_version(tags): | ||
# Test finding next tag after a version | ||
next_tag_name = changelog.get_next_tag_name_after_version(tags, "v1.2.0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like previous tag instead of next tag 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I rename it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you don't have the issue with the name previous_verison than let's do it :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. k |
||
assert next_tag_name == "v1.1.1" | ||
|
||
next_tag_name = changelog.get_next_tag_name_after_version(tags, "v1.1.0") | ||
assert next_tag_name == "v1.0.0" | ||
|
||
# Test finding last tag when given version is last | ||
last_tag_name = changelog.get_next_tag_name_after_version(tags, "v0.9.1") | ||
assert last_tag_name is None | ||
|
||
# Test error when version not found | ||
with pytest.raises(changelog.NoCommitsFoundError) as exc_info: | ||
changelog.get_next_tag_name_after_version(tags, "nonexistent") | ||
assert "Could not find a valid revision range" in str(exc_info.value) | ||
|
||
|
||
@dataclass | ||
class TagDef: | ||
name: str | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mark it as deprecated and remove in the next version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a deprecation warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done