fix: integration results errors with no identity for platform (CM-1111)#4078
fix: integration results errors with no identity for platform (CM-1111)#4078
Conversation
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent integration result processing from failing when activities (especially from git/gerrit) don’t have a usable member identity for the target platform (e.g., commits/trailers with empty emails, or legacy records missing a username identity).
Changes:
- Git integration: skip emitting commit/trailer activities when the relevant email is empty to avoid creating activities with no attachable identity.
- Data sink worker: allow organization “find or create” to return
undefined(instead of throwing) and update member processing to skip adding organizations when no org id is returned. - Data sink worker: adjust activity member preparation to fall back to an email identity when no username identity exists for the platform, and attempt to skip activities with no usable identity.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/apps/git_integration/src/crowdgit/services/commit/commit_service.py | Avoid generating activities when author/committer/trailer emails are empty. |
| services/apps/data_sink_worker/src/service/organization.service.ts | Return string | undefined from findOrCreate (no throw on undefined). |
| services/apps/data_sink_worker/src/service/member.service.ts | Handle optional org id results and tighten cached promise retrieval typing. |
| services/apps/data_sink_worker/src/service/activity.service.ts | Add email-identity fallback when username identity is missing; try to skip identity-less activities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
…identity is present Signed-off-by: Uroš Marolt <uros@marolt.me>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5a12546. Configure here.
Signed-off-by: Uroš Marolt <uros@marolt.me>
…le error for now Signed-off-by: Uroš Marolt <uros@marolt.me>
joanagmaia
left a comment
There was a problem hiding this comment.
LGTM @mbani01 probably worth investigating a bit on why we don't get emails for some activities. Will create a ticket with an example so we can look into it

Note
Medium Risk
Moderate risk because it changes ingestion control-flow (some activities are now skipped/marked successful) and relaxes organization creation to allow
undefinedIDs, which could affect attribution and org membership links if assumptions elsewhere rely on prior hard failures.Overview
Prevents integration-result failures when an activity/member has no usable identity for the platform.
ActivityService.prepareMemberDatanow falls back from missing username to a verified same-platform email (and backfills a username identity), treats unverified email as an unrepeatable error, and otherwise skips the activity (warn + mark success) instead of failing the batch.Tightens downstream processing to drop payloads whose
activity.usernameis still empty after member preparation, avoiding later lookups/upserts on identity-less activities.Makes organization linking more tolerant:
OrganizationService.findOrCreatenow returnsstring | undefined(no throw on failure), andMemberServiceonly appends org references when anorgIdis returned while also simplifying the org promise-cache lookup.Reviewed by Cursor Bugbot for commit b71457b. Bugbot is set up for automated code reviews on this repo. Configure here.