Skip to content

feat(changelog): add sort_numerically filter function to template environment #1146

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

Conversation

codejedi365
Copy link
Contributor

@codejedi365 codejedi365 commented Jan 15, 2025

Purpose

  • Add sort_numerically to the changelog context as a jinja filter

Rationale

This helps organize PR or issue numbers in true numerical order even if they are a string with some alphanumeric or symbol as a prefix value.

How did you test?

Added unit test to validate all the ordering of values at the function level. Then I added unit tests to the release notes and changelog context validators to ensure that the function works and is available in the jinja environments.

How to Verify

# 1. Check out this PR
git fetch pull/1146/head:pr-1146
git checkout --detach pr-1146~3

# 2. Run pytest & observe the failures
pytest -vv -k test_sort_numerically
pytest -vv -k test_changelog_context_sort_numerically
pytest -vv -k test_release_notes_context_sort_numerically_filter

# 3. Update to the head of the PR
git merge pr-1146

# 4. Run pytest again and all tests are resolved
pytest -vv -k test_sort_numerically
pytest -vv -k test_changelog_context_sort_numerically
pytest -vv -k test_release_notes_context_sort_numerically_filter

@codejedi365 codejedi365 force-pushed the feat/numerically-sort-filter branch 3 times, most recently from c1c00e0 to f1bd193 Compare January 17, 2025 22:42
@codejedi365 codejedi365 force-pushed the feat/numerically-sort-filter branch from f1bd193 to 60a9b9f Compare January 17, 2025 23:34
@codejedi365 codejedi365 merged commit 7792388 into python-semantic-release:master Jan 17, 2025
12 checks passed
@codejedi365 codejedi365 deleted the feat/numerically-sort-filter branch January 17, 2025 23:51
@codejedi365
Copy link
Contributor Author

🎉 This PR has been published as part of Version 9.17.0 🎉

You can find more information about this release on the GitHub Releases page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant