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

fix: [M3-8492] - Create Linode Firewall warning not appearing #10838

Merged

Conversation

hkhalil-akamai
Copy link
Contributor

Description 📝

Fixes a bug causing the Firewall warning to not appear after the user assigns and then clears the firewall select during the create flow.

Changes 🔄

  • Update the firewall_id interface in CreateLinodePayload to not accept null values (i.e., number | undefined)
  • Refactor SelectFirewallPanel and associated types in Create v1 to use undefined instead of -1 when the firewall field is cleared
  • Remove a redundant useEffect

Target release date 🗓️

9/3

Preview 📷

Before After
Create v2
Screen.Recording.2024-08-26.at.4.16.35.PM.mov
Screen.Recording.2024-08-26.at.4.35.26.PM.mov
Create v1
Screen.Recording.2024-08-26.at.4.20.41.PM.mov
Screen.Recording.2024-08-26.at.4.22.39.PM.mov

How to test 🧪

Prerequisites

Enable Secure VM notices by adding secure_vm_notices: 'always' in the preference editor.

Reproduction steps

  • Select and then clear the firewall field in the Linode Create flows (v1 and v2)
  • Click the "Create Linode" button
  • Observe that the Firewall authorization warning banner does not appear
    • In Create v1, the form is submitted and the Linode is created
    • In Create v2, the Create Linode button becomes disabled

Verification steps

  • Follow the reproduction steps
  • Verify that the Firewall authorization banner always appears after clicking the Create Linode button when no firewall is assigned

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use undefined instead of -1 when clearing the firewall field.

Comment on lines 48 to 52
<Button buttonType="outlined" onClick={onOpenAPIAwareness}>
<Button
buttonType="outlined"
disabled={disableSubmitButton}
onClick={onOpenAPIAwareness}
>
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 matches the behavior from create v1.

Copy link
Member

Choose a reason for hiding this comment

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

Should we be excluding this from the API/CLI payloads?

Screenshot 2024-08-26 at 5 00 34 PM

Comment on lines -26 to -30
useEffect(() => {
if (isNotNullOrUndefined(watchFirewall)) {
clearErrors('firewallOverride');
}
}, [clearErrors, watchFirewall]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant to delete this useEffect in an earlier PR.

Comment on lines -906 to -908
checkedFirewallAuthorizaton={
this.state.checkedFirewallAuthorization
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

checkedFirewallAuthorization is now passed on this line.

checkedFirewallAuthorizaton: boolean;
checkedFirewallAuthorization: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo:

checkedFirewallAuthorization
                         ^

@hkhalil-akamai hkhalil-akamai marked this pull request as ready for review August 26, 2024 20:52
@hkhalil-akamai hkhalil-akamai requested a review from a team as a code owner August 26, 2024 20:52
@hkhalil-akamai hkhalil-akamai requested review from jdamore-linode and bnussman-akamai and removed request for a team August 26, 2024 20:52
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

This is probably unrelated but I'm seeing a validateDOMNesting warning

Screenshot 2024-08-26 at 4 58 20 PM

Comment on lines 48 to 52
<Button buttonType="outlined" onClick={onOpenAPIAwareness}>
<Button
buttonType="outlined"
disabled={disableSubmitButton}
onClick={onOpenAPIAwareness}
>
Copy link
Member

Choose a reason for hiding this comment

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

Should we be excluding this from the API/CLI payloads?

Screenshot 2024-08-26 at 5 00 34 PM

packages/api-v4/src/linodes/types.ts Outdated Show resolved Hide resolved
Copy link

Coverage Report:
Base Coverage: 82.73%
Current Coverage: 82.74%

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Not seeing any regressions ✅

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Fix confirmed! well done

unrelated to this PR and non-blocking, we should handle the banner on mobile a bit better

Screenshot 2024-08-28 at 16 45 14

Screenshot 2024-08-28 at 16 44 54

@hkhalil-akamai hkhalil-akamai merged commit 2c891f9 into linode:develop Aug 28, 2024
19 checks passed
@hkhalil-akamai hkhalil-akamai deleted the M3-8492-firewall-override-bug branch August 28, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants