feat(list-jobs): add ListJobs facade for JIMM#1878
Merged
SimoneDutto merged 6 commits intocanonical:v3from Feb 23, 2026
Merged
Conversation
kian99
reviewed
Feb 19, 2026
545be59 to
fabf14f
Compare
96bedfe to
421457c
Compare
alesstimec
approved these changes
Feb 23, 2026
Collaborator
alesstimec
left a comment
There was a problem hiding this comment.
LGTM with a few comments
internal/jimm/jobs/jobs.go
Outdated
| count = 100 | ||
| } | ||
| if count > 10000 { | ||
| return apiparams.ListJobsResponse{}, errors.E("Count must be between 1 and 10_000.") |
Collaborator
There was a problem hiding this comment.
i think our errors strings begin with a lower case character.. also, 100 and 10000 should be consts.. why did you put it as 10_000 in the error string?
Contributor
Author
There was a problem hiding this comment.
10_000 is the max accepted by the river's API
Contributor
Author
There was a problem hiding this comment.
i can put them in a const
0739fbb to
7d37820
Compare
375b9db to
8a35875
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add ListJobs To JIMM facade.
A bunch of maybe controversial decisions I've made:
.First()accepts from 1 to 10000 so i don't think there is a world where we actually need 2 pages of jobs. We can always query from the CLI the maximum.ListJobs is paginated with a continuation token (it doesn't support limit and offset), and the token is the riverCursor struct base64 encoded.
ListJobs accepts filters, but if empty it will just return all jobs of all kinds and error state
I've added a way to do actual integration testing with river, because I wasn't sure the mock tests were enough for this pagination feature.
To accomplish that I need to add
func (c *Client) SetClient(client *river.Client[*sql.Tx])because i need theinternal/river:Clientstruct to initialize the JobManager, but i also need the actual riverClient to interact with river inserting jobs, waiting, etc.