From 20bce3ea8232f0dedb057bf40a3e683a83b48adf Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 26 Nov 2024 14:40:54 -0800 Subject: [PATCH] Prepare 8.0.0 release Collect the change log for the 8.0.0 release and update the shared Ruff configuration file. --- CHANGELOG.md | 29 +++++++++++++++++++ changelog.d/20241112_163814_rra_DM_47262.md | 7 ----- changelog.d/20241113_152723_rra_DM_47262a.md | 8 ----- changelog.d/20241113_165421_rra_DM_47262b.md | 7 ----- ...9_132629_danfuchs_fix_metrics_timedelta.md | 3 -- ...39_danfuchs_event_manager_test_failures.md | 4 --- changelog.d/20241122_150037_rra_DM_47769a.md | 3 -- ...744_danfuchs_metrics_publishing_is_slow.md | 3 -- changelog.d/20241125_140320_rra_DM_47796.md | 3 -- ...241126_175555_steliosvoutsinas_DM_47459.md | 5 ---- ruff-shared.toml | 11 +++++++ 11 files changed, 40 insertions(+), 43 deletions(-) delete mode 100644 changelog.d/20241112_163814_rra_DM_47262.md delete mode 100644 changelog.d/20241113_152723_rra_DM_47262a.md delete mode 100644 changelog.d/20241113_165421_rra_DM_47262b.md delete mode 100644 changelog.d/20241119_132629_danfuchs_fix_metrics_timedelta.md delete mode 100644 changelog.d/20241120_161839_danfuchs_event_manager_test_failures.md delete mode 100644 changelog.d/20241122_150037_rra_DM_47769a.md delete mode 100644 changelog.d/20241122_164744_danfuchs_metrics_publishing_is_slow.md delete mode 100644 changelog.d/20241125_140320_rra_DM_47796.md delete mode 100644 changelog.d/20241126_175555_steliosvoutsinas_DM_47459.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 3003ae00..d11d1bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,35 @@ Changes for the upcoming release can be found in [changelog.d](https://github.co + +## 8.0.0 (2024-11-26) + +### Backwards-incompatible changes + +- Add serializers to `HumanTimedelta` and `SecondsTimedelta` that serialize those Pydantic fields to a float number of seconds instead of ISO 8601 durations. This means those data types now can be round-tripped (serialized and then deserialized to the original value), whereas before they could not be. +- `parse_isodatetime` and `normalize_isodatetime` now accept exactly the date formats accepted by the IVOA DALI standard. This means seconds are now required, the trailing `Z` is now optional (times are always interpreted as UTC regardless), and the time is optional and interpreted as 00:00:00 if missing. + +### New features + +- Add new `safir.pydantic.UtcDatetime` type that is equivalent to `datetime` but coerces all incoming times to timezone-aware UTC. This type should be used instead of using `normalize_datetime` as a validator. +- Add new `safir.pydantic.IvoaIsoDatetime` type that accepts any ISO 8601 date and time that matches the IVOA DALI standard for timestamps. This follows the same rules as `parse_isodatetime` now follows. This type should be used instead of using `normalize_isodatetime` as a validator. +- Add new `safir.database.PaginatedLinkData` model that parses the contents of an HTTP `Link` header and extracts pagination information. +- Add `safir.database.drop_database` utility function to drop all database tables mentioned in a SQLAlchemy ORM schema and delete the Alembic version information if it is present. This is primarily useful for tests. +- Publishing a metrics event no longer waits on confirmation of message delivery to Kafka. This makes publishing much more performant. All events will still be delivered as long as an app awaits `EventManager.aclose` in its lifecycle. +- `safir.kafka.PydanticSchemaManager` takes an optional structlog `BoundLogger`. If not provided, the default logger is a `BoundLogger`, rather than a `logging.Logger`. +- Pass the `logger` parameter to `safir.metrics.KafkaMetricsConfiguration.make_manager` to the `PydanticSchemaManager` instance that it creates. +- Add `CaseInsensitiveFormMiddleware` to lower-case the keys of form `POST` parameters. This can be used to support the case-insensitive keys requirement of IVOA standards. + +### Bug fixes + +- Correctly validate stringified floating-point numbers of seconds as inputs to the `SecondsTimedelta` type instead of truncating it to an integer. +- Allow `timedelta` as a member of a union field in a `safir.metrics.EventPayload`. +- Add missing dependency on alembic to the `safir[uws]` extra. + +### Other changes + +- Document how to test an application's database schema against its Alembic migrations to ensure that the schema hasn't been modified without adding a corresponding migration. + ## 7.0.0 (2024-11-08) diff --git a/changelog.d/20241112_163814_rra_DM_47262.md b/changelog.d/20241112_163814_rra_DM_47262.md deleted file mode 100644 index db5d5d53..00000000 --- a/changelog.d/20241112_163814_rra_DM_47262.md +++ /dev/null @@ -1,7 +0,0 @@ -### Backwards-incompatible changes - -- Add serializers to `HumanTimedelta` and `SecondsTimedelta` that serialize those Pydantic fields to a float number of seconds instead of ISO 8601 durations. This means those data types now can be round-tripped (serialized and then deserialized to the original value), whereas before they could not be. - -### Bug fixes - -- `SecondsTimedelta` now correctly validates an input stringified floating-point number of seconds instead of truncating it to an integer. diff --git a/changelog.d/20241113_152723_rra_DM_47262a.md b/changelog.d/20241113_152723_rra_DM_47262a.md deleted file mode 100644 index c8ad1db1..00000000 --- a/changelog.d/20241113_152723_rra_DM_47262a.md +++ /dev/null @@ -1,8 +0,0 @@ -### Backwards-incompatible changes - -- `parse_isodatetime` and `normalize_isodatetime` now accept exactly the date formats accepted by the IVOA DALI standard. This means seconds are now required, the trailing `Z` is now optional (times are always interpreted as UTC regardless), and the time is optional and interpreted as 00:00:00 if missing. - -### New features - -- Add new `safir.pydantic.UtcDatetime` type that is equivalent to `datetime` but coerces all incoming times to timezone-aware UTC. This type should be used instead of using `normalize_datetime` as a validator. -- Add new `safir.pydantic.IvoaIsoDatetime` type that accepts any ISO 8601 date and time that matches the IVOA DALI standard for timestamps. This follows the same rules as `parse_isodatetime` now follows. This type should be used instead of using `normalize_isodatetime` as a validator. diff --git a/changelog.d/20241113_165421_rra_DM_47262b.md b/changelog.d/20241113_165421_rra_DM_47262b.md deleted file mode 100644 index d5d67c0a..00000000 --- a/changelog.d/20241113_165421_rra_DM_47262b.md +++ /dev/null @@ -1,7 +0,0 @@ -### New features - -- Add `safir.database.drop_database` utility function to drop all database tables mentioned in a SQLAlchemy ORM schema and delete the Alembic version information if it is present. This is primarily useful for tests. - -### Other changes - -- Document how to test an application's database schema against its Alembic migrations to ensure that the schema hasn't been modified without adding a corresponding migration. diff --git a/changelog.d/20241119_132629_danfuchs_fix_metrics_timedelta.md b/changelog.d/20241119_132629_danfuchs_fix_metrics_timedelta.md deleted file mode 100644 index d3958abc..00000000 --- a/changelog.d/20241119_132629_danfuchs_fix_metrics_timedelta.md +++ /dev/null @@ -1,3 +0,0 @@ -### Bug fixes - -- `timedelta` can now be a member of a union field in a `safir.metrics.EventPayload` diff --git a/changelog.d/20241120_161839_danfuchs_event_manager_test_failures.md b/changelog.d/20241120_161839_danfuchs_event_manager_test_failures.md deleted file mode 100644 index 0acaa8c7..00000000 --- a/changelog.d/20241120_161839_danfuchs_event_manager_test_failures.md +++ /dev/null @@ -1,4 +0,0 @@ -### New features - -- `safir.kafka.PydanticSchemaManager` takes an optional structlog `BoundLogger`. If not provided, the default logger is a `BoundLogger`, rather than a `logging.Logger`. -- `logger` value to `safir.metrics.KafkaMetricsConfiguration.make_manager` is passed through to the `PydanticSchemaManager` instance that it creates. diff --git a/changelog.d/20241122_150037_rra_DM_47769a.md b/changelog.d/20241122_150037_rra_DM_47769a.md deleted file mode 100644 index c07f42f0..00000000 --- a/changelog.d/20241122_150037_rra_DM_47769a.md +++ /dev/null @@ -1,3 +0,0 @@ -### New features - -- Add new `safir.database.PaginatedLinkData` model that parses the contents of an HTTP `Link` header and extracts pagination information. diff --git a/changelog.d/20241122_164744_danfuchs_metrics_publishing_is_slow.md b/changelog.d/20241122_164744_danfuchs_metrics_publishing_is_slow.md deleted file mode 100644 index 317e32de..00000000 --- a/changelog.d/20241122_164744_danfuchs_metrics_publishing_is_slow.md +++ /dev/null @@ -1,3 +0,0 @@ -### New features - -- Publishing a metrics event no longer waits on confirmation of message delivery to Kafka. This makes publishing much more performant. All events will still be delivered as long as an app awaits `EventManager.aclose` in its lifecycle. diff --git a/changelog.d/20241125_140320_rra_DM_47796.md b/changelog.d/20241125_140320_rra_DM_47796.md deleted file mode 100644 index 56a932b1..00000000 --- a/changelog.d/20241125_140320_rra_DM_47796.md +++ /dev/null @@ -1,3 +0,0 @@ -### Bug fixes - -- Add missing dependency on alembic to the `safir[uws]` extra. diff --git a/changelog.d/20241126_175555_steliosvoutsinas_DM_47459.md b/changelog.d/20241126_175555_steliosvoutsinas_DM_47459.md deleted file mode 100644 index 24d5d613..00000000 --- a/changelog.d/20241126_175555_steliosvoutsinas_DM_47459.md +++ /dev/null @@ -1,5 +0,0 @@ - - -### New features - -- Added CaseInsensitiveFormMiddleware to lowercase handle form post params for VO services diff --git a/ruff-shared.toml b/ruff-shared.toml index 6450f603..8b0e8d07 100644 --- a/ruff-shared.toml +++ b/ruff-shared.toml @@ -87,6 +87,11 @@ ignore = [ select = ["ALL"] [lint.per-file-ignores] +"alembic/**" = [ + "INP001", # Alembic files are magical + "D103", # Alembic methods do not need docstrings + "D400", # Alembic migrations have their own docstring format +] "noxfile.py" = [ "T201", # print makes sense as output from nox rules ] @@ -118,6 +123,12 @@ select = ["ALL"] "S301", # allow tests for whether code can be pickled "SLF001", # tests are allowed to access private members ] +"tests/schema_test.py" = [ + "ASYNC221", # useful to run subprocess in async tests for Alembic +] +"*/tests/schema_test.py" = [ + "ASYNC221", # useful to run subprocess in async tests for Alembic +] # These are too useful as attributes or methods to allow the conflict with the # built-in to rule out their use.