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 meta to job list stub and displays a pack logo on the jobs index #14833

Merged
merged 9 commits into from
Nov 2, 2022

Conversation

philrenaud
Copy link
Contributor

Resolves #11886

Adds a Pack logo to the jobs list index's job row:
image

@philrenaud philrenaud self-assigned this Oct 6, 2022
@philrenaud philrenaud linked an issue Oct 6, 2022 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

Ember Asset Size action

As of 2ba343c

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +299 B +29 B

Files that got Smaller 🎉:

File raw gzip
nomad-ui.css -22 B +17 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.js 0 B 0 B
vendor.css 0 B 0 B

@github-actions
Copy link

github-actions bot commented Oct 6, 2022

Ember Test Audit comparison

main 2ba343c change
passes 1425 1425 0
failures 0 0 0
flaky 0 0 0
duration 11m 44s 409ms 10m 33s 342ms -1m 11s 067ms

Copy link
Contributor

@ChaiWithJai ChaiWithJai left a comment

Choose a reason for hiding this comment

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

Good job buddy.

command/agent/job_endpoint.go Show resolved Hide resolved
@@ -32,7 +32,7 @@ export default class IndexRoute extends Route.extend(
controller.set('namespacesWatch', this.watchNamespaces.perform());
controller.set(
'modelWatch',
this.watchJobs.perform({ namespace: controller.qpNamesapce })
this.watchJobs.perform({ namespace: controller.qpNamesapce, meta: true })
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated nit: Do you see that typo to the left of your change?

Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated question: We don't poll /jobs though? I was thinking about removing this. Any concerns you can think of while we're here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do poll existing jobs for changes; if you are on the index page and a pending job changes to ready, for example, that update will propagate to the list.

@@ -35,7 +35,7 @@ export default class JobRoute extends Route {
const relatedModelsQueries = [
job.get('allocations'),
job.get('evaluations'),
this.store.query('job', { namespace }),
this.store.query('job', { namespace, meta: true }),
Copy link
Contributor

Choose a reason for hiding this comment

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

question non-blocking: We're making a second request to /jobs/:jobId here. Maybe we should refactor line 33 .findRecord to .query instead?

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM! Let's get that field added to api.JobListStub and ship!

@@ -4720,6 +4734,7 @@ type JobListStub struct {
ModifyIndex uint64
JobModifyIndex uint64
SubmitTime int64
Meta map[string]string
Copy link
Member

Choose a reason for hiding this comment

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

We should make sure this field is included on api.JobListStub as well.

We should probably add a api.JobListWithFields method to the api package as well (under api/jobs.go), but I'm fine with shipping this PR without and we can come back to that later: right now the UI will be the only consumer of this field.

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.

Nice one!

In addition to the update to the api package we need to update the docs as well:
https://github.com/hashicorp/nomad/blob/main/website/content/api-docs/jobs.mdx?plain=1#L27-L47

My comment about the omitempty can be ignored, I'm not sure if it's a good idea or not give how it behaves kind of weird.

nomad/structs/structs.go Outdated Show resolved Hide resolved
ui/app/templates/components/topo-viz/datacenter.hbs Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

Ember Test Audit flaky tests

Ember Test Audit detected these flaky tests on main:

  • Integration | Utility | exec-command-editor-xterm-adapter: it ignores arrow keys and unprintable characters other than ^U

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM @philrenaud! I've left the one fix we'll need for capitalization of the field in the api package, but other than that it's ready to ship!

api/jobs.go Outdated Show resolved Hide resolved
Co-authored-by: Tim Gross <tgross@hashicorp.com>
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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 Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.4.x backport to 1.4.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show pack label on the main jobs view
4 participants