Releases: lsst-sqre/squarebot
0.9.0
Backwards-incompatible changes
SquarebotSlackMessageValue
no longer includes abot_id
field. Instead, theuser
field is set to the bot's ID and a newis_bot
field indicates if theuser
field is a bot or user ID.
New features
-
Add support for Slack messages with
subtype
ofbot_message
. This is implemented in the Slack message modelSlackMessageEventContent
as a newsubtype
field that now takes aSlackMessageSubtype
enum. The Kafka representation of this message,SquarebotSlackMessageValue
has been updated to now set theuser
attribute to either the user's ID or the bot's ID as appropriate. A new flag,is_bot
indicates if theuser
field reflects a user or bot (app integration) identifier. -
SlackMessageEventContent
, a part of theSlackkMessageEvent
model, now has support forattachments
. Slack attachments are deprecated for Block Kit, but are still widely used by app integrations. Theattachments
field is a list ofSlackMessageAttachment
objects. These attachments can have text content or individual fields that have titles and values. -
The
SquarebotSlackMessageValue
Kafka message model'stext
field now includes the combined content of the message and its attachments. This makes it easy for consumers to process message content without needing to check for attachments and Block Kit fields. For consumers that are sensitive to the exact structure of the message, theslack_event
field is still available, which is the original JSON representation of the Slack message, which can be parsed into aSlackMessageEvent
object.
Other changes
-
Adopt
ruff-shared.toml
from https://github.com/lsst/templates -
The noxfile now uses
uv
as the backend for pip and pip-compile tasks. -
Added a new weekly GitHub Actions CI workflow to validate that the app will run with future versions of dependencies.
What's Changed
- DM-45383: Add bot_message support for Slack messages by @jonathansick in #29
Full Changelog: 0.8.0...0.9.0
0.8.0
Backwards-incompatible changes
-
Squarebot now publishes messages in JSON, rather than Avro. Consumers should use the Pydantic models published in the
rubin-squarebot
PyPI package to deserialize messages. -
The
rubin-squarebot
PyPI package now uses therubin.squarebot
Python namespace (previouslyrubinobs.square.squarebot
). Consumers should use therubin.squarebot.models.kafka.SquarebotSlackMessageValue
Pydantic model to deserialize Squarebot messages for Slack channel message traffic (orrubin.squarebot.models.kafka.SquarebotSlackMessageValue
for the app mention topic). -
The codebase now uses Pydantic 2.
New features
-
Squarebot now uses FastStream to publish messages. This approach drops the Confluent Schema Registry integration because messages are now published in JSON from Pydantic models, and those Pydantic models are versioned and published through the
rubin-squarebot
PyPI package. -
New fields in the
SquarebotSlackMessageValue
Pydantic model:thread_ts
, useful for identify a threaded message and replying to its thread.bot_id
, the ID of the bot that sent the message (if applicable). This is useful for identifying bot messages and ignoring them in some cases.
Bug fixes
-
Fix type annotations related in
channel_type
inrubin.squarebot.models.kafka.SquarebotSlackMessageValue
. We now assure that the channel type is not Null here. However thechannel_type
field is now set to null/None in theSquarebotSlackAppMentionValue
model. -
Fixed the
nox -s init
command so that it will install into the current Python environment (previously it still installing into the environment managed bynox
).
Other changes
-
A Redoc-based OpenAPI documentation page for the REST API is now included in the Sphinx documentation.
-
Switched to nox for running tests and repository tasks. Nox now replaces the two tox configurations for the client and server. Nox also replaces the
Makefile
for repository tasks:nox -s venv-init
initializes a Python venv virtual environment and installs the application into it. Alternatively,nox -s init
can be used to initialize the application in the current Python environment (likemake init
).nox -s update-deps
updates the pinned dependencies as well as the pre-commit hooks (replacingmake update-deps
).
-
New nox integration with scriv for change log management:
nox -s scriv-create
creates a change log fragment andnox -s scriv-collect X.Y.Z
collects change log fragments into CHANGELOG.md for a release. -
Adopt the lsst-sqre/build-and-push-to-ghcr@v1 action.
-
Tests require a local Kafka broker. The easiest way to run a Kafka broker is with Docker Compose and the
kafka-compose.yaml
configuration file in this repository. The Docker compose set up also deploys Kafdrop so you can view the messages produced during testing. -
The codebase is now linted and formatted with Ruff.
What's Changed
- DM-37525: Include redoc page in the documentation by @jonathansick in #18
- DM-39621: Adopt nox for running tasks in the monorepo by @jonathansick in #19
- Fix instructions for update-deps nox session by @jonathansick in #21
- Fix nox -s init command by @jonathansick in #22
- DM-35490: Adopt lsst-sqre/build-and-push-to-ghcr@v1 by @jonathansick in #23
- Bump python from 3.11.3-slim-bullseye to 3.11.4-slim-bullseye by @dependabot in #20
- DM-42875: Adopt faststream for Kafka producer by @jonathansick in #28
New Contributors
- @dependabot made their first contribution in #20
Full Changelog: 0.7.0...0.8.0
0.7.0
Backwards-incompatible changes
- sqrbot-jr is now Squarebot. It's docker image is now published at
ghcr.io/lsst-sqre/squarebot
. The app is also deployed through a Helm chart in lsst-sqre/phalanx, rather than as a Kustomize manifest. See New features for more details. - Avro schemas for messages
- Slack interaction events are currently unsupported; only Slack messages are published to Kafka.
New features
- Squarebot is rebuilt for the modern SQuaRE app architecture: FastAPI, deployed with Helm through Phalanx.
- Squarebot uses Pydantic for modelling Avro-encoded Kafka messages. This allows for end-to-end type checking from the HTTP handlers to the messages published to Kafka.
- The
lsst-sqre/squarebot
repository is now a monorepo that contains the Squarebot service and a client library (rubin-squarebot
on PyPI). The client library contains Pydantic models for the Avro-encoded messages published to Kafka by Squarebot. See SQR-075 for details on the monorepo architecture and SQR-076 background on how Pydantic is used for Kafka message modelling.
What's Changed
- Fix path to Secret template in CHANGELOG.rst by @rra in #10
- DM-37522: Transform into a FastAPI app by @jonathansick in #12
- DM-39043: Add Kafka producer for Slack messages and migrate to a client-server architecture by @jonathansick in #17
New Contributors
Full Changelog: 0.6.0...0.7.0