-
Notifications
You must be signed in to change notification settings - Fork 135
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
Status query syntax #350
Comments
I just finished the implementation of all features I deemed "essential". It would be great if you guys could give it a test run based on your common scenarios :)
|
@Nukesor this looks fantastic! Thank you for implementing this feature. I will give it a spin this coming week and report back with any feedback. |
I like this idea! I'd try to keep this simple; the I do wonder if there is a good use-case for substring matching, at least for labels. E.g. for my current needs I have Another queue is labelled with the number of items to process (as the log only shows me what numbered files have been processed, so I can compare label and current file number to see how far along the job is), so a stretch goal would be for |
I agree that the syntax should be kept rather simple :) This is also the reason why I didn't introduce the Adding I'm also not against a Regarding regex support, I'm not generally against it, but I would like to keep it simple for the first iteration of the syntax. |
How shell friendly does it need to remain; more friendly than Looking at other contexts for similar use-cases I peeked at CSS attribute selectors; I do like the idea of combining a symbol with E.g.:
would filter the output to only show items with January 2022 in the label. |
The current operators
I like
|
I'll try to keep the base syntax as it is for now, further operators and filters will be added in follow-up PRs to keep the scope manageable. Everything should be rather well tested now, but I'll keep the PR open for another 1-2 weeks for people to test :) |
I started implementing the
pueue status
query on this branch: https://github.com/Nukesor/pueue/tree/filter-statusIt's still very much work-in-progress, but it's starting to shape into something usable.
The main reason why I'm writing this ticket is that I want some feedback on the current syntax.
A small upfront disclaimer:
The first draft of the syntax will be experimantal. If it get's released, there'll be a big note on top of it that the syntax might become subject to change and that it shouldn't be considered stable!
Furthermore, I don't plan to make the syntax feature-complete from the get-go. The idea is to implement the basic features and continue working on it with real-world feedback and usecases.
Okay, now that that's out of the way here's the current syntax.
There're currently three sections:
Column selection:
This is a basic filter on which columns should be visible
columns=id,status,start,end
Filters
This is where it get's a bit more complex.
For now a few filters are planned:
label [=|!=] string
: Filter for a specific label[start|end|enqueue_at] [=|!=|<|>] [YYYY-MM-DD | YYYY-MM-DD hh:mm | hh:mm]
Filter any of the three date related fields.status [=|!=] [queued|stashed|running|paused|done|failed]
Filter tasks based on their statusOrdering
order_by [any_column] = [asc|desc]
A simple ordering depending on a column and a direction.Limit
[first|last] [count]
Only show thecount
first or last tasks.Complete query
A complete query has this structure:
[column_selection]? [filter]*? [order]? [limit]?
Examples:
columns=id,status,command,end label=special start>2022-09-01 order_by status desc
label=special
start>10:30 end<18:00 status=success first 10
Questions:
Further Additions to the syntax
%=
The text was updated successfully, but these errors were encountered: