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] Title bar job start button now observes job submission variables data #19220

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

philrenaud
Copy link
Contributor

Resolves #19198

Previously, after stopping a job with variables passed in but no default values, going to the definition page and editing would work fine (as variable literals were already present on the page), but the "start" button would not consider them.

Now they're specifically checked when the job start button is pressed.

Side-effect: utility-ified the json-to-hcl method previously internal to the job editor component.
image
image

@philrenaud philrenaud self-assigned this Nov 29, 2023
@philrenaud philrenaud linked an issue Nov 29, 2023 that may be closed by this pull request
Copy link

github-actions bot commented Nov 29, 2023

Ember Test Audit comparison

main 6ef27b3 change
passes 1539 1539 0
failures 0 0 0
flaky 0 0 0
duration 11m 03s 740ms 10m 53s 254ms -10s 486ms

@philrenaud philrenaud added the backport/1.6.x backport to 1.6.x release line label Nov 29, 2023
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

I've left a minor inline comment; I also think we will need a changelog entry for this.

I tried testing this locally and I get the same error as the linked issue describes. I'm not sure if I am testing this wrong.

ui/app/components/job-editor.js Outdated Show resolved Hide resolved
@philrenaud
Copy link
Contributor Author

@jrasell I'm testing with the following jobspec (from your comment in the linked issue, I think):

variable "count" {}

job "example" {
  group "cache" {
    count = var.count
    task "redis" {
      driver = "docker"
      config {
        image = "redis:7"
      }
    }
  }
}

and running with nomad job run -var="count=4" ../nomad-job-specs/bug-empty-variables.nomad.hcl

I'm able to get the "start" button to fire it back up with a count of 4 in the following ways:

  • stop, and then immediately restart, via job index butons
  • stop, and then refresh, and restart via job index buttons
  • stop from elsewhere (cli nomad job stop _____ and open the web UI and start again

In all of these cases, if you happen to go to the definition tab for the job, you should see the count in the variables box:

image

Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM.

Worth noting I think we will also now need the 1.7 backport label as that release branch is now live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to restart a job from UI in 1.6.3
2 participants