Skip to content

Commit

Permalink
Merge pull request #1075 from alphasentaurii/revise-changelog
Browse files Browse the repository at this point in the history
changelog/rebase-from-master
  • Loading branch information
alphasentaurii authored Sep 25, 2024
2 parents 55daeeb + 1e86cf8 commit e754c51
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 75 deletions.
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- If this PR closes a JIRA ticket, make sure the title starts with the JIRA issue number,
for example JP-1234: <Fix a bug> -->
Resolves [CCD-nnnn](https://jira.stsci.edu/browse/CCD-nnnn)

<!-- If this PR closes a GitHub issue, reference it here by its number -->
Closes #

<!-- describe the changes comprising this PR here -->
This PR addresses ...

<!-- if you can't perform these tasks due to permissions, please ask a maintainer to do them -->
## Tasks
- [ ] update or add relevant tests
- [ ] update relevant docstrings and / or `docs/` page
- [ ] Does this PR change any API used downstream? (if not, label with `no-changelog-entry-needed`)
- [ ] write news fragment(s) in `changes/`: `echo "changed something" > changes/<PR#>.<changetype>.rst` (see below for change types)

<details><summary>news fragment change types...</summary>

- ``changes/<PR#>.hst.rst``: HST reference files
- ``changes/<PR#>.jwst.rst``: JWST reference files
- ``changes/<PR#>.roman.rst``: Roman reference files
- ``changes/<PR#>.doc.rst``: documentation change
- ``changes/<PR#>.testing.rst``: change to tests or test automation
- ``changes/<PR#>.general.rst``: infrastructure or miscellaneous change
</details>

34 changes: 22 additions & 12 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: Changelog
name: changelog

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

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: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Grep for PR number in CHANGES.rst
run: grep -P '\[[^\]]*#${{github.event.number}}[,\]]' CHANGES.rst
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }}
- run: pip install .
- run: pip install towncrier
- run: towncrier check
- run: towncrier build --draft | grep -P '#${{ github.event.number }}'
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ jobs:
git config user.name "GitHub Actions"
git config user.email "<>"
- name: Set changelog release date
- uses: actions/setup-python@v5
with:
python-version: 3

- name: create new change log entry for release
run: |
release_scripts/set_release_date ${{ github.event.inputs.version }}
pip install towncrier
pip install .
towncrier check
towncrier build --yes --version ${{ inputs.version }}
- name: Commit changelog and tag release
run: |
git add CHANGES.rst
git commit -m "Set ${{ github.event.inputs.version }} release date"
git commit -m "created change log for ${{ inputs.version }}"
git push origin HEAD
git tag -a ${{ github.event.inputs.version }} -m "${{ github.event.inputs.description }}"
git push origin ${{ github.event.inputs.version }}
Expand Down
15 changes: 14 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
11.18.4 (unreleased)
12.0.0 (unreleased)
====================

General
-------

- Default context changed from "operational" to "latest". For JWST, the default context is the "build" context as determined by locally installed calibration software version. This can be overridden if CRDS_CONTEXT environment variable is explicitly set by user. [#1076]

- Setting environment variable `CRDS_CONTEXT=latest` automatically sets the effective context to the latest operational context found on the CRDS Server. [#1062]

- `client.api.get_default_context` by default returns build context for jwst, else latest. This can still be overridden by explicitly passing a value into optional arg `state`. [#1069]


11.18.4 (2024-09-10)
====================

General
-------

- Replaced deprecated SafeConfigParser with ConfigParser in crds.core.config [#1065]
- moved DMS requirement correlations with tests from ``@metrics_logger`` test decorators to ``test/dms_requirement_tests.json`` [#1064]


11.18.3 (2024-09-03)
====================

Expand Down
1 change: 1 addition & 0 deletions changes/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions changes/1068.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use ``towncrier`` to handle change log entries
2 changes: 1 addition & 1 deletion crds/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _get_crds_ini_parser():
"""Load and return the environment from the CRDS rc file."""
global CRDS_INI_PARSER
if CRDS_INI_PARSER is None:
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
with log.warn_on_exception("Failed reading CRDS rc file"):
ini_path = _get_crds_ini_path()
if os.path.exists(ini_path):
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,29 @@ markers = [

[tool.setuptools_scm]
write_to = "crds/_version.py"

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

[tool.towncrier.fragment.hst]
name = "HST"

[tool.towncrier.fragment.jwst]
name = "JWST"

[tool.towncrier.fragment.roman]
name = "ROMAN"

[tool.towncrier.fragment.doc]
name = "Documentation"

[tool.towncrier.fragment.testing]
name = "Testing / Automation"

[tool.towncrier.fragment.general]
42 changes: 0 additions & 42 deletions release_scripts/set_release_date

This file was deleted.

11 changes: 0 additions & 11 deletions test/certify/test_certify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pytest import mark, xfail
import numpy as np
import logging
from metrics_logger.decorators import metrics_logger
from crds.core import utils, log, exceptions
from crds import data_file, certify
from crds.certify import CertifyScript, generic_tpn, validators, mapping_parser
Expand Down Expand Up @@ -766,7 +765,6 @@ def test_certify_AsdfCertify_valid(jwst_serverless_state, jwst_data, caplog):

@mark.roman
@mark.certify
@metrics_logger("DMS4")
def test_certify_roman_valid_asdf(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a valid asdf file is recognized as such.
"""
Expand All @@ -779,7 +777,6 @@ def test_certify_roman_valid_asdf(roman_test_cache_state, roman_data, caplog):

@mark.roman
@mark.certify
@metrics_logger("DMS4")
def test_certify_roman_invalid_asdf_schema(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that an asdf file that does not conform to its schema definition
triggers an error in DataModels.
Expand All @@ -794,7 +791,6 @@ def test_certify_roman_invalid_asdf_schema(roman_test_cache_state, roman_data, c

@mark.roman
@mark.certify
@metrics_logger("DMS4")
def test_certify_roman_invalid_asdf_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that an asdf file that does not conform to its tpn definition
triggers an error in crds. Note: as the tpn often replicates schema implementation, this also
Expand All @@ -810,7 +806,6 @@ def test_certify_roman_invalid_asdf_tpn(roman_test_cache_state, roman_data, capl

@mark.roman
@mark.certify
@metrics_logger("DMS5")
def test_certify_roman_valid_spec_asdf(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a valid spectroscopic asdf file is recognized as such."""
with caplog.at_level(logging.INFO, logger="CRDS"):
Expand All @@ -822,7 +817,6 @@ def test_certify_roman_valid_spec_asdf(roman_test_cache_state, roman_data, caplo

@mark.roman
@mark.certify
@metrics_logger("DMS5")
def test_certify_roman_invalid_spec_asdf_schema(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a spectroscopic asdf file that does not conform to its schema
definition triggers an error in DataModels."""
Expand All @@ -836,7 +830,6 @@ def test_certify_roman_invalid_spec_asdf_schema(roman_test_cache_state, roman_da

@mark.roman
@mark.certify
@metrics_logger("DMS5")
def test_certify_roman_invalid_spec_asdf_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a spectroscopic asdf file that does not conform to its tpn
definition triggers an error in crds. Note: as the tpn often replicates schema implementation,
Expand Down Expand Up @@ -906,7 +899,6 @@ def test_certify_rmap_compare(jwst_serverless_state, caplog):

@mark.roman
@mark.certify
@metrics_logger("DMS6")
def test_certify_roman_rmap_compare(roman_test_cache_state, caplog):
"""Required Roman test: confirm that a calibration mapping file properly compares to its context."""
with caplog.at_level(logging.INFO, logger="CRDS"):
Expand Down Expand Up @@ -961,7 +953,6 @@ def test_certify_duplicate_rmap_case_error(hst_serverless_state, hst_data, caplo

@mark.roman
@mark.certify
@metrics_logger("DMS6")
def test_certify_roman_duplicate_rmap_case_error(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: verify that a calibration mapping file containing duplicate match cases
fails."""
Expand Down Expand Up @@ -994,7 +985,6 @@ def test_checksum_duplicate_rmap_case_error(hst_serverless_state, hst_data, capl

@mark.roman
@mark.certify
@metrics_logger("DMS6")
def test_checksum_roman_duplicate_rmap_case_error(roman_serverless_state, roman_data, caplog):
"""Required Roman test: verify that the crds rmap checksum update tool does not silently drop
duplicate rmap entries when updating the checksum and rewriting the file."""
Expand All @@ -1010,7 +1000,6 @@ def test_checksum_roman_duplicate_rmap_case_error(roman_serverless_state, roman_

@mark.roman
@mark.certify
@metrics_logger("DMS6")
def test_certify_roman_invalid_rmap_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: verify that a calibration mapping file that violates tpn rules produces an
error."""
Expand Down
35 changes: 35 additions & 0 deletions test/dms_requirement_tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"DMS4": [
"test.certify.test_certify.test_certify_roman_invalid_asdf_schema",
"test.certify.test_certify.test_certify_roman_invalid_asdf_tpn",
"test.certify.test_certify.test_certify_roman_valid_asdf"
],
"DMS5": [
"test.certify.test_certify.test_certify_roman_invalid_spec_asdf_schema",
"test.certify.test_certify.test_certify_roman_invalid_spec_asdf_tpn",
"test.certify.test_certify.test_certify_roman_valid_spec_asdf"
],
"DMS6": [
"test.certify.test_certify.test_certify_roman_duplicate_rmap_case_error",
"test.certify.test_certify.test_certify_roman_invalid_rmap_tpn",
"test.certify.test_certify.test_certify_roman_rmap_compare",
"test.certify.test_certify.test_checksum_roman_duplicate_rmap_case_error"
],
"DMS16": [
"test.roman.test_roman.test_getreferences_with_invalid_header",
"test.roman.test_roman.test_getreferences_with_valid_header_ISOT_fmt",
"test.roman.test_roman.test_getreferences_with_valid_header_ISO_fmt"
],
"DMS25": [
"test.roman.test_roman.test_getreferences_with_valid_header_ISOT_fmt",
"test.roman.test_roman.test_getreferences_with_valid_header_ISO_fmt",
"test.roman.test_roman.test_list_references"
],
"DMS26": [
"test.roman.test_roman.test_getreferences_with_valid_header_ISO_fmt",
"test.roman.test_roman.test_list_references"
],
"DMS114": [
"test.roman.test_roman.test_list_references"
]
}
5 changes: 0 additions & 5 deletions test/roman/test_roman.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import pathlib
from crds.core import heavy_client
from crds.core.exceptions import CrdsLookupError
from metrics_logger.decorators import metrics_logger


@mark.roman
@metrics_logger("DMS16", "DMS25")
def test_getreferences_with_valid_header_ISOT_fmt(roman_test_cache_state):
""" test_getreferences_with_valid_header: test satisfies Roman 303.1 and 628.1
"""
Expand All @@ -30,7 +28,6 @@ def test_getreferences_with_valid_header_ISOT_fmt(roman_test_cache_state):


@mark.roman
@metrics_logger("DMS16", "DMS25", "DMS26")
def test_getreferences_with_valid_header_ISO_fmt(roman_test_cache_state):
""" test_getreferences_with_valid_header: test satisfies Roman 303.1 and 628.1
"""
Expand Down Expand Up @@ -78,7 +75,6 @@ def test_getreferences_with_valid_header_ISO_fmt(roman_test_cache_state):


@mark.roman
@metrics_logger("DMS16")
def test_getreferences_with_invalid_header(roman_test_cache_state):
""" test_getreferences_with_invalid_header: test satisfies Roman 303.1
"""
Expand All @@ -101,7 +97,6 @@ def test_getreferences_with_invalid_header(roman_test_cache_state):


@mark.roman
@metrics_logger("DMS114", "DMS25", "DMS26")
def test_list_references(roman_test_cache_state):
""" test_list_references: test satisfies Roman 303.2 and 628.2
"""
Expand Down
Loading

0 comments on commit e754c51

Please sign in to comment.