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: Add job version revert buttons #10336

Merged
merged 16 commits into from
Apr 20, 2021
Merged

UI: Add job version revert buttons #10336

merged 16 commits into from
Apr 20, 2021

Conversation

backspace
Copy link
Contributor

@backspace backspace commented Apr 8, 2021

This adds a Revert two-step button to the JobVersions component for not-current versions, which redirects to the overview on success:

revert-redirect

It checks the job version before and after reversion to mitigate the edge case where reverting to an otherwise-identical version has no effect, as discussed in #10337. Wording tweaks welcome!

no-effect

It uses existing facilities for handling other errors and disabling the button when permissions are lacking.

Implementation notes:

  • the pre-and-post reversion job version-checking necessitated adding a watcher for the job record to the versions route to catch version changes originating elsewhere
  • to ensure the “No Changes” text and “X Changes” buttons are the same width, I added .is-fixed-width to boxed-section, would it be better in a new job-version.scss? Or elsewhere? 🤔 longing for Tailwind-esque facilities here
  • .has-fading-background for TSB is very specific to this context, with a white background that fades out to the left 🧐

This is a start, much to be determined/done.
@github-actions
Copy link

github-actions bot commented Apr 8, 2021

Ember Asset Size action

As of 4c9ec9c

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +4.67 kB +937 B
nomad-ui.css +318 B +53 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 Apr 8, 2021

Ember Test Audit comparison

main 4c9ec9c change
passes 1074 1078 +4
failures 0 0 0
flaky 0 0 0
duration 9m 25s 278ms 8m 45s 192ms -40s 086ms

😖 re the ever-growing styling interface
Placing this in boxed-section: questionable? Should there
be job-version.scss? 🧐
This happens twice in watchable-namespace-ids, maybe not
quite widely-used enough to extract? 🤔
@vercel vercel bot temporarily deployed to Preview – nomad April 14, 2021 14:43 Inactive
Without this, if the job’s current version is updated outside
the UI, the “Revert” button won’t be added to the formerly-
current version.
@backspace backspace marked this pull request as ready for review April 14, 2021 21:39
@backspace backspace added this to the 1.1.0 milestone Apr 14, 2021
@backspace backspace marked this pull request as draft April 16, 2021 16:16
@backspace
Copy link
Contributor Author

Re-drafted to add post-reversion redirection to overview, as suggested by @DingoEatingFuzz, which will also likely unintentionally fix the known bug 😆

@backspace
Copy link
Contributor Author

Okay, redirection added, now truly ready for review!

Copy link
Contributor

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

This looks good!

The only thing I'd like verification on (and maybe a test) is if the revert request is correct when not in the default namespace.

JobID: jobName,
JobVersion: jobVersion.number,
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I forget how this URL building stuff works. Is this going to append the namespace as a query param?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, I did manually test that but it makes sense to automate, how does c30917f look for that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good!

@github-actions
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 Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants