Skip to content
Merged
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-12685-fixed-1755272623309.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Missing `firewall_apply` event messages ([#12685](https://github.com/linode/manager/pull/12685))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Temporarily fix Linode Interface `firewall_device_add` event message ([#12685](https://github.com/linode/manager/pull/12685))
51 changes: 44 additions & 7 deletions packages/manager/src/features/Events/factories/firewall.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,55 @@
import { capitalize } from '@linode/utilities';
Copy link
Contributor Author

@coliu-akamai coliu-akamai Aug 15, 2025

Choose a reason for hiding this comment

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

I'd been wondering if we want to have these firewall apply messages given that we already have firewall device add/remove messages. There is at least one use case firewall apply covers that device add/remove doesn't, but I haven't seen it often - it's when firewall_apply fails (no corresponding add/remove message):

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess apply is for updates?

Copy link
Member

Choose a reason for hiding this comment

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

This is just my opinion, but I like the idea of surfacing these events for transparency and consistency with the API. I'm sure one day we'll build a way for users to filter events to their liking so they can hide these if they need to

But, to be fair, the firewall_apply event has been around for a while now and no customer has requested that we support that I know of.... So I don't know πŸ˜–

import * as React from 'react';

import { formattedTypes } from 'src/features/Firewalls/FirewallDetail/Devices/constants';

import { EventLink } from '../EventLink';

import type { PartialEventMap } from '../types';
import type { Event } from '@linode/api-v4';
import type { FirewallDeviceEntityType } from '@linode/api-v4';

const entityPrefix = (e: Event) => {
const type = e?.entity?.type ? capitalize(e.entity.type) : null;

return type ? (
<>
{type} <EventLink event={e} to="entity" />{' '}
</>
) : null;
};

export const firewall: PartialEventMap<'firewall'> = {
firewall_apply: {
notification: (e) => (
<>
Firewall <EventLink event={e} to="entity" /> has been{' '}
<strong>applied</strong>.
</>
),
failed: (e) => {
return (
<>
{entityPrefix(e)} Firewall update could <strong>not</strong> be{' '}
<strong>applied</strong>.
</>
);
},
finished: (e) => {
return (
<>
{entityPrefix(e)} Firewall update has been <strong>applied</strong>.
</>
);
},
scheduled: (e) => {
return (
<>
{entityPrefix(e)} Firewall update is <strong>scheduled</strong>.
</>
);
},
started: (e) => {
return (
<>
{entityPrefix(e)} Firewall update has <strong>started</strong>.
</>
);
},
},
firewall_create: {
notification: (e) => (
Expand All @@ -34,8 +69,10 @@
firewall_device_add: {
notification: (e) => {
if (e.secondary_entity?.type) {
// TODO - Linode Interfaces [M3-10447] - clean this up when API ticket [VPC-3359] is completed

Check warning on line 72 in packages/manager/src/features/Events/factories/firewall.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Complete the task associated to this "TODO" comment. Raw Output: {"ruleId":"sonarjs/todo-tag","severity":1,"message":"Complete the task associated to this \"TODO\" comment.","line":72,"column":12,"nodeType":null,"messageId":"completeTODO","endLine":72,"endColumn":16}
const secondaryEntityName =
formattedTypes[e.secondary_entity.type as FirewallDeviceEntityType];
formattedTypes[e.secondary_entity.type as FirewallDeviceEntityType] ??
'Linode Interface';
return (
<>
{secondaryEntityName} <EventLink event={e} to="secondaryEntity" />{' '}
Expand Down