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

upcoming: [M3-9088] - Add and update /v4/networking endpoints and types for Linode Interfaces #11559

Merged
merged 11 commits into from
Jan 27, 2025

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Jan 23, 2025

Description 📝

Updates existing and adds new /v4/networking endpoints for the Linode Interfaces project in accordance with API spec

Added a changeset for the Manager package after updating some factories. Is this changeset necessary? can remove it otherwise

How to test 🧪

  • Confirm changes match the API spec
  • Confirm generating a compliant firewall still works as expected
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

Comment on lines +12 to +16
vpc_nat_1_1?: {
address: string;
subnet_id: number;
vpc_id: number;
} | null;
Copy link
Contributor Author

@coliu-akamai coliu-akamai Jan 23, 2025

Choose a reason for hiding this comment

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

adding this field (looks like we were missing it previously). It got returned either as the object or a null value (or was omitted) when I tested the endpoint

*/
export const getTemplate = (templateSlug: string) =>
export const getTemplate = (templateSlug: FirewallTemplateSlug) =>
Copy link
Contributor Author

@coliu-akamai coliu-akamai Jan 23, 2025

Choose a reason for hiding this comment

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

These two endpoints (getTemplates and getTemplate) were added during the Securing VMs project (see internal ticket - I linked the spec there). I updated the templateSlug type to be more specific - I believe these are the three templates that exist so far, but am not sure. Since there may be a possibility for more slugs I'm not aware of, happy to switch back to string too

I've currently typed it as
export type FirewallTemplateSlug = 'akamai-non-prod' | 'vpc' | 'public'
See internal comments on spec about some naming updates - when testing the endpoint, I saw that vpc and public are the returned slugs

Comment on lines -17 to -22
entities: {
id: number;
type: FirewallDeviceEntityType;
label: string;
url: string;
}[];
Copy link
Contributor Author

@coliu-akamai coliu-akamai Jan 23, 2025

Choose a reason for hiding this comment

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

replacing this with FirewallDeviceEntity since it already exists

export interface FirewallDeviceEntity {
  id: number;
  type: FirewallDeviceEntityType;
  label: string;
  url: string;
}

@coliu-akamai coliu-akamai marked this pull request as ready for review January 23, 2025 20:58
@coliu-akamai coliu-akamai requested a review from a team as a code owner January 23, 2025 20:58
@coliu-akamai coliu-akamai requested review from carrillo-erik, abailly-akamai and bnussman-akamai and removed request for a team January 23, 2025 20:58
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.

Looks great! Thanks for those extra fixes in addition to the new types

Copy link

github-actions bot commented Jan 24, 2025

Coverage Report:
Base Coverage: 79.07%
Current Coverage: 79.07%

@coliu-akamai coliu-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Jan 24, 2025
@coliu-akamai coliu-akamai requested a review from a team as a code owner January 27, 2025 18:10
@coliu-akamai coliu-akamai requested review from jdamore-linode and removed request for a team January 27, 2025 18:10
@bnussman-akamai bnussman-akamai removed the Add'tl Approval Needed Waiting on another approval! label Jan 27, 2025
@bnussman-akamai bnussman-akamai added the Approved Multiple approvals and ready to merge! label Jan 27, 2025
@coliu-akamai
Copy link
Contributor Author

coliu-akamai commented Jan 27, 2025

some updates:

  • commented on internal spec asking about the fingerprint/version fields for some FirewallTemplate type clarification
  • in the meantime, created separate type FirewallTemplateRules and updated FirewallRules (keeping fingerprint/version as non optional fields to be up to date with what the api returns)

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 482 passing tests on test run #12 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing482 Passing2 Skipped103m 21s

@coliu-akamai coliu-akamai merged commit b721a04 into linode:develop Jan 27, 2025
23 checks passed
@coliu-akamai coliu-akamai deleted the m3-9088 branch January 27, 2025 23:08
Copy link

cypress bot commented Jan 27, 2025

Cloud Manager E2E    Run #7132

Run Properties:  status check passed Passed #7132  •  git commit b721a04380: upcoming: [M3-9088] - Add and update `/v4/networking` endpoints and types for Li...
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #7132
Run duration 28m 13s
Commit git commit b721a04380: upcoming: [M3-9088] - Add and update `/v4/networking` endpoints and types for Li...
Committer Connie Liu
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 482
View all changes introduced in this branch ↗︎

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! Linode Interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants