Skip to content

fix: integration results errors with no identity for platform (CM-1111)#4078

Merged
themarolt merged 12 commits intomainfrom
fix/integration-results-error-fixes-CM-1111
May 6, 2026
Merged

fix: integration results errors with no identity for platform (CM-1111)#4078
themarolt merged 12 commits intomainfrom
fix/integration-results-error-fixes-CM-1111

Conversation

@themarolt
Copy link
Copy Markdown
Contributor

@themarolt themarolt commented May 6, 2026

Note

Medium Risk
Moderate risk because it changes ingestion control-flow (some activities are now skipped/marked successful) and relaxes organization creation to allow undefined IDs, 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.prepareMemberData now 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.username is still empty after member preparation, avoiding later lookups/upserts on identity-less activities.

Makes organization linking more tolerant: OrganizationService.findOrCreate now returns string | undefined (no throw on failure), and MemberService only appends org references when an orgId is 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.

themarolt added 4 commits May 6, 2026 14:25
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>
Copilot AI review requested due to automatic review settings May 6, 2026 12:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread services/apps/data_sink_worker/src/service/activity.service.ts
Comment thread services/apps/data_sink_worker/src/service/activity.service.ts Outdated
themarolt added 2 commits May 6, 2026 14:43
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings May 6, 2026 12:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread services/apps/data_sink_worker/src/service/activity.service.ts Outdated
themarolt added 2 commits May 6, 2026 15:00
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings May 6, 2026 13:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread services/apps/data_sink_worker/src/service/activity.service.ts
…identity is present

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread services/apps/data_sink_worker/src/service/activity.service.ts
Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings May 6, 2026 13:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread services/apps/data_sink_worker/src/service/activity.service.ts Outdated
…le error for now

Signed-off-by: Uroš Marolt <uros@marolt.me>
@themarolt themarolt requested review from joanagmaia and skwowet May 6, 2026 14:31
Copy link
Copy Markdown
Contributor

@joanagmaia joanagmaia left a comment

Choose a reason for hiding this comment

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

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

Copilot AI review requested due to automatic review settings May 6, 2026 15:40
@themarolt themarolt merged commit 13c3933 into main May 6, 2026
8 checks passed
@themarolt themarolt deleted the fix/integration-results-error-fixes-CM-1111 branch May 6, 2026 15:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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.

3 participants