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] Fix: upload jobspec button into release/1.8.x #23562

Conversation

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

Backport

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

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


At some point recently, the upload jobspec button (on the Job Run page) stopped working and I've yet to find a good reason why.

The job editor component uses what's called a render modifier in Ember. It uses a library to help add syntactical sugar to do this.

(Modifier TLDR: it "modifies" an existing HTML element, like a <div> in this case, instead of creating a new one in an Ember context. This is useful for codemirror, our text editor, because it needs to exist outside of an Ember context for lifecycle reasons)

There's a lifecycle hook in modifiers written this way called modify(), and there were previously ones called didUpdateArguments() and didUpdateArguments(). Previously, we'd set this up to use didUpdateArguments to let the code-mirror modifier, but per the library's migrations guide, this is/was being deprecated.

Problem is, modify() is a lifecycle hook that happens both on initial load and on content update and on external-attribute (like the "should word-wrap" property, etc.) and bundling everything into modify() over-compounds this pattern a bit.

This PR makes it so that we still use didUpdateArguments(), but as a conditional method call from modify().

To test:

Head to the jobs index page, click "Run Job", click "Upload", and you should now see the text of your .hcl upload appear in the text editor. In previous (1.8.x anyway) versions this should not work.

image


Overview of commits

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/b-ui/upload-jobspec-button-fix/thoroughly-neat-sole branch from 474b955 to 4fb6cf4 Compare July 11, 2024 18:55
@vercel vercel bot temporarily deployed to Preview – nomad-ui July 11, 2024 18:59 Inactive
Copy link

Ember Test Audit comparison

release/1.8.x 4fb6cf4 change
passes 1565 1565 0
failures 2 2 0
flaky 0 0 0
duration 000ms 000ms -000ms

@philrenaud philrenaud merged commit c5f24ff into release/1.8.x Jul 12, 2024
13 of 16 checks passed
@philrenaud philrenaud deleted the backport/b-ui/upload-jobspec-button-fix/thoroughly-neat-sole branch July 12, 2024 20:58
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 Dec 28, 2024
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.

2 participants