fix(script-executor): schedule member email deduplication sweep - #4485
fix(script-executor): schedule member email deduplication sweep#4485ramanathan1504 wants to merge 2 commits into
Conversation
findAndMergeMembersWithSameVerifiedEmailsInDifferentPlatforms is registered in workflows.ts but nothing ever triggers it. main.ts registers only the four cleanup schedules, and services/cronjobs holds only archived_repositories, so the sweep runs only when someone starts it by hand and duplicate members accumulate in between. Register it as a recurring schedule alongside the existing ones. The workflow already pages by hash and uses continueAsNew, so it is built for unattended repeated execution. Matching semantics are unchanged: the detection query still requires verified identities on both sides, so this adds no new trust in self-asserted git commit emails. Overlap policy is SKIP rather than BUFFER_ONE because a full sweep can outlast the interval, and buffered sweeps would stack up. Refs: linuxfoundation#4484 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Ramanathan <ramanathanbscmca@gmail.com>
PR SummaryMedium Risk Overview On Reviewed by Cursor Bugbot for commit 69d619c. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Schedules the existing verified-email member deduplication workflow to run weekly.
Changes:
- Adds a Sunday 03:00 Temporal schedule using
SKIPoverlap behavior. - Registers the schedule during worker initialization.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scheduleMemberDeduplication.ts |
Defines the recurring deduplication schedule. |
main.ts |
Registers the schedule at startup. |
Suppressed comments (2)
services/apps/script_executor_worker/src/schedules/scheduleMemberDeduplication.ts:17
- The overlap-policy rationale is useful, but allowed comments are limited to two lines. Please condense this performance constraint while preserving why
SKIPmust not be changed casually.
// The workflow walks the whole memberIdentities table via continueAsNew, so a single
// sweep can outlast the interval. Skip an overdue run instead of buffering it, so
// sweeps never stack up on top of each other.
services/apps/script_executor_worker/src/schedules/scheduleMemberDeduplication.ts:30
- This comment only narrates the empty initial argument and workflow paging behavior. That behavior is already clear from
args: [{}]and the workflow contract, so this violates the repository's no-descriptive-comments guideline.
// Start from the beginning of the hash ordering; the workflow pages itself from there.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
removing comments Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ramanathan <ramanathanbscmca@gmail.com>
Fixes #4484
Problem
findAndMergeMembersWithSameVerifiedEmailsInDifferentPlatformsis registered inworkflows.tsbut nothing ever triggers it.script_executor_worker/src/main.tsregisters only the four cleanup schedules, andservices/cronjobsholds onlyarchived_repositories. The sweep therefore runs only when someone starts it by hand, and duplicate members accumulate in between.Downstream symptom (linuxfoundation/insights#2093): on the LFX Insights leaderboard for
apache/logging-log4j2, one person renders as two contributors —ramanathan1504(57 authored commits) andramanathanbscmca@gmail.com(10). The leaderboard pipe groups strictly bymemberId, so there is no downstream recourse.Change
Registers the workflow as a recurring schedule alongside the existing ones. It already pages by hash and uses
continueAsNew, so it is built for unattended repeated execution.ScheduleOverlapPolicy.SKIPrather thanBUFFER_ONE: a full sweep ofmemberIdentitiescan outlast the interval, and buffered sweeps would stack up.No matching semantics change. The detection query still requires verified identities on both sides, so this adds no new trust in self-asserted git commit emails.
Verification
I could not run the service end to end, so I verified the matching logic directly. I reproduced the detection query from
member.repo.tsagainst a local Postgres, seeded with the identity shapes both integrations actually produce — including the git member's verifiedtype: 'username'identity fromcommit_service.py:verifiedSo pairs like the reported one are already detectable by the existing query — the sweep simply never runs. That is what this PR fixes.
Formatting was matched to
services/.prettierrc.cjsby hand (printWidth: 100,semi: false,singleQuote, import order), sincepnpmwas not available in my environment. Happy to push a formatter pass if CI disagrees.Note on the PR title
I do not have a JIRA key for this, so the title omits one and the Jira validation check will warn. Please let me know the right key and I will retitle.