Skip to content

Commit

Permalink
Merge pull request #343 from lsst-sqre/tickets/DM-47789
Browse files Browse the repository at this point in the history
DM-47789: Prepare 8.0.0 release
  • Loading branch information
rra authored Nov 26, 2024
2 parents 7866516 + 20bce3e commit 53a7dc6
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 43 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,35 @@ Changes for the upcoming release can be found in [changelog.d](https://github.co

<!-- scriv-insert-here -->

<a id='changelog-8.0.0'></a>
## 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.

<a id='changelog-7.0.0'></a>
## 7.0.0 (2024-11-08)

Expand Down
7 changes: 0 additions & 7 deletions changelog.d/20241112_163814_rra_DM_47262.md

This file was deleted.

8 changes: 0 additions & 8 deletions changelog.d/20241113_152723_rra_DM_47262a.md

This file was deleted.

7 changes: 0 additions & 7 deletions changelog.d/20241113_165421_rra_DM_47262b.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20241119_132629_danfuchs_fix_metrics_timedelta.md

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20241122_150037_rra_DM_47769a.md

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20241125_140320_rra_DM_47796.md

This file was deleted.

5 changes: 0 additions & 5 deletions changelog.d/20241126_175555_steliosvoutsinas_DM_47459.md

This file was deleted.

11 changes: 11 additions & 0 deletions ruff-shared.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 53a7dc6

Please sign in to comment.