Skip to content

feat(x2a): add project and module status - #2306

Merged
elai-shalev merged 4 commits into
redhat-developer:mainfrom
mareklibra:FLPATH-3205.ProjectAndModuleStatus
Feb 12, 2026
Merged

feat(x2a): add project and module status#2306
elai-shalev merged 4 commits into
redhat-developer:mainfrom
mareklibra:FLPATH-3205.ProjectAndModuleStatus

Conversation

@mareklibra

@mareklibra mareklibra commented Feb 10, 2026

Copy link
Copy Markdown
Member

Fixes: FLPATH-3205

Status for Modules and Projects is hierarchically calculated.

TODO:

  • pass errorDetail to the UI

Screenshot From 2026-02-11 10-15-57
Screenshot From 2026-02-11 10-16-05
  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app

rhdh-gh-app Bot commented Feb 10, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-x2a-backend workspaces/x2a/plugins/x2a-backend patch v1.0.0
@red-hat-developer-hub/backstage-plugin-x2a-common workspaces/x2a/plugins/x2a-common patch v1.0.0
@red-hat-developer-hub/backstage-plugin-x2a workspaces/x2a/plugins/x2a patch v1.0.0

@mareklibra
mareklibra force-pushed the FLPATH-3205.ProjectAndModuleStatus branch 3 times, most recently from d3f1f4e to cc3ebce Compare February 11, 2026 09:40
@mareklibra mareklibra changed the title feat(x2a): add module status feat(x2a): add project and module status Feb 11, 2026
@mareklibra
mareklibra force-pushed the FLPATH-3205.ProjectAndModuleStatus branch from cc3ebce to 6342cf4 Compare February 11, 2026 09:50
@mareklibra
mareklibra marked this pull request as ready for review February 11, 2026 09:51
@mareklibra
mareklibra marked this pull request as draft February 11, 2026 09:53
@mareklibra
mareklibra force-pushed the FLPATH-3205.ProjectAndModuleStatus branch 2 times, most recently from 25450e2 to c3eb57c Compare February 11, 2026 10:56
@mareklibra
mareklibra marked this pull request as ready for review February 11, 2026 11:18
@mareklibra
mareklibra force-pushed the FLPATH-3205.ProjectAndModuleStatus branch from c3eb57c to d538796 Compare February 11, 2026 12:52
module => module.status === 'running',
).length;

let state: ProjectStatusState;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dear reviewer, this is probably the most tricky part to focus on.

@elai-shalev elai-shalev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall looks great. some comments and one question.

Comment on lines +171 to +174
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 =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Due to our capacity reasons, I would optimize that later.

We will need to create a new query for that. It's feasible.

Comment on lines +65 to +87
projectId,
phase: 'init',
lastJobOnly: true,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch, fixed

Comment on lines +581 to +583
- finished
- waiting
- completed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is finished vs completed?
I saw that finished is the actual property, no?

@mareklibra mareklibra Feb 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch, I did rename from completed to finished

} else if (pending || waiting || running) {
state = 'inProgress';
} else {
state = 'initialized';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. Second try...

@sonarqubecloud

Copy link
Copy Markdown

@elai-shalev elai-shalev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@elai-shalev
elai-shalev merged commit bf9212b into redhat-developer:main Feb 12, 2026
10 checks passed
asmasarw pushed a commit to asmasarw/rhdh-plugins that referenced this pull request Feb 16, 2026
* 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>
@rhdh-qodo-merge rhdh-qodo-merge Bot mentioned this pull request Aug 5, 2026
4 tasks
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.

3 participants