Skip to content

Conversation

@abailly-akamai
Copy link
Contributor

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

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 🔄

  • Prop up two different seeding for default user and parent/child users
    • separate seeding for users between default & parent/child ones
  • Improve filtering handling
  • fix bug with account switching (we can't fetch actual profile from the seeders)

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

Preview 📷

This PR does not affect client side code

How to test 🧪

Prerequisites

Verification steps

From either a Parent or Child account,

  • ✅ confirm the seeding of parent account, along with delegates
  • ✅ confirm signing in & out from Parent/Child accounts works
  • ✅ confirm data model works with new mock data (default, parent & child accounts)
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 self-assigned this Oct 10, 2025
@abailly-akamai abailly-akamai added the IAM Delegation Implementing the new Parent/Child delegation UI label Oct 10, 2025
@abailly-akamai abailly-akamai force-pushed the UIE-9306-fix branch 2 times, most recently from f0e68b6 to 2b61ffe Compare October 13, 2025 14:13
@abailly-akamai abailly-akamai marked this pull request as ready for review October 14, 2025 10:39
@abailly-akamai abailly-akamai requested a review from a team as a code owner October 14, 2025 10:39
Copy link
Contributor

Copilot AI left a 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.

@abailly-akamai abailly-akamai removed the request for review from a team October 14, 2025 10:41
abailly-akamai and others added 2 commits October 14, 2025 12:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 2 failing tests on test run #8 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing839 Passing11 Skipped45m 10s

Details

Failing Tests
SpecTest
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » can clone a Linode from Linode details page
timerange-verification.spec.tsCloud Manager Cypress Tests→Integration tests for verifying Cloudpulse custom and preset configurations » should implement and validate custom date/time picker for a specific date and time range

Troubleshooting

Use 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) => {
Copy link
Member

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

Copy link
Contributor Author

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 👍

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Oct 15, 2025
@abailly-akamai abailly-akamai merged commit fdb5493 into linode:develop Oct 15, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Oct 15, 2025
corya-akamai pushed a commit to corya-akamai/manager that referenced this pull request Dec 8, 2025
* 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>
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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants