Skip to content

Commit

Permalink
Merge pull request #111 from lsst-ts/tickets/DM-41258
Browse files Browse the repository at this point in the history
DM-41258: Implement towncrier is ts_observatory_control.
  • Loading branch information
tribeiro authored Oct 20, 2023
2 parents 5e73c62 + 5628ab1 commit 630ea59
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 71 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/changelog.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/enforce_rebase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Enforce Rebasing

on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches-ignore:
- main

jobs:
rebase_job:
runs-on: ubuntu-latest
name: Enforce rebasing

steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Is Rebased on develop?
uses: cyberark/enforce-rebase@v2
with:
default-branch: develop
26 changes: 26 additions & 0 deletions .github/workflows/news_creation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ChangelogUpdated
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]

jobs:
build:
name: Check for new news fragments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Install towncrier
run: |
$CONDA/bin/conda install -c conda-forge towncrier -y
- name: Run towncrier check command
run: |
$CONDA/bin/towncrier check --compare-with origin/develop --config pyproject.toml
1 change: 1 addition & 0 deletions doc/news/DM-41258.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Integrate towncrier for release notes and change log management.
39 changes: 39 additions & 0 deletions doc/news/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Recording Changes
=================

This directory contains "news fragments" which are small, structured text files that contain information about changes or updates that will be included in the release notes.
These fragments are used to automatically generate changelogs or release notes.
They can be written restructured text format or plain text.

Each file should be named like ``<JIRA TICKET>.<TYPE>.<EXT>`` with a file extension defining the markup format (``rst|md``).
The ``<TYPE>`` should be one of:

* ``feature``: A new feature
* ``bugfix``: A bug fix.
* ``perf``: A performance enhancement.
* ``doc``: A documentation improvement.
* ``removal``: A deprecation or removal of API.
* ``misc``: Other minor changes and/or additions

An example file name would therefore look like ``DM-40534.doc.rst``.

Each developer now has to create the news fragments for the changes they have made on their own branches,
instead of adding them to the release notes directly.
The news fragments are then automatically integrated into the release notes by the ``towncrier`` tool.

You can test how the content will be integrated into the release notes by running ``towncrier build --draft --version=v<X.XX.X>``.
Note that you have to run it from the root repository directory (i.e. the ``ts_observatory_control``).

In order to update the release notes file for real, the person responsible for the release should run:

.. code-block:: bash
$ towncrier build --version=v<X.XX.X>
.. note::

When running towncrier to build the changelog, you may be prompted to confirm the deletion of fragments.
If you would like to retain the fragments in the doc/news directory do not confirm the deletion.

Note also that ``towncrier`` can be installed from PyPI or conda-forge.
Loading

0 comments on commit 630ea59

Please sign in to comment.