Skip to content

Commit 48d1623

Browse files
committed
docs: migrate to scriv to manage changelog
1 parent 8856282 commit 48d1623

File tree

16 files changed

+257
-59
lines changed

16 files changed

+257
-59
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ Check off if complete *or* not applicable:
5555
- [ ] All reviewers approved
5656
- [ ] Reviewer tested the code following the testing instructions
5757
- [ ] CI build is green
58-
- [ ] Version bumped
59-
- [ ] Changelog record added with short description of the change and current date
58+
- [ ] Changelog entry added using scriv with short description of the change
6059
- [ ] Documentation updated (not only docstrings)
6160
- [ ] Integration with other services reviewed
6261
- [ ] Fixup commits are squashed away
6362
- [ ] Unit tests added/updated
6463
- [ ] Noted any: Concerns, dependencies, migration issues, deadlines, tickets
6564

6665
**Post Merge:**
67-
- [ ] Create a tag
68-
- [ ] Create a release on GitHub
69-
- [ ] Check new version is pushed to PyPI after tag-triggered build is
70-
finished.
66+
- [ ] Trigger the release workflow to create a new GitHub release.
67+
- [ ] Check new version is pushed to PyPI after tag-triggered build is finished.
7168
- [ ] Delete working branch (if not needed anymore)
7269
- [ ] Upgrade the package in the Open edX platform requirements (if applicable)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Create a Release Pull Request
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump-type:
7+
description: "The type of version bump"
8+
required: true
9+
type: choice
10+
options:
11+
- "major"
12+
- "minor"
13+
- "patch"
14+
15+
jobs:
16+
create-release-pr:
17+
runs-on: ubuntu-latest
18+
env:
19+
BUMP_TYPE: ${{ github.event.inputs.bump-type }}
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.11
29+
30+
- name: Install release requirements
31+
run: pip install scriv bump-my-version
32+
33+
- name: Configure Git user
34+
run: |
35+
git config user.name 'github-actions[bot]'
36+
git config user.email 'github-actions[bot]@users.noreply.github.com'
37+
38+
- name: Compute version bump
39+
id: version
40+
run: |
41+
echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
42+
echo "NEW_VERSION=$(bump-my-version show --increment $BUMP_TYPE new_version)" >> $GITHUB_OUTPUT
43+
44+
- name: Bump version
45+
run: bump-my-version bump $BUMP_TYPE
46+
47+
- name: Collect changelog
48+
run: make changelog
49+
50+
- name: Create Pull Request
51+
uses: peter-evans/create-pull-request@v7
52+
with:
53+
commit-message: "chore: bump version ${{ steps.version.outputs.CURRENT_VERSION }} → ${{ steps.version.outputs.NEW_VERSION }}"
54+
title: "v${{ steps.version.outputs.NEW_VERSION }} Release"
55+
body: |
56+
### Description
57+
58+
This PR bumps the version from `${{ steps.version.outputs.CURRENT_VERSION }}` to `${{ steps.version.outputs.NEW_VERSION }}`.
59+
60+
The changelog has been automatically generated using `scriv`.
61+
branch: "release-${{ steps.version.outputs.NEW_VERSION }}"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create a new GitHub Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
github-release:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.11
18+
19+
- name: Install release requirements
20+
run: pip install scriv bump-my-version
21+
22+
- name: Install pandoc for scriv
23+
run: sudo apt install -y pandoc
24+
25+
- name: Configure Git user
26+
run: |
27+
git config user.name 'github-actions[bot]'
28+
git config user.email 'github-actions[bot]@users.noreply.github.com'
29+
30+
- name: Read current version
31+
id: version
32+
run: |
33+
echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
34+
35+
- name: Create and push Git tag
36+
env:
37+
CURRENT_VERSION: ${{ steps.version.outputs.CURRENT_VERSION }}
38+
run: |
39+
git tag -a "v$CURRENT_VERSION" -m "Release v$CURRENT_VERSION"
40+
git push origin "v$CURRENT_VERSION"
41+
42+
- name: Create GitHub release
43+
run: scriv github-release --repo=openedx/openedx-events
44+
env:
45+
GITHUB_TOKEN: ${{ github.token }}

CHANGELOG.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,41 @@ Change Log
33

44
..
55
All enhancements and patches to openedx_events will be documented
6-
in this file. It adheres to the structure of https://keepachangelog.com/ ,
6+
in this file. It adheres to the structure of https://keepachangelog.com/,
77
but in reStructuredText instead of Markdown (for ease of incorporation into
88
Sphinx documentation and the PyPI description).
99
1010
This project adheres to Semantic Versioning (https://semver.org/).
1111

1212
.. There should always be an "Unreleased" section for changes pending release.
1313
14+
..
15+
⚠️ PLEASE, DO NOT ADD YOUR CHANGES TO THIS FILE! (unless you want to modify
16+
existing changelog entries in this file) Changelog entries are managed by
17+
scriv.
18+
19+
If you need to add a changelog entry:
20+
21+
- Run `make changelog-entry` to create a new changelog entry.
22+
- Edit and commit the newly-created file in the `changelog.d` folder
23+
following the instructions in the file.
1424

25+
If you need to create a new release:
26+
27+
- There is a `relese.yml` workflow to create a new release. You can trigger
28+
it manually in the Actions tab in GitHub. The workflow will bump the
29+
version, update the changelog, create a tag, and create a new GitHub
30+
release! 🚀
1531

1632
Unreleased
1733
__________
1834

35+
See the fragment files in the `changelog.d directory`_.
36+
37+
.. _changelog.d directory: https://github.com/openedx/openedx-events/tree/master/changelog.d
38+
39+
.. scriv-insert-here
40+
1941
[10.5.0] - 2025-08-19
2042
---------------------
2143

@@ -33,7 +55,6 @@ Added
3355

3456
* Added new ``ENTERPRISE_GROUP_DELETED`` event in enterprise.
3557

36-
3758
[10.3.0] - 2025-05-23
3859
---------------------
3960

@@ -76,10 +97,13 @@ Added
7697
* Added new ``EXTERNAL_GRADER_SCORE_SUBMITTED`` event in learning.
7798
* Add ``ExternalGraderScoreData`` to support this event
7899

100+
79101
[10.0.0] - 2024-04-04
80102
---------------------
103+
81104
Changed
82105
~~~~~~~
106+
83107
* **Breaking change**: LibraryCollectionData now takes only a LibraryCollectionLocator.
84108
* **Breaking change**: LibraryContainerData now takes only a LibraryContainerLocator.
85109

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.PHONY: clean clean_tox compile_translations coverage diff_cover docs dummy_translations \
22
extract_translations fake_translations help pull_translations push_translations \
3-
quality requirements selfcheck test test-all upgrade validate install_transifex_client
3+
quality requirements selfcheck test test-all upgrade validate install_transifex_client \
4+
changelog-entry changelog
45

56
.DEFAULT_GOAL := help
67

@@ -32,6 +33,12 @@ docs: ## generate Sphinx HTML documentation, including API docs
3233
tox -e docs
3334
$(BROWSER)docs/_build/html/index.html
3435

36+
changelog-entry: ## Create a new changelog entry
37+
scriv create
38+
39+
changelog: ## Collect changelog entries in the CHANGELOG.rst file
40+
scriv collect
41+
3542
# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
3643
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)
3744

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Added
2+
~~~~~
3+
* Migrate to scriv to manage changelog. (by @bryanttv in #472)

changelog.d/scriv.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[scriv]
2+
version = literal: openedx_events/__init__.py: __version__
3+
format = rst
4+
entry_title_template = file: changelog.d/scriv/entry_title.${config:format}.j2
5+
new_fragment_template = file: changelog.d/scriv/new_fragment.${config:format}.j2
6+
rst_header_chars = -~
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% if version %}[v{{ version }}] - {% endif %}{{ date.strftime('%Y-%m-%d') }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.. Create a new changelog entry for every new user-facing change.
2+
3+
.. Please respect the following instructions:
4+
.. * Add a new bullet item for the category that best describes the change.
5+
.. * You may optionally append "(by @<author> in #<pr-number>)" at the end of
6+
.. the bullet item. This will be used to credit the PR author in the bullet
7+
.. item, where <author> is the GitHub username of the author of the change
8+
.. and <pr-number> is the PR number of the change. These affiliations will
9+
.. be displayed in the release notes for every release.
10+
.. * The accepted categories are: Added, Changed, Deprecated, Removed, Fixed,
11+
.. and Security.
12+
.. * Indicate breaking changes with a "**BREAKING CHANGE:**" prefix in the
13+
.. bullet item.
14+
15+
.. For example:
16+
17+
.. Added
18+
.. ~~~~~
19+
.. * Added new ``COURSE_DOWNLOADED_COMPLETED`` event.
20+
.. * Added support for annotated Python dictionaries as Avro Map type. (by @developer in #1)
21+
22+
.. Changed
23+
.. ~~~~~~~
24+
.. * Added support for Python 3.12.
25+
.. * **BREAKING CHANGE:** Updated from Django 3.x to 4.x. (by @developer #2)
26+
27+
.. Deprecated
28+
.. ~~~~~~~~~~
29+
.. * Deprecated ``COURSE_DOWNLOADED_STARTED`` event
30+
.. * Deprecated use of non-annotated dictionaries in events. (by @developer #3)
31+
32+
.. Removed
33+
.. ~~~~~~~
34+
.. * Removed support for Python 3.8.
35+
.. * Removed unused ``COURSE_DOWNLOADED_STARTED`` event. (by @developer #4)
36+
37+
.. Fixed
38+
.. ~~~~~
39+
.. * Fixed event validation in background processes.
40+
.. * Fixed incorrect handling of event payloads. (by @developer #4)
41+
42+
.. Security
43+
.. ~~~~~~~~
44+
.. * Updated dependencies to patch security vulnerabilities.

requirements/base.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#
55
# make upgrade
66
#
7-
asgiref==3.9.1
7+
asgiref==3.9.2
88
# via django
99
attrs==25.3.0
1010
# via -r requirements/base.in
1111
cffi==2.0.0
1212
# via pynacl
13-
click==8.2.1
13+
click==8.3.0
1414
# via edx-django-utils
1515
django==4.2.24
1616
# via
@@ -27,19 +27,19 @@ dnspython==2.8.0
2727
# via pymongo
2828
edx-ccx-keys==2.0.2
2929
# via -r requirements/base.in
30-
edx-django-utils==8.0.0
30+
edx-django-utils==8.0.1
3131
# via -r requirements/base.in
3232
edx-opaque-keys[django]==3.0.0
3333
# via
3434
# -r requirements/base.in
3535
# edx-ccx-keys
3636
fastavro==1.12.0
3737
# via -r requirements/base.in
38-
psutil==7.0.0
38+
psutil==7.1.0
3939
# via edx-django-utils
4040
pycparser==2.23
4141
# via cffi
42-
pymongo==4.15.0
42+
pymongo==4.15.1
4343
# via edx-opaque-keys
4444
pynacl==1.6.0
4545
# via edx-django-utils

0 commit comments

Comments
 (0)