Skip to content

Releases: lsst-sqre/safir

9.1.1

18 Dec 23:44
@rra rra
9.1.1
6aceec4
Compare
Choose a tag to compare

Bug fixes

  • Unset the ssl.VERIFY_X509_STRICT flag in SSL contexts used for Kafka connections. Python 3.13 enables this flag by default, and the current certs that Strimzi generates for these Kafka endpoints are missing an Authority Key Identifier, which prevents connections when the flag is set.

What's Changed

  • DM-48199: Update comment for Sphinx Path exclusion by @rra in #360
  • DM-48214: Unset ssl.VERIFY_X509_STRICT flag on Kafka SSl contexts by @fajpunk in #361
  • DM-48199: Prepare 9.1.1 release by @rra in #362

Full Changelog: 9.1.0...9.1.1

9.1.0

18 Dec 00:22
@rra rra
9.1.0
f1715b5
Compare
Choose a tag to compare

New features

  • Add new CountedPaginatedQueryRunner and a returned CountedPaginatedList model for services that want paginated database queries that always do a second query for the total count of records without pagination.

Other changes

  • Safir is now tested with Python 3.13 as well as Python 3.12.

What's Changed

  • DM-48098: Add key usage to the Kafka test CA by @rra in #350
  • DM-48098: Add support for Python 3.13 by @rra in #354
  • DM-48173: Remove now-unneeded Black configuration by @rra in #355
  • DM-48173: Update metrics configuration documentation by @rra in #356
  • DM-48173: Add abstraction for counted paginated queries by @rra in #357
  • DM-48173: Stop using JobService where unnecessary by @rra in #358
  • DM-48173: Prepare 9.1.0 release by @rra in #359

Full Changelog: 9.0.1...9.1.0

9.0.1

12 Dec 01:27
@rra rra
9.0.1
6ffb0a8
Compare
Choose a tag to compare

Bug fixes

  • Fix dependencies on safir-logging and safir-arq from the safir PyPI module to allow the latest versions to be installed.

What's Changed

  • DM-47986: Fix dependency constraints on Safir modules by @rra in #352
  • DM-47986: Prepare 6.0.1 release by @rra in #353

Full Changelog: 9.0.0...9.0.1

9.0.0

12 Dec 00:27
@rra rra
9.0.0
1f1d889
Compare
Choose a tag to compare

Backwards-incompatible changes

  • Rewrite the Safir UWS support to use Pydantic models for job parameters. Services built on the Safir UWS library will need to change all job creation dependencies to return Pydantic models.
  • UWS clients must now pass an additional job_summary_type argument to UWSAppSettings.build_uws_config and implement to_xml_model in their implementation of ParametersModel, returning a subclass of the vo-models Parameters class.
  • Use the Wobbly service rather than a direct database connection to store UWS job information. Services built on the Safir UWS library must now configure a Wobbly URL and will switch to Wobbly's storage instead of their own when updated to this release of Safir.
  • Case-insensitivity of form POST parameters to UWS routes is now handled by middleware, and the uws_post_params_dependency function has been removed. Input parameter dependencies for UWS applications can now assume that all parameter keys will be in lowercase.
  • Support an execution duration of 0 in the Safir UWS library, mapping it to no limit on the execution duration. Note that this will not be allowed by the default configuration and must be explicitly allowed by an execution duration validation hook.
  • Convert all models returned by the Safir UWS library to Pydantic. Services built on the Safir UWS library will have to change the types of validator functions for destruction time and execution duration.
  • Safir no longer provides the safir.uws.ErrorCode enum or the exception safir.uws.MultiValuedParameterError. These values were specific to a SODA service, and different IVOA UWS services use different error codes. The Safir UWS library now takes error code as a string, and each application should define its own set of error codes in accordance with the IVOA standard it is implementing.

New features

  • Add unit testing support for application metrics. Tests can define a mock application metrics event handler and inspect it after running application code to see what events would have been published.

Bug fixes

  • Append a colon after the error code when reporting UWS errors.

Other changes

  • Render all UWS XML output except for error VOTables using vo-models rather than hand-written XML templates.

What's Changed

  • DM-47769: Fix pagination example by @rra in #344
  • DM-47769: Add documentation of CaseInsensitiveFormMiddleware by @rra in #345
  • DM-47928: Use case-insensitive form middleware for UWS support by @rra in #346
  • DM-47790: Switch to vo-models for nearly all UWS responses by @rra in #347
  • DM-47764: App metrics unit testing helpers by @fajpunk in #348
  • DM-47986: Convert the UWS library to use the Wobbly backend by @rra in #349
  • DM-47986: Prepare 9.0.0 release by @rra in #351

Full Changelog: 8.0.0...9.0.0

8.0.0

26 Nov 22:48
@rra rra
8.0.0
53a7dc6
Compare
Choose a tag to compare

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.

What's Changed

  • Fix two small typos by @rra in #323
  • DM-47262: Fix Alembic documentation by @rra in #322
  • DM-47262: Minor documentation fixes by @rra in #324
  • DM-47262: Add serializers for *Timedelta types by @rra in #325
  • DM-47262: Document testing Alembic config against schema by @rra in #327
  • DM-47262: Fix IVOA DALI timestamp parsing, add data types by @rra in #326
  • timedelta can now be used a member of a union field in an EventPayload by @fajpunk in #329
  • DM-47581: Add generic paginated query support by @rra in #330
  • DM-47721: Improved schema manager logging by @fajpunk in #331
  • DM-47771: metrics: don't wait for kafka messages to be delivered by @fajpunk in #333
  • DM-47769: Remove obsolete SQLAlchemy future flags by @rra in #335
  • DM-47769: Do not do COUNT queries for pagination by default by @rra in #332
  • DM-47769: Add LinkData model for parsing HTTP Link headers by @rra in #334
  • DM-47789: Update pre-commit dependencies by @rra in #336
  • DM-47796: Add alembic dependency to uws extra by @rra in #337
  • DM-47789: Reword change log for 7.0.0 by @rra in #338
  • DM-47789: Fix various issues with pagination support by @rra in #339
  • DM-47459: Added middleware for converting form post params to lowercase by @stvoutsin in #340
  • DM-47789: Make pagination docs friendlier to subclasses by @rra in #341
  • DM-47789: Qualify more types in pagination docstrings by @rra in #342
  • DM-47789: Prepare 8.0.0 release by @rra in #343

Full Changelog: 7.0.0...8.0.0

7.0.0

08 Nov 20:36
7.0.0
7f5bb50
Compare
Choose a tag to compare

Backwards-incompatible changes

  • Remove EventDuration from safir.metrics. Instead, use Python's built-in timedelta as the type for any field that previously used EventDuration. It will be serialized the same way, as an Avro double number of seconds.

Bug fixes

  • Support multi-valued parameters as input to UWS POST routes when the values are specified by repeating the parameter.
  • Declare that the safir.metrics package is typed by adding a py.typed file.

What's Changed

  • DM-47011: Update pre-commit dependencies by @rra in #316
  • DM-47027: Change ws_post_params_dependency to handle multiple occurrences of the same param by @stvoutsin in #317
  • Fix PydanticRedisStorage documentation by @rra in #318
  • DM-45522 metrics: native timedelta support by @fajpunk in #319
  • DM-45522: Add py.typed to metrics package by @fajpunk in #320
  • DM-45522: Prepare 7.0.0 release by @fajpunk in #321

New Contributors

Full Changelog: 6.5.1...7.0.0

6.5.1

21 Oct 19:20
@rra rra
6.5.1
53396b0
Compare
Choose a tag to compare

Bug fixes

  • Allow and ignore extra attributes to MetricsConfiguration when metrics are disabled. This allows passing a partial metrics configuration even when they are disabled, which simplifies the structure of Phalanx configurations based on dumping the Helm values into a YAML configuraiton file.

What's Changed

  • DM-47011: Allow extra values to disabled metrics config by @rra in #314
  • DM-47011: Prepare 6.5.1 release by @rra in #315

Full Changelog: 6.5.0...6.5.1

6.5.0

18 Oct 21:59
@rra rra
6.5.0
b4f803c
Compare
Choose a tag to compare

New features

  • Add new safir.kafka module to simplify configuring and constructing Kafka clients. Included in this module is safir.kafka.PydanticSchemaManager, which supports registering and evolving Avro schemas in the Confluent schema registry via Pydantic models. Based on @jonathansick's kafkit work.
  • Add new safir.metrics module to enable publishing app metrics events.

Bug fixes

  • Fix integration issues with vo-models in the UWS support.

What's Changed

  • DM-45522: Kafka connection helpers by @fajpunk in #302
  • DM-45522: PydanticSchemaManager for confluent schema registry interactions by @fajpunk in #303
  • DM-44365: vo-models integration fixes by @fajpunk in #305
  • DM-45522: Metrics Events by @fajpunk in #304
  • DM-45522: Allow unions of simple types in metrics events payloads by @fajpunk in #307
  • DM-45522 metrics: don't lose schema metadata by @fajpunk in #309
  • DM-46821: Allow camel-case for Kafka and events configuration by @rra in #308
  • DM-45522: Use timedeltas in event payloads by @fajpunk in #310
  • DM-46821: Refactor metrics configuration by @rra in #311
  • DM-46821: Move warning suppression to an annotation by @rra in #312
  • DM-46821: Prepare 6.5.0 release by @rra in #313

Full Changelog: 6.4.0...6.5.0

6.4.0

16 Sep 20:35
@rra rra
6.4.0
f0330dc
Compare
Choose a tag to compare

New features

  • Add support functions for using Alembic to manage database schema migrations and to verify that the current database schema matches the expectations of the running application. The support in Safir is designed to use asyncpg for all database operations, which avoids having to add a separate dependency on a sync database client.
  • Add Alembic schema management support to the UWS library. This support is likely temporary and will probably be replaced in the future with a standalone UWS database service.

What's Changed

  • DM-46034: Remove now-unnecessary type: ignore markers by @rra in #295
  • DM-46034: Add new pytest-asyncio configuration by @rra in #296
  • DM-46034: Reorganize database documentation by @rra in #294
  • DM-46034: Reorganize UWS database schema by @rra in #297
  • DM-46034: Fix nox init and venv-init sessions by @rra in #298
  • DM-46034: Remove remaining declarative_base references by @rra in #300
  • DM-46034: Add support functions for Alembic by @rra in #299
  • DM-46034: Prepare 6.4.0 release by @rra in #301

Full Changelog: 6.3.0...6.4.0

6.3.0

20 Aug 21:58
@rra rra
6.3.0
1f77fd9
Compare
Choose a tag to compare

New features

  • safir.logging is now available as a separate PyPI package, safir-logging, so that it can be installed in environments where the full Safir dependency may be too heavy-weight or conflict with other packages. Packages that do depend on safir can and should ignore this change and continue to assume depending on safir will be sufficient to provide safir.logging.
  • Allow the database URL passed to DatabaseSessionDependency.initialize to be a Pydantic Url. This simplifies logic for applications that use EnvAsyncPostgresDsn or other Pydantic URL types for their configuration.
  • Allow the hook URL argument to safir.testing.slack.mock_slack_webhook to be a Pydantic SecretStr.

Bug fixes

  • safir.logging previously exported a logger_name variable holding the logger name configured via safir.logging.configure_logging. This variable was never documented and was not intended for use outside of the library. It is no longer exported, has been renamed, and is now private to the library.
  • Fix construction of an Availability object reporting problems with the UWS database layer to use the correct field names and data type for the model.

What's Changed

  • DM-45575: Restructure code to move it out of __init__.py files by @rra in #283
  • DM-45779: Allow a Url for database session initialization by @rra in #284
  • DM-45779: Allow mock_slack_webhook to take SecretStr by @rra in #285
  • DM-45794: Update to the current shared Ruff configuration by @rra in #286
  • DM-45818: Fix UWS Availability during errors by @rra in #287
  • DM-45824: Update to the latest Ruff by @rra in #289
  • DM-45824: Split safir.logging into a separate PyPI package by @rra in #288
  • DM-45824: Cap dependency on safir-logging by @rra in #290
  • DM-45824: Document logging in Safir UWS workers by @rra in #292
  • DM-45824: Prepare 6.3.0 release by @rra in #291
  • DM-45824: Fix release date for 6.3.0 by @rra in #293

Full Changelog: 6.2.0...6.3.0