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

[ui] Adds a "Scheduling" filter to the job.allocations page #17227

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented May 17, 2023

Adds a new filter, "Scheduling", to the job allocations page. This helps facilitate Rescheduled/Restarted links from the upcoming Job Status Panel and gives us future options for letting users drill down on this list page.

Because of some seen inconsistencies in testing, this adds NextAllocation to Allocations in their list/stub form from our API, where before they only existed when an allocation was being fetched individually. This, combined with a check for FollowUpEvalID, gives us a better picture of "Is a terminal allocation never going to be rescheduled?", which the UI is seeking to show to users here.

image

image

Resolves #17221

@philrenaud philrenaud self-assigned this May 17, 2023
@philrenaud philrenaud linked an issue May 17, 2023 that may be closed by this pull request
@@ -48,7 +48,7 @@
@condition={{not (eq type.label "unplaced")}}
@route="jobs.job.allocations"
@model={{@job}}
@query={{hash status=(concat '["' type.label '"]') version=(concat '[' (keys this.versions) ']')}}
@query={{hash status=(concat '["' type.label '"]') version=(concat '[' (map-by "version" this.versions) ']')}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted that I was being inconsistent after changing my version sorting logic a few PRs ago.

@github-actions
Copy link

Ember Asset Size action

As of 8525f9d

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +1.78 kB +164 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.js 0 B 0 B
nomad-ui.css 0 B 0 B
vendor.css 0 B 0 B

@github-actions
Copy link

Ember Test Audit comparison

main 8525f9d change
passes 1492 1492 0
failures 4 4 0
flaky 0 0 0
duration 000ms 000ms -000ms

@philrenaud philrenaud merged commit 4335f9f into main May 18, 2023
24 checks passed
@philrenaud philrenaud deleted the 17221-add-a-will-not-reschedule-filter-to-the-joballocations-page branch May 18, 2023 20:24
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Just need to fix api/allocations.go, otherwise it will return the wrong value.

A .changelog entry would be good as well since it's a change to the API return content.

@@ -326,6 +326,7 @@ func (a *Allocation) Stub() *AllocationListStub {
TaskStates: a.TaskStates,
DeploymentStatus: a.DeploymentStatus,
FollowupEvalID: a.FollowupEvalID,
NextAllocation: a.JobID,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
NextAllocation: a.JobID,
NextAllocation: a.NextAllocation,

Comment on lines +17 to +29
@query={{hash scheduling=(concat '["has-been-rescheduled"]') version=(concat '[' @job.latestDeployment.versionNumber ']')}}
@label="View Allocations"
@class="failed-or-lost-link"
>
{{@allocs.length}}
</ConditionalLinkTo>
{{/if}}
{{#if (eq @title "Restarted")}}
<ConditionalLinkTo
@condition={{this.shouldLinkToAllocations}}
@route="jobs.job.allocations"
@model={{@job}}
@query={{hash scheduling=(concat '["has-been-restarted"]') version=(concat '[' @job.latestDeployment.versionNumber ']')}}
Copy link
Contributor

Choose a reason for hiding this comment

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

What is being concatened in (concat '["has-been-rescheduled"]') and (concat '["has-been-restarted"]')? It seems like it's just a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch; this was an artefact from earlier! Will fix.

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.

Add a "Will not Reschedule" filter to the job/allocations page
3 participants