Skip to content

Releases: lsst-sqre/squarebot

0.9.0

25 Jul 21:01
fb639f6
Compare
Choose a tag to compare

Backwards-incompatible changes

  • SquarebotSlackMessageValue no longer includes a bot_id field. Instead, the user field is set to the bot's ID and a new is_bot field indicates if the user field is a bot or user ID.

New features

  • Add support for Slack messages with subtype of bot_message. This is implemented in the Slack message model SlackMessageEventContent as a new subtype field that now takes a SlackMessageSubtype enum. The Kafka representation of this message, SquarebotSlackMessageValue has been updated to now set the user attribute to either the user's ID or the bot's ID as appropriate. A new flag, is_bot indicates if the user field reflects a user or bot (app integration) identifier.

  • SlackMessageEventContent, a part of the SlackkMessageEvent model, now has support for attachments. Slack attachments are deprecated for Block Kit, but are still widely used by app integrations. The attachments field is a list of SlackMessageAttachment objects. These attachments can have text content or individual fields that have titles and values.

  • The SquarebotSlackMessageValue Kafka message model's text 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, the slack_event field is still available, which is the original JSON representation of the Slack message, which can be parsed into a SlackMessageEvent 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

Full Changelog: 0.8.0...0.9.0

0.8.0

28 Feb 21:35
549311b
Compare
Choose a tag to compare

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 the rubin.squarebot Python namespace (previously rubinobs.square.squarebot). Consumers should use the rubin.squarebot.models.kafka.SquarebotSlackMessageValue Pydantic model to deserialize Squarebot messages for Slack channel message traffic (or rubin.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 in rubin.squarebot.models.kafka.SquarebotSlackMessageValue. We now assure that the channel type is not Null here. However the channel_type field is now set to null/None in the SquarebotSlackAppMentionValue 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 by nox).

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 (like make init).
    • nox -s update-deps updates the pinned dependencies as well as the pre-commit hooks (replacing make update-deps).
  • New nox integration with scriv for change log management: nox -s scriv-create creates a change log fragment and nox -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

New Contributors

Full Changelog: 0.7.0...0.8.0

0.7.0

19 May 18:39
2976173
Compare
Choose a tag to compare

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

  • @rra made their first contribution in #10

Full Changelog: 0.6.0...0.7.0