Releases: lsst-sqre/safir
Releases · lsst-sqre/safir
11.0.0
Backwards-incompatible changes
- Change the
manage_kafka
flag tosafir.metrics.KafkaEventManager
tomanage_kafka_broker
. It now only controls whether the Kafka broker is started and stopped. The Kafka admin client is unconditionally managed (started and stopped) byKafkaEventManager
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
, andexclude_none
arguments toPydanticRedisStorage.store
. - Add
safir.testing.containers.FullKafkaContainer
andsafir.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 tosafir
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
New features
- Add additional parameters
max_overflow
,pool_size
, andpool_timeout
tosafir.database.create_database_engine
. These are passed to the SQLAlchemycreate_async_engine
function and can be used to tweak pool behavior. - Add additional parameters
connect_args
,max_overflow
,pool_size
, andpool_timeout
to theinitialize
method of the database session FastAPI dependency. These parameters are passed tocreate_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
New features
create_async_engine
now rewrites URLs with a scheme ofmysql
to usemysql+asyncmy
, similar to the existing rewrite ofpostgresql
topostgresql+asyncpg
.- Add an optional
connect_args
parameter tocreate_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 withPersistentVolumeClaim
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
Backwards-incompatible changes
- Safir now requires a minimum Python version of 3.12.
New features
- Add
number
field toGitHubCheckRunPrInfoModel
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
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
, notAsyncIterator
. In most situations this does not matter, butAsyncGenerator
has additional methods (such asaclose
) thatAsyncIterator
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
New features
-
Sentry instrumentation helpers
-
Allow the encryption key to be passed to
safir.redis.EncryptedPydanticRedisStorage
as apydantic.SecretStr
instead ofstr
. 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
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
New features
- Add new
CountedPaginatedQueryRunner
and a returnedCountedPaginatedList
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
9.0.0
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 toUWSAppSettings.build_uws_config
and implementto_xml_model
in their implementation ofParametersModel
, returning a subclass of the vo-modelsParameters
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 theuws_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 exceptionsafir.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