Skip to content

Indexes 9 - Adds messaging on package events to kafka#1356

Open
dcookspi wants to merge 1 commit intoindex-8-spk-build-fixfrom
index-9-messaging-to-kafka-feature
Open

Indexes 9 - Adds messaging on package events to kafka#1356
dcookspi wants to merge 1 commit intoindex-8-spk-build-fixfrom
index-9-messaging-to-kafka-feature

Conversation

@dcookspi
Copy link
Copy Markdown
Collaborator

This adds configurable messaging support to spk so it can send messages after events.

This adds support for sending message to kafka when these events occur:

  • publishing a package
  • modifiying a package
  • removing a package

This allows a site to have an external messaging system listen for such messages and take appropriate action, e.g. updating the index on a repo after a new package has been published.

This is the 9th of the chained PRs for adding indexes to spk solves:

  1. Indexes 1: Change Package and related traits to not return references to fields #1336
  2. Indexes 2: Add new_unchecked() constructors to spk schema objects #1337
  3. Indexes 3: Adds flatbuffers schema and SolverPackageSpec for indexes to spk #1338
  4. Indexes 4: Adds Indexes for SPK repositories #1339
  5. Indexes 5: Adds spk repo index subcommand for index generation and updates #1340
  6. Indexes 6: Changes version_filter field in index schema #1344
  7. Indexes 7: Adds a lock file around index generation and updates #1354
  8. Indexes 8: Fixes the spk build or mkb crash with indexes enabled #1355
  9. this PR

@dcookspi dcookspi self-assigned this Apr 20, 2026
@dcookspi dcookspi added enhancement New feature or request SPI AOI Area of interest for SPI pr-chain This PR doesn't target the main branch, don't merge! labels Apr 20, 2026
@dcookspi dcookspi requested a review from jrray April 20, 2026 21:57
@dcookspi dcookspi force-pushed the index-9-messaging-to-kafka-feature branch 3 times, most recently from d93a1bd to d7c1234 Compare April 20, 2026 22:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 14.51613% with 53 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spk-storage/src/storage/messaging/kafka.rs 0.00% 47 Missing ⚠️
crates/spk-config/src/config.rs 0.00% 3 Missing ⚠️
crates/spk-storage/src/storage/messaging/mod.rs 75.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

…kafka

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
@dcookspi dcookspi force-pushed the index-9-messaging-to-kafka-feature branch from 7d7001c to e8a9444 Compare May 1, 2026 18:57
Comment on lines +212 to +214
/// Message timeout in milliseconds, defaults to 5000 ms (5 seconds)
#[serde(default = "default_kafka_timeout_ms")]
pub timeout_ms: u64,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Message timeout in milliseconds, defaults to 5000 ms (5 seconds)
#[serde(default = "default_kafka_timeout_ms")]
pub timeout_ms: u64,
/// Message timeout in milliseconds, defaults to 5000 ms (5 seconds)
#[serde(default = "default_kafka_message_timeout_ms")]
pub message_timeout_ms: u64,

I suggest mirroring the name of the kafka property as a convention to make it more plain what this setting maps to on the kafka side.

})
.to_string(),
),
Duration::from_secs(0),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timeout is for waiting for room in the producer queue, it should be willing to wait some small amount of time as a form of back-pressure. Better to wait a little than fail aggressively.

Comment thread cspell.json
"depvar",
"depver",
"Deque",
"derserializer",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr-chain This PR doesn't target the main branch, don't merge! SPI AOI Area of interest for SPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants