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

Add optional "comment" field for emergency_shutoff #2604

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

allan-silva
Copy link
Contributor

@allan-silva allan-silva commented Jul 29, 2022

  • Add comment field to emergency shutoff model
  • Add comment field to api
  • Add comment field to Balrog UI
  • Do manual tests on ui
  • Check possible regression for SpeedDial, click fires on disabled elements. Or file a new issue...

Changes on balrogui:
image
image
image
image

Resolves #1862

<Button
disabled={actionExecuting}
onClick={onClose}
action={actions => actions && actions.focusVisible()}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This behavior (fucusVisible()) makes typing the comment impossible. Seems not a big problem remove it. Let me know if has any other approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gabrielBusta may have input on this, I'm afraid this is beyond me :/

Copy link
Member

@gabrielBusta gabrielBusta Aug 17, 2022

Choose a reason for hiding this comment

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

I am not worried about it, but there might be a reason the code is calling focusVisible there. So I will take a closer look

Copy link
Member

Choose a reason for hiding this comment

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

@jcristau this code was focusing / highlighting the cancel button on the dialogs (i.e. the signing-off pop-ups) This was probably done so pressing enter would cancel the action / close the pop-up.

I think this change is an improvement. Now we can tab through the buttons in the dialogs and press enter to "click" them (this is the way they should behave imo). Also the button wont take away the focus from other UI elements we might want to put in the body of these dialogs (e.g. @allan-silva's TextField)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gabrielBusta Thanks for take a close look on this!

Add comment field on spec; Insert comment on database

Add comment information on balrog ui
@allan-silva
Copy link
Contributor Author

@jcristau My last contribution was long time ago, let me know if I missed any step.

Copy link
Contributor

@gbrownmozilla gbrownmozilla 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 to me. Thank you very much!

Since @jcristau originally opened the issue, I'd like him to give final approval here; he is on vacation currently - hope you don't mind waiting a couple of weeks.

@allan-silva
Copy link
Contributor Author

@gbrownmozilla no problem.
Thanks!

Copy link
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

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

A couple of nits but this looks great. (Not approving just yet because I'd like to play with it locally, but I do want to get to it shortly.)

src/auslib/db.py Outdated
@@ -2912,6 +2912,7 @@ def __init__(self, db, metadata, dialect):
metadata,
Column("product", String(15), nullable=False, primary_key=True),
Column("channel", String(75), nullable=False, primary_key=True),
Column("comment", String(500), nullable=True),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's omit nullable=True, it's the default and we don't seem to have it anywhere else

<Button
disabled={actionExecuting}
onClick={onClose}
action={actions => actions && actions.focusVisible()}>
Copy link
Contributor

Choose a reason for hiding this comment

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

@gabrielBusta may have input on this, I'm afraid this is beyond me :/


def test_get_notfound(self):
resp = self._get("/emergency_shutoff/foo/bar")
self.assertStatusCode(resp, 404)

def test_create(self):
data = {"product": "Thunderbird", "channel": "release"}
data = {"product": "Thunderbird", "channel": "release", "comment": "Thunderbird panic!()"}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep a test for POST to /emergency_shutoff without a comment, to make sure that still works.

Copy link
Member

@gabrielBusta gabrielBusta left a comment

Choose a reason for hiding this comment

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

Looks good to me. Deferring to @jcristau for final approval here. Thank you!

@gabrielBusta gabrielBusta dismissed their stale review August 18, 2022 16:32

didn't mean to ask for changes

Copy link
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks again @allan-silva!

@jcristau jcristau merged commit 3601d03 into mozilla-releng:main Aug 19, 2022
@allan-silva allan-silva deleted the issue-1862 branch August 19, 2022 22:10
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.

please provide an optional "comment" field for emergency_shutoff
4 participants