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, deployments] Fix a bug where watchers on a parent (periodic) job would continue on a child route #17214

Merged

Conversation

philrenaud
Copy link
Contributor

On a parent/child Nomad job (periodic, parameterized), the Nomad UI shows a page at jobs/:job that aggregates information about its child jobs. For example, a periodic job that runs hourly, etc. would have all its hourly runs included in a "Child Jobs" table.

That parent job, though, does not have any allocations (or evaluations, or services) of its own. Despite this, we do consider it a job, if only of a different type (we might otherwise have considered it a "folder" or some other similar concept)

Because we consider it a job, we give it all the bells and whistles that nomad jobs have at the top level (we're pulling some of these back, though; see the removal of unnecessary subnav in #17190 for example).

While this is pretty innocuous most of the time (an empty list of allocations is always returned for a parent periodic job, causing no real harm), there is a problem with how these watchers interact with our concept of routes: because moving from a parent job to its child has the same Ember route location, not everything is torn down and brought back up again. Our relationship watchers need to be cancelled and restarted with the child job's model. This PR cancels existing watchers when doing a transition between two pages at the same route.

In plain terms, before this PR, the content of the "Task Groups" bar would update, but the content of the "Allocations" table never would — only when clicking into the child job from its parent. When loaded directly by URL, things would work fine. This is fixed with the exact-name check here.

Resolves #17193

@github-actions
Copy link

github-actions bot commented May 16, 2023

Ember Asset Size action

As of c267472

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +246 B +66 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

github-actions bot commented May 16, 2023

Ember Test Audit comparison

main c267472 change
passes 1496 1492 -4
failures 4 4 0
flaky 0 0 0
duration 000ms 000ms -000ms

@philrenaud philrenaud merged commit 830b9bc into main May 17, 2023
4 checks passed
@philrenaud philrenaud deleted the 17193-ui-deployments-why-arent-child-jobs-watching-allocations branch May 17, 2023 20:36
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.

[ui, deployments] Why aren't child jobs watching allocations?
2 participants