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

fix broken link to task-group in Recent Allocation table in jobs.job.index #12765

Merged
merged 15 commits into from
Apr 28, 2022

Conversation

ChaiWithJai
Copy link
Contributor

Resolves #12724

This PR fixes broken link to task-group in Recent Allocation table in jobs.job.index.

Side Effect

We needed to run prettier on 2 handlebar files. The commits are isolated to see the real change.

@github-actions
Copy link

github-actions bot commented Apr 22, 2022

Ember Asset Size action

As of 11f2ac0

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +3.56 kB +148 B

Files that got Smaller 🎉:

File raw gzip
vendor.js -18.5 kB -4.89 kB

Files that stayed the same size 🤷‍:

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

@github-actions
Copy link

github-actions bot commented Apr 22, 2022

Ember Test Audit comparison

main 11f2ac0 change
passes 1282 1279 -3
failures 0 2 +2
flaky 0 1 +1
duration 9m 03s 728ms 000ms -9m 03s 728ms

@github-actions
Copy link

Ember Test Audit flaky tests

Ember Test Audit detected these flaky tests on main:

  • Acceptance | job dispatch: required meta fields are properly indicated

Copy link
Contributor

@mikenomitch mikenomitch left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes the issue locally for me!

Was able to easily repro with the old code and couldnt repro with the new!

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.

I still see the error in the browser console in some pages. The easiest way to trigger it is by running a job in a non-default namespace then navigating to the job Allocations tab. I think it may be related to the lines I pointed where it's using the job as the model for LinkTo.

They happen in backgroud though, so it doesn't results in an error page, which is a big improvement 😄

There's also an added problem with the rendering of service IP:Port text that needs to be fixed.

Comment on lines 237 to 239
{{row.model.hostIp}}
:
{{row.model.value}}
Copy link
Contributor

Choose a reason for hiding this comment

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

This change introduces a space between the host IP and port
image

Here's how it currently looks:
image

<span class="pair job-link">
<span class="term">
Job
</span>
<LinkTo
@route="jobs.job"
@model={{this.preempter.job}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be @model={{format-job-id this.model.job.id}} as well?

Comment on lines 97 to 98
@model={{this.allocation.job}}
@query={{hash jobNamespace=this.allocation.job.namespace.id}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be updated as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup its not causing any breaks and its ticketed here: #12764

View all {{this.job.allocations.length}} {{pluralize "allocation" this.job.allocations.length}}
</LinkTo></p>
<p class="pull-right" data-test-view-all-allocations>
<LinkTo @route="jobs.job.allocations" @model={{this.job}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this needs to use the new helper as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup its not causing any breaks and its ticketed here: #12764

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it alright if I address that change in the above ticket?

@@ -279,7 +279,7 @@ module('Acceptance | allocation detail', function (hooks) {
assert.equal(renderedPort.name, serverPort.Label);
assert.equal(renderedPort.to, serverPort.To);
assert.equal(
renderedPort.address,
renderedPort.address.replace(/\s/g, ''),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is result of added line breaks in ui/app/templates/allocations/allocation/index.hbs. We shouldn't modify the test as it correctly reports a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's nothing I can do about the extra spaces being added to handlebars as a result of prettier, however. So I'm not sure what I can do without spending a few hours to understand why.

Do you have any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can ignore parts of the code: https://prettier.io/docs/en/ignore.html#handlebars

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignoring prettier seems yucky. I decided to use a template helper to avoid the problem. However, I think @philrenaud and I should prioritize taking a look into our prettier and linting set-up when I'm back from vacation.

<td data-test-allocation-port-address>
<a
href="http://{{row.model.hostIp}}:{{row.model.value}}"
target="_blank"
rel="noopener noreferrer"
>{{row.model.hostIp}}:{{row.model.value}}</a>
>
{{row.model.hostIp}}:{{row.model.value}}
Copy link
Contributor

@lgfa29 lgfa29 Apr 28, 2022

Choose a reason for hiding this comment

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

I reverted the change to use a helper here. It didn't seemed like a good idea to add more code to workaround a tooling issue.

It also seems like Prettier is fine with the code like this? It didn't try to change it for me at least, so I think it may be another plugin in your machine that is causing this formatting.

Moving forwards though, I think we should reconsider using Prettier for hbs files and minimize changes to the UI code to only what's necessary. I detected some other minor visual regressions caused by all these formatting and I worry about having others we may have missed. I will leave this decision to you and @philrenaud.

@github-actions
Copy link

Ember Test Audit flaky tests

Ember Test Audit detected these flaky tests on 11f2ac0:

  • Acceptance | client detail: each allocation should have high-level details for the allocation

@ChaiWithJai ChaiWithJai merged commit c180c8d into main Apr 28, 2022
@ChaiWithJai ChaiWithJai deleted the b-ui/task-group-namespace-bug branch April 28, 2022 18:02
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sporadic error when loading Job page
4 participants