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

single job page view #598

Merged
merged 9 commits into from
Aug 8, 2023
Merged

single job page view #598

merged 9 commits into from
Aug 8, 2023

Conversation

jamesgweber
Copy link
Contributor

Greetings - my team is using bull-board for a project and the need arose for having the ability to deep link into a failed job.
This is meant to be a first pass to see what you think & get some feedback. It lacks completeness as I still don't totally understand all the interaction patterns for paused / delayed jobs but I feel its headed in the right direction.

Kapture 2023-07-05 at 08 16 57

@felixmosh
Copy link
Owner

felixmosh commented Jul 5, 2023

Thank you for this PR....
I'm not sure why would you implement an entire page for this scenario?

It sounds to me as a filter on the requested queue, you can add a querystring which will make queue list return the specific job in the list... this way, you don't need to re-implement 80% of the code.

Maybe this way will be a start of "queue filtering feature"

WDYT?

@jamesgweber
Copy link
Contributor Author

Interesting - to me a router pattern for /queues/:queue/:jobId was the natural choice. Otherwise we're kind of emulating a restful access pattern with query strings. I can see other people have shown interest in filters on a queue, I thought about doing that but it has the potential for way more complexity depending on your overall vision for the product. I thought a "view one job" page was a safe bet for getting a single job, along with the action buttons desired for administration / operations tasks to do with that job only. Ultimately it's your project (which we appreciate getting to use) so let me know if you feel strongly about this.

@felixmosh
Copy link
Owner

Yeah, so I guess we can proceed with this... I'll need to review this PR more throughly ...

@@ -33,6 +33,8 @@ export interface QueueJob {
retry(state?: JobRetryStatus): Promise<void>;

toJSON(): QueueJobJson;

getState(): Promise<Status | 'stuck' | 'waiting-children' | 'unknown'>;
Copy link
Contributor Author

@jamesgweber jamesgweber Jul 5, 2023

Choose a reason for hiding this comment

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

Apparently this is the full union of states 🤷‍♂️ - idk if this is going to cause problems, any advice here would be greatly appreciated.

Copy link
Owner

Choose a reason for hiding this comment

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

Why do you need to specify all of the statuses (which the board not supports yet, as far as i know, bull doesn't support waiting-children as well)

This interface must be a unify version between bullmq & bull

Copy link
Contributor Author

@jamesgweber jamesgweber Jul 6, 2023

Choose a reason for hiding this comment

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

I'm getting a build error unless I include them all.
https://gist.github.com/jamesgweber/cbf1e8bbf29f169964d37b6adb8c405a

bull board might not support it but { Job } from 'bull'; does and it expects that continuity

Another possible option is getState(): Promise<Status | any>; 🙅

@jamesgweber jamesgweber marked this pull request as ready for review July 5, 2023 18:00
@@ -33,6 +33,8 @@ export interface QueueJob {
retry(state?: JobRetryStatus): Promise<void>;

toJSON(): QueueJobJson;

getState(): Promise<Status | 'stuck' | 'waiting-children' | 'unknown'>;
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you need to specify all of the statuses (which the board not supports yet, as far as i know, bull doesn't support waiting-children as well)

This interface must be a unify version between bullmq & bull

@felixmosh
Copy link
Owner

Hi @jamesgweber I didn't forget about this PR...
I have a new born which overloads the entire system :)

Will review it asap

packages/ui/src/pages/JobPage/JobPage.tsx Outdated Show resolved Hide resolved

useInterval(() => {
fetchJob();
}, 5000);
Copy link
Owner

Choose a reason for hiding this comment

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

should use users config of interval time
Do we pause the interval of the QueuePage?

Copy link
Contributor Author

@jamesgweber jamesgweber Aug 3, 2023

Choose a reason for hiding this comment

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

should use users config of interval time

idk what this means - if you can point me to an example I'm happy to make the change

Do we pause the interval of the QueuePage?

no - I just let the polling continue because it keeps everything in sync and it's simple. traffic is not a real concern for an app like this imo. You probably wouldn't have 1000s of concurrent users.

packages/ui/src/pages/QueuePage/QueuePage.tsx Outdated Show resolved Hide resolved
@felixmosh
Copy link
Owner

felixmosh commented Aug 3, 2023

Hi @jamesgweber I've reviewed the code, it looks OK.
There are 1 issue that arises since Job page doesn't need the entire polling of queues.

After requested changes, I will approve this PR, and will make several refactors to solve this issue (basically break down the useStore hook into small parts)

Thank you for your patience, and sorry for the delay 🙏🏼

@felixmosh felixmosh merged commit 91994c5 into felixmosh:master Aug 8, 2023
2 of 4 checks passed
@jamesgweber
Copy link
Contributor Author

Thank you @felixmosh - we appreciate your work

@felixmosh
Copy link
Owner

Thank you for the PR
I need to refactor the code to meet with some issues... then I'll publish a new version

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