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] bugfix: when hitting the "start" button on a job page, if it has no submission data, fallback to raw json definition #18621

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Sep 29, 2023

In Nomad 1.6, we introduced HCL-in-the-UI using a new /submissions endpoint among other things.

Shortly after the release, we realized we missed a spot: stop/starting via the UI would not maintain the submission data. My initial fix for this solved the issue of maintaining HCL, but caused a new bug: jobs that lacked submission data (perhaps they were submitted via curl with just the json spec, and without HCL) would 404 on /submission and fail to progress through to /parse and submit.

This PR provides a fallback to the initial method in cases where the /submission request fails.

Resolves #18547
Resolves #18536

@philrenaud philrenaud requested a review from tgross September 29, 2023 14:48
@philrenaud philrenaud self-assigned this Sep 29, 2023
@philrenaud philrenaud linked an issue Sep 29, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Ember Test Audit comparison

main e7fa4b3 change
passes 1533 1533 0
failures 1 1 0
flaky 0 0 0
duration 000ms 000ms -000ms

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! 👍

It occurs to me this whole feature is a bit racy in that another user can submit a new job definition between the time we get the job spec and re-run it. As a future improvement we might want to consider using EnforceIndex so that someone pressing the Start button can't accidentally roll-back the job. But that shouldn't be part of this bug fix!

@philrenaud philrenaud force-pushed the 18547-job-cannot-be-restarted-from-ui-in-162 branch from 4da2a7f to e7fa4b3 Compare September 29, 2023 16:30
@dhung-hashicorp dhung-hashicorp added hcc/cst Admin - internal and removed hcc/cst Admin - internal labels Sep 29, 2023
@philrenaud philrenaud added the backport/1.6.x backport to 1.6.x release line label Sep 29, 2023
@philrenaud philrenaud merged commit 8da4046 into main Sep 29, 2023
15 checks passed
@philrenaud philrenaud deleted the 18547-job-cannot-be-restarted-from-ui-in-162 branch September 29, 2023 18:52
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Job cannot be restarted from UI in 1.6.2 Could not start job with variables after stopping (UI)
3 participants