Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WorkQueue.status to server and client side schemas #11829

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

urimandujano
Copy link
Contributor

@urimandujano urimandujano commented Feb 2, 2024

This PR adds the status field to WorkQueue objects and responses. The status is determined by the server when it receives a "poll" asking for a WorkQueue object and is conditional on the recency of the work queue's last_polled field.

Closes #11830

Example

Work Queue responses now include a status field, determined via last_polled and is_paused:

{
    "id": "6648ad79-a05a-490c-ac58-0f4eea8461ee",
    "created": "2024-02-02T21:58:28.664611+00:00",
    "updated": "2024-02-02T21:58:28.834000+00:00",
    "name": "wq-1",
    "description": "All about my work queue",
    "is_paused": true,
    "concurrency_limit": null,
    "priority": 1,
    "work_pool_id": "ad6678dd-e13e-4a84-92ba-cb851658d7f4",
    "filter": null,
    "last_polled": null,
    "work_pool_name": "default-agent-pool",
    "status": "PAUSED"
}

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

Copy link

netlify bot commented Feb 2, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit fd48cd6
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65c503ae5b564a00082b89a5
😎 Deploy Preview https://deploy-preview-11829--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@urimandujano urimandujano changed the title ft: add work queue status Add WorkQueue.status to server and client side schemas Feb 2, 2024
@urimandujano urimandujano added the feature A new feature label Feb 2, 2024
@urimandujano urimandujano marked this pull request as ready for review February 2, 2024 22:00
@urimandujano urimandujano requested review from zangell44 and a team as code owners February 2, 2024 22:00
@urimandujano
Copy link
Contributor Author

I had a chance to verify this against the UI work we've done and the results look good:
image

Copy link
Contributor

@serinamarie serinamarie left a comment

Choose a reason for hiding this comment

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

Looking good!

src/prefect/server/schemas/responses.py Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

tests/server/api/test_work_queues.py Show resolved Hide resolved
src/prefect/server/schemas/responses.py Show resolved Hide resolved
Copy link
Contributor

@collincchoy collincchoy left a comment

Choose a reason for hiding this comment

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

🚀

@urimandujano urimandujano merged commit 26d3385 into main Feb 8, 2024
45 checks passed
@urimandujano urimandujano deleted the ft/add-work-q-status branch February 8, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the status field to WorkQueue objects in OSS
3 participants