Skip to content

Improve seeds 3 #12740

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

Merged
merged 12 commits into from
Jun 20, 2025
Merged

Improve seeds 3 #12740

merged 12 commits into from
Jun 20, 2025

Conversation

FelixMalfait
Copy link
Member

@FelixMalfait FelixMalfait commented Jun 19, 2025

  • Fix an issue where custom object were seeded with 2 views, and with the wrong icon
  • ACME becomes YCombinator
  • Allow 2 workspaces to have different metadata seeded
  • Add many seeds for messages
  • Add many seeds for calendar events
  • Randomize createdBy for person and companies

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Major update to workspace seeding functionality, replacing static test data with dynamic generators and improving data distribution.

  • Implemented sophisticated message seeding with 600 messages across threads, realistic timestamps, and weighted channel distribution (40% Tim, 20% Jony, etc.)
  • Added 800 calendar events generated from 12 templates with realistic business hours, including proper participant distribution and response statuses
  • Reorganized workspace configurations to support different metadata seeds per workspace (Apple vs YCombinator)
  • Fixed custom object seeding issue by preventing duplicate view creation and ensuring correct icon assignment

14 files reviewed, 11 comments
Edit PR Review Bot Settings | Greptile

@FelixMalfait FelixMalfait marked this pull request as draft June 19, 2025 14:47
Copy link
Contributor

github-actions bot commented Jun 19, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:45653

This environment will automatically shut down when the PR is closed or after 5 hours.

FelixMalfait and others added 6 commits June 19, 2025 18:54
…/data/constants/message-data-seeds.constant.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…/metadata/services/dev-seeder-metadata.service.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@FelixMalfait FelixMalfait marked this pull request as ready for review June 19, 2025 20:12
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Enhanced test suite and seeding improvements with focus on data validation and predictability.

  • Fixed seeding inconsistency in message-channel-message-association-data-seeds.constant.ts where Date.now() usage created non-deterministic seeds across environments
  • Updated calendar events test expectations from 1 to 60 records in calendar-events.integration-spec.ts for better coverage
  • Improved view identification in object records permissions test by using stable name ('All Pets') instead of volatile icon property
  • Added null check validation for workspace configuration in dev-seeder-metadata.service.ts to prevent runtime errors
  • Enhanced timeline activity seeding with proper batching and improved type safety in activity name formatting

7 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

const timelineActivityId = this.generateTimelineActivityId(
entityType,
index + 1,
);
const creationDate = new Date().toISOString();
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Using new Date() for creation dates will make seeds non-deterministic. Consider using a fixed date or deriving from the index

@FelixMalfait FelixMalfait merged commit cb6a76f into main Jun 20, 2025
42 checks passed
@FelixMalfait FelixMalfait deleted the improve-seeds-3 branch June 20, 2025 05:05
@prastoin
Copy link
Contributor

prastoin commented Jun 20, 2025

Hello there, encountering some flakiness on related updated tests from this PR in this ci https://github.com/twentyhq/twenty/actions/runs/15775251585/attempts/1?pr=12755
Also unable to make the tests pass locally even after database reset, still receiving one calendarEvent. 🤔 I'm 100% missing something as it seems to be working for others CIs => I was resetting the test database while consuming the default 🙃

@FelixMalfait
Copy link
Member Author

@prastoin thanks for the ping - will raise a fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants