-
Notifications
You must be signed in to change notification settings - Fork 391
tech-story - [UIE-9306]: Improve user seeding (follow up) #12978
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
Conversation
f0e68b6 to
2b61ffe
Compare
fd5a7f9 to
59faae5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves user seeding functionality by separating default and parent/child user seeding into distinct seeders, fixing account switching bugs, and ensuring better mock data integrity.
- Split user seeding into two distinct seeders: default users and parent users with child accounts/delegations
- Removed dependency on actual profile data from API calls during seeding
- Enhanced parent user seeding to create comprehensive hierarchical structures with child accounts and delegate users
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/manager/src/mocks/types.ts | Added new seeder IDs for default and parent user types |
| packages/manager/src/mocks/presets/crud/seeds/utils.ts | Updated cleanup logic to handle both user seeder types |
| packages/manager/src/mocks/presets/crud/seeds/users.ts | Split into separate seeders and removed API dependency |
| packages/manager/src/mocks/presets/crud/seeds/index.ts | Updated exports to include both user seeders |
Comments suppressed due to low confidence (1)
packages/manager/src/mocks/presets/crud/seeds/users.ts:1
- The original 'users:crud' case has been removed from the switch statement, but the corresponding case should be preserved or explicitly handled to maintain backward compatibility.
import { childAccountFactory } from '@linode/utilities';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Cloud Manager UI test results🔺 2 failing tests on test run #8 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts" |
||||||||||||||||||||
| const userAccountPermissionsEntries: UserAccountPermissionsEntry[] = []; | ||
| const userEntityPermissionsEntries: UserEntityPermissionsEntry[] = []; | ||
|
|
||
| userSeeds.forEach((user) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional style: I see a mix of forEach and for (const x of y). Maybe we could prefer one over another
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's fair. I'll probably leave this as is cause this code really isn't the best overall granted it is not optimized for our users. One day someone may clean that up but for now we just really care that it works for devs 👍
* distinctive seeding * handle dupe records * Update packages/manager/src/mocks/presets/crud/seeds/utils.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * lint --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description 📝
Follow up to #12957
Ensuring mock data integrity and facilitate user seeding.
👉 No changeset needed, it's a follow up to work already implemented and previously committed.
Changes 🔄
Scope 🚢
Upon production release, changes in this PR will be visible to:
Preview 📷
This PR does not affect client side code
How to test 🧪
Prerequisites
Verification steps
From either a Parent or Child account,
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
As an Author, before moving this PR from Draft to Open, I confirmed ✅