Skip to content

refactor: simplify contribution action metadata#3934

Merged
idoshamun merged 1 commit into
mainfrom
codex/simplify-contribution-metadata
Jun 9, 2026
Merged

refactor: simplify contribution action metadata#3934
idoshamun merged 1 commit into
mainfrom
codex/simplify-contribution-metadata

Conversation

@idoshamun

@idoshamun idoshamun commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

  • remove the unnecessary contribution action metadata normalizer
  • persist strict private API metadata directly and default isLoveAction only at GraphQL read time
  • read action.metadata?.isLoveAction directly in submission validation

Validation

  • NODE_ENV=test npx jest tests/contributions.ts tests/routes/private/contributions.ts --testEnvironment=node --runInBand
  • pnpm run build
  • pnpm run lint

@pulumi

pulumi Bot commented Jun 9, 2026

Copy link
Copy Markdown

🍹 The Update (preview) for dailydotdev/api/prod (at 39866f4) was successful.

✨ Neo Code Review

Routine deployment of a new image build that removes the `normalizeContributionActionMetadata` abstraction and tightens schema validation; the `nullish` → `optional` change is the only subtle behavioral difference worth verifying against any callers that may supply explicit `null` field values. ✅ Low Risk

This is a routine application deployment rolling out a new image build (e261b91029fd5f9d). The code changes remove the normalizeContributionActionMetadata helper function, simplifying metadata handling to pass values through directly rather than re-parsing them through a Zod schema. The schema also tightens nullish() to optional() for contribution action metadata fields, dropping explicit null acceptance in favor of undefined-only optionality.

DB and Clickhouse migration jobs are cycled as part of the standard deploy process (old commit-tagged jobs deleted, new ones created for the incoming commit).

🔵 Info — The nullish()optional() change in contributionActionMetadataSchema means the schema will now reject null values for platform, instructions, externalUrl, and isLoveAction. Previously normalizeContributionActionMetadata also provided a safe default ({}) when input was null/undefined; the replacement body.metadata ?? {} preserves null-coalescing at the call sites, but any code path that passes an explicit null for individual metadata fields (rather than the whole object) will now fail Zod validation at schema boundaries still using this schema.

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-post-lifecycle-state-clickhouse-cron            kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-old-notifications-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
+   vpc-native-api-clickhouse-migration-29fd5f9d               kubernetes:batch/v1:Job        create
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-29fd5f9d                       kubernetes:batch/v1:Job        create
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
-   vpc-native-api-clickhouse-migration-e261b910               kubernetes:batch/v1:Job        delete
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-e261b910                       kubernetes:batch/v1:Job        delete
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
... and 13 other changes

@idoshamun idoshamun merged commit ea77ceb into main Jun 9, 2026
9 checks passed
@idoshamun idoshamun deleted the codex/simplify-contribution-metadata branch June 9, 2026 09:31
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.

1 participant