Skip to content

Commit

Permalink
use towncrier to handle changelog entries (spacetelescope#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett authored and mairanteodoro committed Sep 10, 2024
1 parent 9c38271 commit 71fabd3
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 28 deletions.
30 changes: 29 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,35 @@ Closes #
This PR addresses ...

**Checklist**
- [ ] added entry in `CHANGES.rst` under the corresponding subsection
- [ ] for a public change, added a towncrier news fragment in `changes/` <details><summary>`echo "changed something" > changes/<PR#>.<changetype>.rst`</summary>

- ``changes/<PR#>.general.rst``: infrastructure or miscellaneous change
- ``changes/<PR#>.docs.rst``
- ``changes/<PR#>.stpipe.rst``
- ``changes/<PR#>.associations.rst``
- ``changes/<PR#>.scripts.rst``
- ``changes/<PR#>.mosaic_pipeline.rst``
- ``changes/<PR#>.patch_match.rst``

## steps
- ``changes/<PR#>.dq_init.rst``
- ``changes/<PR#>.saturation.rst``
- ``changes/<PR#>.refpix.rst``
- ``changes/<PR#>.linearity.rst``
- ``changes/<PR#>.dark_current.rst``
- ``changes/<PR#>.jump_detection.rst``
- ``changes/<PR#>.ramp_fitting.rst``
- ``changes/<PR#>.assign_wcs.rst``
- ``changes/<PR#>.flatfield.rst``
- ``changes/<PR#>.photom.rst``
- ``changes/<PR#>.flux.rst``
- ``changes/<PR#>.source_detection.rst``
- ``changes/<PR#>.tweakreg.rst``
- ``changes/<PR#>.skymatch.rst``
- ``changes/<PR#>.outlier_detection.rst``
- ``changes/<PR#>.resample.rst``
- ``changes/<PR#>.source_catalog.rst``
</details>
- [ ] updated relevant tests
- [ ] updated relevant documentation
- [ ] updated relevant milestone(s)
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Changelog
name: changelog

on:
pull_request:
types: [labeled, unlabeled, opened, synchronize, reopened]
types:
- labeled
- unlabeled
- opened
- synchronize
- reopened

# Only cancel in-progress jobs or runs for the current workflow
# This cancels the already triggered workflows for a specific PR without canceling
# other instances of this workflow (other PRs, scheduled triggers, etc) when something
# within that PR re-triggers this CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changelog:
name: Confirm changelog entry
check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }}
runs-on: ubuntu-latest
steps:
- name: Check change log entry
uses: scientific-python/action-check-changelogfile@1fc669db9618167166d5a16c10282044f51805c0 # 0.3
env:
CHANGELOG_FILENAME: CHANGES.rst
CHECK_MILESTONE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: 3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install .
- run: pip install towncrier
- run: towncrier check
- run: towncrier build --draft | grep -P '#${{ github.event.number }}'
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ build:
- ./git-lfs fetch
# Make local files to have the real content on them
- ./git-lfs checkout
post_install:
- towncrier build --keep

conda:
environment: docs/rtd_environment.yaml
Expand Down
15 changes: 2 additions & 13 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
0.16.4dev
=========

mosaic_pipeline
---------------

- Allow asn product name to be the output product [#1394]




0.16.3 (2024-08-29)
===================

Expand Down Expand Up @@ -99,7 +88,7 @@ stpipe
------

- Add ``ModelContainer`` support to ``Step._datamodels_open`` to allow
loading "pars-*" files from CRDS. [#1270]
loading ``pars-*`` files from CRDS. [#1270]


tweakreg
Expand Down Expand Up @@ -749,7 +738,7 @@ linearity

- Linearity correction now supports NaN's in the reference file. [#484]

photom
photom
------

- Photom updated to skip updating photometric converstions for spectral data [#498]
Expand Down
Empty file added changes/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions changes/1375.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
handle changelog entries with ``towncrier``
1 change: 1 addition & 0 deletions changes/1394.mosaic_pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow asn product name to be the output product
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ desk at `Roman Help Desk <https://stsci.service-now.com/roman>`_.
:maxdepth: 1

roman/pipeline_static_preview.rst
roman/changes.rst
7 changes: 7 additions & 0 deletions docs/roman/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: roman

***********
Change Log
***********

.. include:: ../../CHANGES.rst
1 change: 1 addition & 0 deletions docs/rtd_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dependencies:
- pip
- graphviz
- sphinx_rtd_theme>1.2.0
- towncrier
131 changes: 131 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,134 @@ archs = [
"auto",
"aarch64",
]

[tool.towncrier]
filename = "CHANGES.rst"
directory = "changes"
package = "romancal"
title_format = "{version} ({project_date})"
ignore = [".gitkeep"]
wrap = true
issue_format = "`#{issue} <https://github.com/spacetelescope/romancal/issues/{issue}>`_"

[[tool.towncrier.type]]
directory = "general"
name = "General"
showcontent = true

[[tool.towncrier.type]]
directory = "docs"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "stpipe"
name = "``stpipe``"
showcontent = true

[[tool.towncrier.type]]
directory = "associations"
name = "Associations"
showcontent = true

[[tool.towncrier.type]]
directory = "scripts"
name = "Scripts"
showcontent = true

[[tool.towncrier.type]]
directory = "mosaic_pipeline"
name = "``mosaic_pipeline``"
showcontent = true

[[tool.towncrier.type]]
directory = "patch_match"
name = "``patch_match``"
showcontent = true

# steps

[[tool.towncrier.type]]
directory = "dq_init"
name = "``dq_init`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "saturation"
name = "``saturation`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "refpix"
name = "``refpix`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "linearity"
name = "``linearity`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "dark_current"
name = "``dark_current`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "jump_detection"
name = "``jump_detection``"
showcontent = true

[[tool.towncrier.type]]
directory = "ramp_fitting"
name = "``ramp_fitting`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "assign_wcs"
name = "``assign_wcs`` (WFI-Image, WFI-Prism, WFI-Grism)"
showcontent = true

[[tool.towncrier.type]]
directory = "flatfield"
name = "``flatfield`` (WFI-Image)"
showcontent = true

[[tool.towncrier.type]]
directory = "photom"
name = "``photom`` (WFI-Image)"
showcontent = true

[[tool.towncrier.type]]
directory = "flux"
name = "``flux``"
showcontent = true

[[tool.towncrier.type]]
directory = "source_detection"
name = "``source_detection`` (WFI-Image)"
showcontent = true

[[tool.towncrier.type]]
directory = "tweakreg"
name = "``tweakreg`` (WFI-Image)"
showcontent = true

[[tool.towncrier.type]]
directory = "skymatch"
name = "``skymatch``"
showcontent = true

[[tool.towncrier.type]]
directory = "outlier_detection"
name = "``outlier_detection``"
showcontent = true

[[tool.towncrier.type]]
directory = "resample"
name = "``resample``"
showcontent = true

[[tool.towncrier.type]]
directory = "source_catalog"
name = "``source_catalog``"
showcontent = true

0 comments on commit 71fabd3

Please sign in to comment.