Skip to content

Improve ListJob flexibility - Allow for querying based on a list of states and kinds - #227

Closed
jos-oai wants to merge 8 commits into
riverqueue:masterfrom
jos-oai:jos/joblist_improvements
Closed

jos-oai wants to merge 8 commits into
riverqueue:masterfrom
jos-oai:jos/joblist_improvements

Conversation

@jos-oai

@jos-oai jos-oai commented Feb 25, 2024

Copy link
Copy Markdown
Contributor

This modifies the JobListParams such that the user can pass in any number of job states or job kinds to filter against. Before this, the JobList API only exposed a way to grab jobs with a single type of state at a time, and filtering based on job kind was not possible.

This also allows the user to specify a specific timestamp field to sort by in case multiple job states are requested.

Happy to update / improve based on your feedback! Happy River user so far.

@jos-oai

jos-oai commented Feb 25, 2024

Copy link
Copy Markdown
Contributor Author

Ah just noticed you added a bunch of this already, let me revisit my work in light of that!

@brandur

brandur commented Feb 25, 2024

Copy link
Copy Markdown
Contributor

Thanks for the patch.

Happy River user so far.

Excellent! That's great to hear.

Ah just noticed you added a bunch of this already, let me revisit my work in light of that!

Yeah. Oof, your timing on this one is quite unlucky — I just landed a big refactor today that moved a lot of things around, and also randomly added filtering loads by kind after I happened to notice it was missing.

So much has shifted that it might actually be easier to start your patch over, using this one as a reference, rather than try to rebase and resolve the conflicts (which I'd expect to be somewhat painful). One note to help on that is that previously the list logic was broken apart, with about half in dbadapter and half in dblist, now it's basically all in dblist.

@bgentry There's a minor breaking change here that'd allow filtering by multiple states (so State(...) would become States(...)), which is probably what it should've been before. We might have gotten it early enough that few people are depending on the list API so far. Thoughts on the change?

@jos-oai

jos-oai commented Feb 26, 2024

Copy link
Copy Markdown
Contributor Author

I'm working on a new PR now yeah, should have something up shortly. Thanks so much for the response!

@jos-oai

jos-oai commented Feb 26, 2024

Copy link
Copy Markdown
Contributor Author

Closing in favor of #227

@jos-oai jos-oai closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants