Skip to content

16658 work pool queue update events#19688

Merged
zzstoatzz merged 26 commits intoPrefectHQ:mainfrom
F4RAN:16658-work-pool-queue-update-events
Dec 16, 2025
Merged

16658 work pool queue update events#19688
zzstoatzz merged 26 commits intoPrefectHQ:mainfrom
F4RAN:16658-work-pool-queue-update-events

Conversation

@F4RAN
Copy link
Copy Markdown
Contributor

@F4RAN F4RAN commented Dec 9, 2025

This PR adds event emission for work pool and work queue field updates beyond status changes. Previously, events were only created when the status field changed. Now events are also emitted when user-updatable fields like description, concurrency_limit, priority, etc. are updated.

This enables automations based on configuration changes, such as notifying on Slack when a work pool's concurrency limit is updated or scaling resources when a work queue's priority changes.

Note: This PR also updates existing tests to reflect the new event emission behavior. Tests that previously only checked for status events now also verify updated events when non-status fields change.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
    • Added tests for work pool update events
    • Added tests for work queue update events (both API endpoints)
    • Added test for no-op updates (no event emitted)
  • If this pull request removes docs files, it includes redirect settings in mint.json.
    • N/A - no docs files removed
  • If this pull request adds functions or classes, it includes helpful docstrings.
    • All new functions include docstrings

F4RAN added 7 commits December 9, 2025 15:15
Add event emission for work pool and work queue field updates beyond
status changes. Events are created when user-updatable fields change:
- Work pools: description, base_job_template, concurrency_limit, storage_configuration
- Work queues: name, description, concurrency_limit, priority
Emit events when work pools and work queues are updated

Previously, events were only created when status changed. Now we also
emit events when other fields like description, concurrency_limit, or
priority are updated. This enables automations based on configuration
changes.

Events include the old and new values in the payload.
@github-actions github-actions bot added the enhancement An improvement of an existing feature label Dec 9, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 9, 2025

CodSpeed Performance Report

Merging #19688 will not alter performance

Comparing F4RAN:16658-work-pool-queue-update-events (e16ced8) with main (0f9515a)

Summary

✅ 2 untouched

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @F4RAN! This looks solid; just a couple of requested changes from me!

F4RAN and others added 7 commits December 10, 2025 21:35
Co-authored-by: Alex Streed <desertaxle@users.noreply.github.com>
Co-authored-by: Alex Streed <desertaxle@users.noreply.github.com>
Co-authored-by: Alex Streed <desertaxle@users.noreply.github.com>
Co-authored-by: Alex Streed <desertaxle@users.noreply.github.com>
Co-authored-by: Alex Streed <desertaxle@users.noreply.github.com>
@F4RAN
Copy link
Copy Markdown
Contributor Author

F4RAN commented Dec 10, 2025

@desertaxle Thanks for the feedback! I've made the requested changes:

  • Removed duplicate reads in both work_queues.py and workers.py by reusing current_work_queue instead of reading from the database again
  • Updated tests accordingly

Happy to make any additional changes if needed!

@F4RAN F4RAN requested a review from desertaxle December 10, 2025 20:15
Copy link
Copy Markdown
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

This LGTM! @zzstoatzz do you want to give this one a look too?

Copy link
Copy Markdown
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

sorry for delay! lgtm

@zzstoatzz zzstoatzz merged commit 9baeb20 into PrefectHQ:main Dec 16, 2025
89 of 90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work Pool and Work Queue update events

3 participants