feat(x2a): add project and module status - #2306
Conversation
Changed Packages
|
d3f1f4e to
cc3ebce
Compare
cc3ebce to
6342cf4
Compare
25450e2 to
c3eb57c
Compare
Signed-off-by: Marek Libra <marek.libra@gmail.com>
c3eb57c to
d538796
Compare
| module => module.status === 'running', | ||
| ).length; | ||
|
|
||
| let state: ProjectStatusState; |
There was a problem hiding this comment.
Dear reviewer, this is probably the most tricky part to focus on.
elai-shalev
left a comment
There was a problem hiding this comment.
Overall looks great. some comments and one question.
| const modules = await this.#moduleOps.listModules({ projectId }); | ||
| // TODO: This can be optimized by using a single query to list all jobs for all modules. | ||
| const lastAnalyzeJobsOfModules = await Promise.all( | ||
| modules.map(module => |
There was a problem hiding this comment.
So these 3 queries are run for all models, for each project? This might have a performance issue
Still, ok to merge now and optimize later, but maybe best to just have it done now?
There was a problem hiding this comment.
Due to our capacity reasons, I would optimize that later.
We will need to create a new query for that. It's feasible.
| projectId, | ||
| phase: 'init', | ||
| lastJobOnly: true, | ||
| }); |
There was a problem hiding this comment.
the enrichProject flow calls for getMigrationPlanForProject, and then queries listJobs (init)
but getMigrationPlanForProject itself has a query for listJobs (init)
seems like duplication? it could reuse the first query
| - finished | ||
| - waiting | ||
| - completed |
There was a problem hiding this comment.
what is finished vs completed?
I saw that finished is the actual property, no?
There was a problem hiding this comment.
good catch, I did rename from completed to finished
| } else if (pending || waiting || running) { | ||
| state = 'inProgress'; | ||
| } else { | ||
| state = 'initialized'; |
There was a problem hiding this comment.
is "initialized" is for the state where init has finished, but the user has yet to triggger the first analysis?
when will a project actually reach this stage?
project unit -> no modules -> calculateModuleStatus return pending? pending is >0 ->
this wins:
else if (pending || waiting || running) {
state = 'inProgress';
so it won't hit initialize?
There was a problem hiding this comment.
Thanks. Second try...
|
* feat(x2a): add project and module status Signed-off-by: Marek Libra <marek.libra@gmail.com> * Add errorDetails to the UI * yarn.lock * review --------- Signed-off-by: Marek Libra <marek.libra@gmail.com>



Fixes: FLPATH-3205
Status for Modules and Projects is hierarchically calculated.
TODO: