Skip to content

Conversation

@abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Oct 3, 2025

Description 📝

Pretty large refactor to leverage the whole user mocking + handles IAM & Parent / Child

Changes 🔄

  • user mocking & seeding
    • associated permission model
    • associated parent/child model
  • entity mocking handling (global, for every typed entity)
  • improve mock utilities

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Target release date 🗓️

How to test 🧪

Prerequisites

Verification steps

👉 Turn on MSW CRUD and:

  • ✅ Confirm current user (your actual user) is fed to the mockState
  • ✅ Confirm mocking is enabled when:
    • creating new users
    • updating a user
    • deleting a user
  • ✅ Confirm seeding works for users
  • ✅ Confirm entities get created/deleted when adding/removing a new linode (for instance)
    • you can confirm this by inspecting the indexedDB store in dev inspector
  • ✅ Confirm indexedDB:
    • handles child accounts (created for parent users)
    • delegation
    • permissions and roles
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 tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@abailly-akamai abailly-akamai changed the title [UIE-9306] feat: [UIE-9306] IAM / RBAC MSW Users, Delegation and Parent /Child Updates Oct 7, 2025
| 'view_billing_invoice'
| 'view_billing_payment'
| 'view_invoice_item'
| 'view_payment_method';
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 were missing a lot of permissions - i added those based on the actual response from the API

return [k, initialValue];
}
})
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need for manually adding those anymore 😫 🎉

},
],
}) as IamAccess,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update the factory to be much closer to the actual response

default:
return entity;
}
};
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 is unfortunately necessary since we have divergent naming conventions between mocked entities and actual entity types. Refactoring mocks would bring in too much work..

'stackscript',
'volume',
'vpc',
];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only those get automatically added to entities when being created

@abailly-akamai abailly-akamai changed the title feat: [UIE-9306] IAM / RBAC MSW Users, Delegation and Parent /Child Updates feat: [UIE-9306] IAM / RBAC MSW CRUD Users, Delegation and Parent /Child Updates Oct 7, 2025
@abailly-akamai abailly-akamai marked this pull request as ready for review October 7, 2025 15:03
@abailly-akamai abailly-akamai requested a review from a team as a code owner October 7, 2025 15:03
@abailly-akamai
Copy link
Contributor Author

@aaleksee-akamai @mpolotsk-akamai

I know this is a large PR - i don't expect everything to be quite perfect for mock data quite yet, but this should be a decent effort to match API behavior as far as we know it. Once merged, we will likely need to tweak some of the mocking so the goal is to merge and iterate where needed

One thing to remember: the real CRUD mode (actually interacting with entities and feature) should be done with mock data we create in the store. SEED data always reset after a page reload so while it supports the same CRUD methods it will not persist.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 3 failing tests on test run #11 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
3 Failing833 Passing13 Skipped40m 43s

Details

Failing Tests
SpecTest
create-firewall.spec.tsCloud Manager Cypress Tests→create firewall » "before all" hook for "creates a firewall without a linode"
create-firewall.spec.tsCloud Manager Cypress Tests→restricted user cannot create firewall » "before each" hook for "confirms the create button is disabled on the Firewall Landing page"
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » can clone a Linode from Linode details page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/firewalls/create-firewall.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts"

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Oct 8, 2025
@abailly-akamai abailly-akamai merged commit 97a44a1 into linode:develop Oct 8, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Oct 8, 2025
@abailly-akamai abailly-akamai added IAM Delegation Implementing the new Parent/Child delegation UI and removed Parent / Child Account labels Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IAM Delegation Implementing the new Parent/Child delegation UI IAM (Identity & Access Management)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants