Skip to content

Indexes 10: Adds index update listeners and Indexer#1363

Open
dcookspi wants to merge 2 commits into
mainfrom
index-9-messaging2-publish-listener-and-indexer
Open

Indexes 10: Adds index update listeners and Indexer#1363
dcookspi wants to merge 2 commits into
mainfrom
index-9-messaging2-publish-listener-and-indexer

Conversation

@dcookspi
Copy link
Copy Markdown
Collaborator

@dcookspi dcookspi commented May 8, 2026

This adds an index update listening step to spk commands that update packages: publish, deprecate, undeprecate, and remove. After finishing their current processing, these comands will wait and listen to messages on an index updates topic to verify their changes have made it into the repository's index before finishing.

This also adds the spk repo indexer ... command to start an index updating process (an Indexer) that will listen for package update messages for a given repo, and kick off index updates for that repo's index as packages are changed. The Indexer will send index status event messages to the index updates topic for other spk commands to listen to. The publish, deprecate, undeprecate, and remove commands will use those messages to determine when the index the care about has been updated.

This also extends the spk configuration for messaging channels, indexes, and indexers to include the index status topic, naming channels and indexers, and various new timeouts and settings.

The idea is to support automatic updating of an index when packages change. A site would need an external messaging system set up. But then the site could configure a message channel and an indexer, and run an indexer as a service (e.g. for the origin repo). Then all the spk commands that modify packages in that repo, would send messages, via the message channel, to the indexer for it to update the index automatically, and the indexer would send messages back to the commands to let them know the index now contains their changes.

This is another PR in the chain 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. Indexes 9: Adds messaging on package events to kafka #1356
  10. this PR
  11. Indexes 11: Adds sentry support for kafka message issues #1364

@dcookspi dcookspi self-assigned this May 8, 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 May 8, 2026
@dcookspi dcookspi force-pushed the index-9-messaging2-publish-listener-and-indexer branch from e6efe8c to e327dd8 Compare May 8, 2026 19:20
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

let new_embedded_providers = self.get_embedded_providers(package)?;
// No change case #1: no embedded packages involved.
if original_embedded_providers.is_empty() && new_embedded_providers.is_empty() {
announce_package_event(
Copy link
Copy Markdown
Collaborator Author

@dcookspi dcookspi May 13, 2026

Choose a reason for hiding this comment

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

I've realised the additional announce_package_event calls in this method (update_publish) are not correct. They all need to be closer to the points where the methods that update the storage are called, so I'll be moving these around abit.

  • Fix this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've moved these calls around to be closer to the underlying storage updating calls.

Base automatically changed from index-9-messaging-to-kafka-feature to index-8-spk-build-fix May 14, 2026 19:00
@dcookspi dcookspi force-pushed the index-8-spk-build-fix branch from cfe91ed to 19faa81 Compare May 14, 2026 22:19
Base automatically changed from index-8-spk-build-fix to main May 14, 2026 22:35
dcookspi added 2 commits May 14, 2026 15:43
…package changes and updating the index.

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
…ecate commands in update_publish.

Adds debug logging for message sending.

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
@dcookspi dcookspi force-pushed the index-9-messaging2-publish-listener-and-indexer branch from e196230 to acc943d Compare May 15, 2026 00:15
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.

1 participant