Skip to content

Releases: lsst-sqre/safir

11.0.0

28 May 19:47
@rra rra
11.0.0
b9365f7
Compare
Choose a tag to compare

Backwards-incompatible changes

  • Change the manage_kafka flag to safir.metrics.KafkaEventManager to manage_kafka_broker. It now only controls whether the Kafka broker is started and stopped. The Kafka admin client is unconditionally managed (started and stopped) by KafkaEventManager and should not be shared with any other application use.

New features

  • Allow an application to pass an existing FastStream Kafka broker into safir.metrics.BaseMetricsConfiguration.make_manager. This simplifies metrics integration for Kafka applications with existing brokers, without requiring manual manager construction and losing the auto-selection of the no-op and mock event managers.
  • Support the standard Pydantic exclude_unset, exclude_defaults, and exclude_none arguments to PydanticRedisStorage.store.
  • Add safir.testing.containers.FullKafkaContainer and safir.testing.containers.SchemaRegistryContainer classes based on Testcontainers that create containers for Kafka and the Confluent schema registry, respectively. These classes are intended for use in fixtures or test configuration to enable testing against a local temporary Kafka cluster.
  • Add safir.testing.logging.parse_log_tuples utility function to aid in testing structured log messages from applications using the Safir logging framework.

Other changes

  • safir.testing is now an implicit namespace package similar to safir so that safir-logging can provide a testing module. This should hopefully not cause any user-observable changes.

What's Changed

  • Update for Click 8.2.0 by @rra in #398
  • Update redis requirement from <6,>4.5.2 to >4.5.2,<7 in /safir by @dependabot in #397
  • Update cryptography requirement from <45 to <46 in /safir by @dependabot in #396
  • DM-50964: Force arq 0.26 or later by @rra in #400
  • DM-50964: Allow passing Kafka clients to make_manager by @rra in #399
  • DM-50964: Support serialization options for Redis storage by @rra in #401
  • DM-50964: Add testcontainers support for Kafka by @rra in #402
  • Increase docs job timeout to 15 minutes by @jonathansick in #404
  • Adjust for changes in dependencies by @rra in #405
  • Update sample Alembic configuration by @rra in #406
  • DM-50964: Add parse_log_tuples for structlog testing by @rra in #407
  • DM-50964: Always manage the admin client in EventManager by @rra in #403
  • DM-50964: Prepare 11.0.0 release by @rra in #408

Full Changelog: 10.2.0...11.0.0

10.2.0

05 May 22:50
@rra rra
10.2.0
6a6583f
Compare
Choose a tag to compare

New features

  • Add additional parameters max_overflow, pool_size, and pool_timeout to safir.database.create_database_engine. These are passed to the SQLAlchemy create_async_engine function and can be used to tweak pool behavior.
  • Add additional parameters connect_args, max_overflow, pool_size, and pool_timeout to the initialize method of the database session FastAPI dependency. These parameters are passed to create_database_engine when creating the underlying engine.

What's Changed

  • DM-50527: Allow configuration of database pool size by @rra in #394
  • DM-50527: Prepare 10.2.0 release by @rra in #395

Full Changelog: 10.1.0...10.2.0

10.1.0

23 Apr 19:19
@rra rra
10.1.0
1c49918
Compare
Choose a tag to compare

New features

  • create_async_engine now rewrites URLs with a scheme of mysql to use mysql+asyncmy, similar to the existing rewrite of postgresql to postgresql+asyncpg.
  • Add an optional connect_args parameter to create_async_engine that can be used to pass parameters directly to the underlying database driver. This may be used to, for example, configure TLS settings.
  • Add create, delete, read, and list (with watches) support for PersistentVolume objects to the mock Kubernetes API. These are not integrated with PersistentVolumeClaim objects; the user of the mock must create them separately.

What's Changed

  • DM-49503: Update pre-commit dependencies by @rra in #390
  • DM-49735: Update license metadata and PyPI publish action by @rra in #391
  • Add PersistentVolume support to kubernetes mock by @athornton in #389
  • DM-50095: Add asyncmy and connect_args support for databases by @rra in #392
  • DM-50095: Prepare 10.1.0 release by @rra in #393

Full Changelog: 10.0.0...10.1.0

10.0.0

25 Feb 01:57
d112347
Compare
Choose a tag to compare

Backwards-incompatible changes

  • Safir now requires a minimum Python version of 3.12.

New features

  • Add number field to GitHubCheckRunPrInfoModel to capture the pull request number in GitHub check events.

What's Changed

  • DM-49036: Increase minimum Python version to 3.12 by @rra in #384
  • DM-48838: Add explicit override decorators by @rra in #377
  • DM-49036: Switch to new syntax for generics by @rra in #385
  • DM-49036: Use type instead of TypeAlias by @rra in #386
  • DM-49117: Add number to GitHubCheckRunPrInfoModel by @fajpunk in #387
  • Prepare 10.0.0 release by @fajpunk in #388

Full Changelog: 9.3.0...10.0.0

9.3.0

12 Feb 00:24
@rra rra
9.3.0
a872ee4
Compare
Choose a tag to compare

New features

  • Add new register_create_hook_for_test method on the mock Kubernetes API that allows the caller to register a callback that is called whenever an object of a given kind is created.
  • Add create, delete, read, and list (with watches) support for ServiceAccount objects to the mock Kubernetes API.

Bug fixes

  • Declare Safir functions returning async generators with a return type of AsyncGenerator, not AsyncIterator. In most situations this does not matter, but AsyncGenerator has additional methods (such as aclose) that AsyncIterator does not have and is therefore more correct.

What's Changed

  • Update google-cloud-storage requirement from <3 to <4 in /safir by @dependabot in #369
  • DM-48760: Simplify if underlying exception has no message by @rra in #370
  • DM-48819: Use AsyncGenerator over AsyncIterator by @rra in #371
  • DM-48838: Add ServiceAccount to Kubernetes mock by @rra in #372
  • Remove TypeAlias in retry_async_transaction by @rra in #373
  • DM-48838: Add object creation callbacks to Kubernetes mock by @rra in #374
  • DM-48838: Switch to StrEnum by @rra in #375
  • DM-48838: Convert more enums to StrEnum by @rra in #376
  • DM:48838: Add all to safir.sentry._exceptions by @rra in #378
  • DM-48838: Use current_datetime in fewer places by @rra in #379
  • DM-48838: Move model_config to the start of classes by @rra in #380
  • DM-48838: Minor editing of the Sentry documentation by @rra in #381
  • DM-48838: Avoid sqlalchemy.future by @rra in #382
  • DM-48838: Prepare 6.3.0 release by @rra in #383

Full Changelog: 9.2.0...9.3.0

9.2.0

22 Jan 17:14
9.2.0
fa31cad
Compare
Choose a tag to compare

New features

  • Sentry instrumentation helpers

  • Allow the encryption key to be passed to safir.redis.EncryptedPydanticRedisStorage as a pydantic.SecretStr instead of str. This allows easier integration with secrets that come from Pydantic-parsed settings.

What's Changed

  • Update pre-commit dependencies by @rra in #364
  • Update kubernetes-asyncio requirement from <32 to <33 in /safir by @dependabot in #363
  • DM-48408: Fix documentation of database initialization by @rra in #365
  • DM-48101: Sentry helpers by @fajpunk in #366
  • DM-48495: Allow SecretStr for EncryptedPydanticRedisStorage by @rra in #367
  • Prepare 9.2.0 release by @fajpunk in #368

Full Changelog: 9.1.1...9.2.0

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