- Notifications
You must be signed in to change notification settings - Fork5.7k
Addchango
For Changelog Management Tool#4672
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
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
23935a9
Add `chango` For Changelog Management Tool
Bibo-Joshi634980b
Add chango fragment for PR #4672
Bibo-Joshibeb11ef
Add hyperlink to chango fragment
Bibo-Joshif906265
Make linkcheck happy
Bibo-Joshib242339
Bump chango to 0.3.2
Bibo-Joshifc270e2
Static Template for GitHub Release
Bibo-Joshicc5da1a
Add a job to auto-send message to channel
Bibo-Joshi6b9dfef
fix a typo
Bibo-Joshi2c5e3d0
update faulty label config
Bibo-Joshi2a40fcf
Merge branch 'master' into chango
Bibo-Joshi47bc68f
Merge branch 'master' into chango
Bibo-Joshi6136e39
Fix Heading Levels on changelog page
Bibo-JoshiFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions.github/workflows/assets/release_template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<b>We've just released {tag}</b>. | ||
Thank you to everyone who contributed to this release. | ||
As usual, upgrade using<code>pip install -U python-telegram-bot</code>. | ||
The release notes can be found<ahref="https://docs.python-telegram-bot.org/en/{tag}/changelog.html">here</a>. |
29 changes: 29 additions & 0 deletions.github/workflows/chango_fragment.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Create Chango Fragment | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
permissions: {} | ||
jobs: | ||
create-chango-fragment: | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
name: create-chango-fragment | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Create the new fragment | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
persist-credentials: false | ||
- uses: Bibo-Joshi/chango@176c53372d1f8c0f1f6caabde100077bc45d41cc # v0.3.1 | ||
with: | ||
github-token: ${{ secrets.CHANGO_PAT }} | ||
query-issue-types: true | ||
2 changes: 1 addition & 1 deletion.github/workflows/docs-admonitions.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion.github/workflows/docs-linkcheck.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
31 changes: 28 additions & 3 deletions.github/workflows/release_pypi.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions.github/workflows/release_test_pypi.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletionsCHANGES.rst → changes/LEGACY.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
Version 21.11.1 | ||
=============== | ||
78 changes: 78 additions & 0 deletionschanges/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# noqa: INP001 | ||
# pylint: disable=import-error | ||
"""Configuration for the chango changelog tool""" | ||
from collections.abc import Collection | ||
from typing import Optional | ||
from chango.concrete import DirectoryChanGo, DirectoryVersionScanner, HeaderVersionHistory | ||
from chango.concrete.sections import GitHubSectionChangeNote, Section, SectionVersionNote | ||
version_scanner = DirectoryVersionScanner(base_directory=".", unreleased_directory="unreleased") | ||
class ChangoSectionChangeNote( | ||
GitHubSectionChangeNote.with_sections( # type: ignore[misc] | ||
[ | ||
Section(uid="highlights", title="Highlights", sort_order=0), | ||
Section(uid="breaking", title="Breaking Changes", sort_order=1), | ||
Section(uid="security", title="Security Changes", sort_order=2), | ||
Section(uid="deprecations", title="Deprecations", sort_order=3), | ||
Section(uid="features", title="New Features", sort_order=4), | ||
Section(uid="bugfixes", title="Bug Fixes", sort_order=5), | ||
Section(uid="dependencies", title="Dependencies", sort_order=6), | ||
Section(uid="other", title="Other Changes", sort_order=7), | ||
Section(uid="documentation", title="Documentation", sort_order=8), | ||
Section(uid="internal", title="Internal Changes", sort_order=9), | ||
] | ||
) | ||
): | ||
"""Custom change note type for PTB. Mainly overrides get_sections to map labels to sections""" | ||
OWNER = "python-telegram-bot" | ||
REPOSITORY = "python-telegram-bot" | ||
@classmethod | ||
def get_sections( | ||
cls, | ||
labels: Collection[str], | ||
issue_types: Optional[Collection[str]], | ||
) -> set[str]: | ||
"""Override get_sections to have customized auto-detection of relevant sections based on | ||
the pull request and linked issues. Certainly not perfect in all cases, but should be a | ||
good start for most PRs. | ||
""" | ||
combined_labels = set(labels) | (set(issue_types or [])) | ||
mapping = { | ||
"🐛 bug": "bugfixes", | ||
"💡 feature": "features", | ||
"🧹 chore": "internal", | ||
"⚙️ bot-api": "features", | ||
"⚙️ documentation": "documentation", | ||
"⚙️ tests": "internal", | ||
"⚙️ ci-cd": "internal", | ||
"⚙️ security": "security", | ||
"⚙️ examples": "documentation", | ||
"⚙️ type-hinting": "other", | ||
"🛠 refactor": "internal", | ||
"🛠 breaking": "breaking", | ||
"⚙️ dependencies": "dependencies", | ||
"🔗 github-actions": "internal", | ||
"🛠 code-quality": "internal", | ||
} | ||
# we want to return *all* from the mapping that are in the combined_labels | ||
# removing superfluous sections from the fragment is a tad easier than adding them | ||
found = {section for label, section in mapping.items() if label in combined_labels} | ||
# if we have not found any sections, we default to "other" | ||
return found or {"other"} | ||
chango_instance = DirectoryChanGo( | ||
change_note_type=ChangoSectionChangeNote, | ||
version_note_type=SectionVersionNote, | ||
version_history_type=HeaderVersionHistory, | ||
scanner=version_scanner, | ||
) |
Empty file addedchanges/unreleased/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletionschanges/unreleased/4672.G9szuJ7pRafycByfem2DrT.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
documentation = "Add `chango <https://chango.readthedocs.io/stable/>`_ As Changelog Management Tool" | ||
[[pull_requests]] | ||
uid = "4672" | ||
author_uid = "Bibo-Joshi" | ||
closes_threads = ["4321"] |
1 change: 1 addition & 0 deletionsdocs/requirements-docs.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletiondocs/source/changelog.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
.. _ptb-changelog: | ||
========= | ||
Changelog | ||
========= | ||
.. chango:: | ||
.. include:: ../../changes/LEGACY.rst |
9 changes: 9 additions & 0 deletionsdocs/source/conf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletionspyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.