Skip to content

Commit

Permalink
Merge pull request #224 from lsst-sqre/tickets/DM-41998
Browse files Browse the repository at this point in the history
DM-41998: Prepare 5.0.0 release
  • Loading branch information
rra authored Dec 5, 2023
2 parents e74c3aa + b4e16d8 commit d35831d
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 37 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ Changes for the upcoming release can be found in [changelog.d](https://github.co

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

<a id='changelog-5.0.0'></a>
## 5.0.0 (2023-12-05)

### Backwards-incompatible changes

- Safir now depends on Pydantic v2. Python code that uses any part of Safir related to Pydantic will also need to update to Pydantic v2, since the API is significantly different. See the [Pydantic migration guide](https://docs.pydantic.dev/latest/migration/) for more information.
- `safir.pydantic.validate_exactly_one_of` is now a Pydantic model validator. It must be called with `mode="after"`, since it operates in the model rather than on a raw dictionary.
- Remove the `GitHubAppClientFactory.create_app_client` method, which does not work with the Gidgethub API. Instead, the documentation shows how to create a JWT with the `GitHubAppClientFactory` and pass it with requests.
- `safir.github.GitHubAppClientFactory` now expects the application ID and installation ID (for `create_installation_client`) to be of type `int`, not `str`. This appears to match what GitHub's API returns, but not what Gidgethub expects. The ID is converted to a string when passing it to Gidgethub.

### New features

- Allow the `safir.logging.LogLevel` enum to be created from strings of any case, which will allow the logging level to be specified with any case for Safir applications that use Pydantic to validate the field.
- Add validated but ignored optional `propagation_policy` arguments to every delete method of the Kubernetes mock for better compatibility with the actual Kubernetes API. Previously, this argument was only accepted by `delete_namespaced_job`.
- All mock Kubernetes methods now accept and ignore a `_request_timeout` error for better compatibility with the Kubernetes API.
- Add delete, list, and watch support for persistent volume claims to the Kubernetes mock.

### Bug fixes

- `safir.database.datetime_to_db`, `safir.datetime.format_datetime_for_logging`, and `safir.datetime.isodatetime` now accept any `datetime` object with a time zone whose offset from UTC is 0, rather than only the `datetime.UTC` time zone object.
- `safir.pydantic.normalize_datetime` now explicitly rejects input other than seconds since epoch or datetime objects with a validation error rather than attempting to treat the input as a datetime object and potentially throwing more obscure errors.
- The `_request_timeout` parameters to mock Kubernetes methods now accept a float instead of an int to more correctly match the types of kubernetes_asyncio. The mock still does not accept a tuple of timeouts.
- Avoid reusing the same metadata object when creating a `Pod` from a `Job`. Previous versions modified the `spec` part of the `Job` when adding additional metadata to the child `Pod`.

### Other changes

- Safir is now tested with Python 3.12 as well as Python 3.11.

<a id='changelog-4.5.0'></a>
## 4.5.0 (2023-09-12)

Expand Down
4 changes: 0 additions & 4 deletions changelog.d/20230911_180355_rra_DM_40744.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20230914_153856_rra_DM_40744.md

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20230918_114322_rra_DM_40744.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20230918_134911_rra_DM_40744.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231003_135049_rra_DM_23878.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231110_124506_rra_DM_41630.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231110_141912_rra_DM_41630.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231110_165902_rra_DM_41630b.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231114_171851_rra_DM_41708a.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231116_110515_rra_DM_41708a.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20231205_093902_rra_DM_41998.md

This file was deleted.

0 comments on commit d35831d

Please sign in to comment.