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

Ensure we push to the GUI the real time critical trait for taskRoles #570

Merged
merged 3 commits into from
May 30, 2024

Conversation

teo
Copy link
Member

@teo teo commented May 29, 2024

No description provided.

@teo teo requested review from knopers8 and justonedev1 May 29, 2024 14:15
knopers8
knopers8 previously approved these changes May 30, 2024
Comment on lines 137 to +140
if ok && parentRole != nil {
sti.Status = parentRole.GetStatus().String()
sti.State = parentRole.GetState().String()
sti.Critical = parentRole.IsCritical()
Copy link
Collaborator

Choose a reason for hiding this comment

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

For my curiosity, why do you take these from the parent role?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because that's where the critical trait is stored. The parent role of a task.Task (which is not a role) is a taskRole, accessed via the workflow.Role interface. Criticality is a property of the taskRole i.e. the leaf node of the workflow tree that points to the task in question. A task without a parentRole (insofar as it exists, and for the most part it shouldn't in current AliECS) has no criticality because criticality is a property of a task only in relation to its workflow.

In actuality the previous way to access the taskRole traits should've worked too (it also goes to the taskRole via task.Task, for which I'm about to commit a fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks, clear.

@teo teo merged commit adfbdb6 into master May 30, 2024
2 checks passed
@teo teo deleted the critical-api-fix branch May 30, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants