Skip to content

feat: [M3-9984] Add support for entities to have multiple firewalls on CM #12241

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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented May 16, 2025

Description 📝

  • Adds support for multiple firewalls for Linodes/Nodebalancers
  • Updates Linode/Nodebalancer firewalls table to continue adding firewalls even after one has already been assigned
  • Update NodeBalancer summary panel to show all firewalls

See #12220 (assigning multiple firewalls from Firewall Detail page) and #12176 Linode Entity Details firewall changes

Preview 📷

Before After
image image
image image

How to test 🧪

  • Confirm you can add multiple firewalls to a Linode/NodeBalancer from their Firewall tables (see Linode networking tab / NodeBalancer settings tab) and that firewalls appear in the table
  • Confirm all firewalls appear in the NodeBalancer's summary page
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@coliu-akamai coliu-akamai self-assigned this May 16, 2025
@coliu-akamai coliu-akamai added the Firewalls Related to Firewalls label May 16, 2025
Copy link
Contributor Author

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

image

Thinking about adding the disable/enable button s ^ in the Firewall Landing page to an entity's Firewall table, but it might cause a more annoying UX experience than it's worth (lmk what you think!):

  • if entity 1 and entity 2 share disabled firewall A, but entity 2 also has enabled firewall B, trying to enable Firewall A from entity 1's table will cause an error - feels like it could be annoying
  • If a firewall is default, trying to disable will error

another idea: I could just have the Disable firewall button show up in the entity's firewall table (+ grey it out if it is a default firewall). That way, a user can quickly disable that firewall to add an enabled one from their entity's Firewall table if they wish to do so

Comment on lines +59 to +64
const optionsFilter = (firewall: Firewall) => {
return (
!(hasEnabledFirewall && firewall.status === 'enabled') &&
!attachedFirewalls?.some((fw) => fw.id === firewall.id)
);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot assign a firewall to our entity if

  • if our entity already has this firewall
  • our entity has an enabled firewall and this firewall is enabled

rather than filtering out, should I just let the API return an error if the user can't assign the firewall? (I think I prefer filtering out ineligible firewalls though)

Copy link
Member

Choose a reason for hiding this comment

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

I like API errors personally because they help the user understand why something isn't allowed, but UX tends to like not letting users run into them

If we hide some options, maybe we should add some copy or helper text or tooltip or noOptionsMessage to help inform them about the "1 active firewall" limitation

We can let UX decide, but my vote will always be let the user see the API error 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

How can I assign multiple firewalls to a linode/nodebalancer if the "Add Firewall" option only allows assigning one firewall at a time, and only when no firewall is currently assigned? Am I missing something?

This is what I'm seeing (same in the case of nodebalancer):

Screen.Recording.2025-05-21.at.4.11.28.PM.mov

@coliu-akamai
Copy link
Contributor Author

going to open this up for review to collect feedback + will address when I'm back!

@coliu-akamai coliu-akamai marked this pull request as ready for review May 16, 2025 21:03
@coliu-akamai coliu-akamai requested a review from a team as a code owner May 16, 2025 21:03
@coliu-akamai coliu-akamai requested review from bnussman-akamai and pmakode-akamai and removed request for a team May 16, 2025 21:03
Comment on lines +59 to +64
const optionsFilter = (firewall: Firewall) => {
return (
!(hasEnabledFirewall && firewall.status === 'enabled') &&
!attachedFirewalls?.some((fw) => fw.id === firewall.id)
);
};
Copy link
Member

Choose a reason for hiding this comment

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

I like API errors personally because they help the user understand why something isn't allowed, but UX tends to like not letting users run into them

If we hide some options, maybe we should add some copy or helper text or tooltip or noOptionsMessage to help inform them about the "1 active firewall" limitation

We can let UX decide, but my vote will always be let the user see the API error 😄


const { data: firewalls, error, isLoading } = useAllFirewallsQuery();
const firewallOptions =
options || (optionsFilter ? firewalls?.filter(optionsFilter) : firewalls);
Copy link
Member

Choose a reason for hiding this comment

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

Not really sure if it matters, but ?? might be better here

Suggested change
options || (optionsFilter ? firewalls?.filter(optionsFilter) : firewalls);
options ?? (optionsFilter ? firewalls?.filter(optionsFilter) : firewalls);

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Missing Changeset labels May 20, 2025
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 6 failing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
6 Failing593 Passing4 Skipped135m 54s

Details

Failing Tests
SpecTest
nodebalancer-settings.spec.tsCloud Manager Cypress Tests→Firewalls » Firewalls
linode-network.spec.tsCloud Manager Cypress Tests→Firewalls » Firewalls
lke-update.spec.tsCloud Manager Cypress Tests→LKE cluster updates→LKE cluster updates for DC-specific prices » LKE cluster updates→LKE cluster updates for DC-specific prices
lke-update.spec.tsCloud Manager Cypress Tests→LKE cluster updates→LKE cluster updates for DC-specific prices » LKE cluster updates→LKE cluster updates for DC-specific prices
lke-update.spec.tsCloud Manager Cypress Tests→LKE cluster updates→LKE cluster updates for DC-specific prices » LKE cluster updates→LKE cluster updates for DC-specific prices
lke-update.spec.tsCloud Manager Cypress Tests→LKE cluster updates→LKE cluster updates for DC-specific prices » LKE cluster updates→LKE cluster updates for DC-specific prices

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/nodebalancers/nodebalancer-settings.spec.ts,cypress/e2e/core/linodes/linode-network.spec.ts,cypress/e2e/core/kubernetes/lke-update.spec.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add'tl Approval Needed Waiting on another approval! Firewalls Related to Firewalls
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

5 participants