feat: add creator and squad relation queries#3764
Conversation
|
🍹 The Update (preview) for dailydotdev/api/prod (at b14866d) was successful. ✨ Neo ExplanationThis is a standard application version rollout deploying a new build to all production services, along with database and Clickhouse migrations. As part of this release, two tag-related cron jobs (`update-source-tag-view` and `update-tag-recommendations`) are being replaced by a single consolidated `update-tag-materialized-views` cron job.Root Cause AnalysisA new version of the application has been built and is being deployed across the entire production stack. Every deployment, cron job, and migration job is being updated to roll out the new container image. Additionally, two tag-related cron jobs have been consolidated into a single new one as part of this release. Dependency ChainThe new application version cascades uniformly across all resources:
Risk analysisNo stateful resources (databases, storage buckets, persistent volumes) are being replaced or deleted. The migration jobs introduce the only meaningful risk — if a DB or Clickhouse migration fails or contains a breaking schema change, it could impact running services. The deletion of the two tag-related cron jobs and replacement with a single consolidated one means those scheduled tasks will not run under their old definitions going forward; if the new combined job is misconfigured, tag materialized view updates would be missed until the next scheduled run. Resource Changes Name Type Operation
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-73fe5028 kubernetes:batch/v1:Job delete
+ vpc-native-api-db-migration-e511fb8a kubernetes:batch/v1:Job create
~ vpc-native-user-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-worker-job-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
- vpc-native-update-tag-recommendations-cron kubernetes:batch/v1:CronJob delete
~ vpc-native-clean-channel-highlights-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-weekly-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-rotate-daily-quests-cron kubernetes:batch/v1:CronJob update
- vpc-native-update-source-tag-view-cron kubernetes:batch/v1:CronJob delete
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-expired-better-auth-sessions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-squad-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-73fe5028 kubernetes:batch/v1:Job delete
~ vpc-native-channel-digests-cron kubernetes:batch/v1:CronJob update
... and 11 other changes |
Summary
topCreatorsByTagandsimilarCreatorstopMembersBySquadwith runtime engagement scoring for non-staff membersuser_tag_viewto public-safe posts and expanduser_similarity_viewto 10 resultsTesting
pnpm exec eslint src/common/schema/entityRelations.ts src/entity/user/UserTagView.ts src/entity/user/UserSimilarityView.ts src/schema/users.ts src/schema/sources.ts __tests__/sources.ts __tests__/users.tsNODE_ENV=test npx jest __tests__/sources.ts --testEnvironment=node --runInBand --testNamePattern='materialized tag views|topCreatorsByTag|similarCreators|topMembersBySquad|similarSources|sourcesByTag'Notes
TagMaterializedViews1774956867935because the test DB still had the olderuser_tag_viewdefinition from the previous branch stateChannelHighlights1773000000000is still unrelated and unchanged