Skip to content

upcoming: [M3-9114] - Add support for Linode Interfaces in Firewalls AddLinodeDrawer #12035

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 19 commits into
base: develop
Choose a base branch
from

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Apr 15, 2025

Description 📝

  • adds support for creating Linode Interface devices in firewalls AddLinodeDrawer
  • In the Create Firewall drawer, filter out Linode interfaces (we're looking into potential UIs for this)

Changes 🔄

  • Update AddLinodeDrawer to keep track of Linode Interface information and handle adding interface devices
  • Use useEffect to filter the Linodes we can add due to needing to fetch a linode's linode interfaces 🥲

Target release date 🗓️

4/24 ish, 4/22 if possible

Preview 📷

Before After
image image

create firewall drawer:

How to test 🧪

Have the customer tag + checkout this pr locally or use preview link

  • Have a linode using legacy interfaces
  • li-a) Have a linode using new interfaces, with only one vlan interface
  • li-a2) Have a linode using new interfaces, but have 0 interfaces
  • li-b) Have a linode using new interfaces, with only one (non vlan) interface
  • li-c) Have a linode using new interfaces, with two interfaces (vpc and public)
  • li-d) have a linode using new interfaces, with two interfaces (vlan and non vlan)

Verification steps

  • Confirm you can add all linodes to a firewall (except li-a and li-a2, which should not appear in the firewall drop down)
  • confirm selecting li-b and li-d does not show the interface select (they only have one interface that can be added to a firewall)
  • confirm li-c shows the interface drop down as long as both interfaces have not yet been assigned to a firewall. once one of li-c's interfaces get assigned, an Interface select should no longer appear
  • Confirm error handling
  • confirm state makes sense if some interfaces/linodes fail vs others being able to be assigned

Create Firewall drawer

  • confirm Linode Interface linodes don't appear in assign linode list
  • confirm notice (in screenshot) appears
  • confirm ^ notice hidden if feature flag is off
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 Apr 15, 2025
@coliu-akamai coliu-akamai force-pushed the m3-9114 branch 3 times, most recently from e534839 to 3d81172 Compare April 16, 2025 14:58
@coliu-akamai coliu-akamai changed the title upcoming: [M3-9114] - Add support for Linode Interfaces in AddLinodeDrawer for Firewalls upcoming: [M3-9114] - Add support for Linode Interfaces in Firewalls AddLinodeDrawer Apr 16, 2025
@coliu-akamai coliu-akamai added the Help Wanted Teamwork makes the dream work! label Apr 16, 2025
Comment on lines +360 to +361
filterLinodes();
}, [allLinodes, assignedInterfaceIds, assignedLinodes, readOnlyLinodeIds]);
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 am not sure what the best approach to filter out Linodes is.
Previously we could just pass in linodeOptionsFilter to the LinodeSelect and just directly call linodes.filter(linodeOptionsFilter). This doesn't work anymore now that we need to fetch a Linode's interfaces to determine if it can be assigned to a firewall (updating linodeOptionsFilter to be an async function)

I've settled on useEffect but I'm not too confident about this approach, especially bc I had to memoize a bunch of the dependencies (or run into an infinite loop 😬)
My react knowledge is lacking...anyone have other ideas? 🥲

Copy link
Member

@bnussman-akamai bnussman-akamai Apr 21, 2025

Choose a reason for hiding this comment

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

Here's my attempt at simplifying things: https://github.com/coliu-akamai/manager/compare/m3-9114...bnussman-akamai:firewall-poc?expand=1

I was able to get rid of the useEffect without any regressions (i think) and I was able to clean up overall logic a bit, although the POC it is unfinished

I didn't get error handling working and I didn't handle VLAN interfaces gracefully, but take a look and let me know what you think. If you like any of this better, you could try introducing it into your PR.

With that said, I don't want to de-rail your current progress and slow us down, so if you'd rather we refactor this as a follow up effort, just let me know.

Copy link
Contributor Author

@coliu-akamai coliu-akamai Apr 21, 2025

Choose a reason for hiding this comment

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

thanks Banks, will take a look! definitely interested in getting rid of the useEffect
for now since we're unsure of timelines and potentially proceeding with the out of cycle release, I'd like to plan this refactor as a follow up. However, if we hear that dates get pushed back, then I'll look into making the changes here - how does that sound?
(edit: unless if I finish my current ticket soon and have more time, will look into refactoring here)

Copy link
Member

Choose a reason for hiding this comment

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

Works for me!

Comment on lines 400 to 402
{isLinodeInterfacesEnabled &&
linodesWithMultiInterfaces.map((linode) => (
<Select
Copy link
Contributor Author

@coliu-akamai coliu-akamai Apr 16, 2025

Choose a reason for hiding this comment

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

Discussed with UX - since it's very unlikely for users to have Linodes with multiple interfaces, we're ok with having these additional selects on the AddLinodeDrawer to allow for multiselecting Linodes. iirc we're also going with a single select for interfaces to reduce complexity (? will double check)

🤔 May circle back to design esp if this drawer ends up needing a lot of scrolling though... Wondering if combining something like the CreateFirewallDrawer custom vs template firewall select + the Subnet Assign drawer for interface devices could be viable

@coliu-akamai coliu-akamai marked this pull request as ready for review April 16, 2025 16:46
@coliu-akamai coliu-akamai requested a review from a team as a code owner April 16, 2025 16:46
@coliu-akamai coliu-akamai requested review from dwiley-akamai, hasyed-akamai and bnussman-akamai and removed request for a team April 16, 2025 16:46
interfaceLinodes.map(async (linode) => {
const linodeId = linode.id;
const interfaces = await getLinodeInterfaces(linodeId);
// vlan interfaces cannot have a firewall assigned to them
Copy link
Contributor

Choose a reason for hiding this comment

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

Somewhat tangentially, I noticed this earlier today

Screenshot 2025-04-17 at 1 18 20 PM

Should we even display the firewall field if it's not supported for VLANs? Or should we at least disable them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup I think UX will have us hiding the VLAN interface firewall field eventually, will confirm + make a follow up ticket to track it and other UX feedback soon

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.

Nice job making all of this come together 🙏

@cpathipa cpathipa added the Approved Multiple approvals and ready to merge! label Apr 22, 2025
@coliu-akamai coliu-akamai added Firewalls Related to Firewalls and removed Help Wanted Teamwork makes the dream work! Ready for Review labels Apr 22, 2025
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #21 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing564 Passing5 Skipped124m 23s

Details

Failing Tests
SpecTest
rebuild-linode.spec.tsCloud Manager Cypress Tests→rebuild linode » rebuild linode

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/rebuild-linode.spec.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Firewalls Related to Firewalls Linode Interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants