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

Backport of [ui] "Clone and Edit" functionality for versions into release/1.9.x #24568

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #24168 to be assessed for backporting due to the inclusion of the label backport/1.9.x.

The below text is copied from the body of the original PR.


Adds "Clone and Edit" alongside "Revert Version" on the Versions page:

There are two functional paths here:

  • Cloning as a new version of the job
  • Cloning as a new job altogether

In each of these cases, we also have a split on "fetchRawDefinition" (fetches the submitted HCL or JSON jobspec) or "fetchRawSpecification" (the pre-1.5 Nomad way of getting job details, which the UI falls back to if submission/definition is not available). A lot of the duplicate-looking code in this PR is to address both paths.

Similarly, there are some safeguards included in this PR for things like ensuring users who clone to a new job change the job's name, lest it adds it as a new version unintentionally.

image

Because we're passing template strings via query params, this means you can use ?sourceString= on the jobs run page to send someone a readily-editable job spec, using a URL like this.

This also adds a few UX conveniences like prompting a user to "run as a new job instead" if they try updating a job definition and changing its name (which fails a plan request), and reminding them to change the job name in the event they try to clone as a new one
image

Resolves #24156


Overview of commits

Copy link

Ember Test Audit comparison

release/1.9.x 3658e3f change
passes 1580 1587 +7
failures 5 5 0
flaky 0 0 0
duration 000ms 000ms -000ms

@philrenaud philrenaud merged commit 7a5aba5 into release/1.9.x Dec 1, 2024
16 of 17 checks passed
@philrenaud philrenaud deleted the backport/24156-ui-versions-revert-version-improvements/entirely-thorough-mosquito branch December 1, 2024 14:02
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.

2 participants