Skip to content

test(hs): verify merged contact updates reach survivor - #5748

Merged
shekhar-rudder merged 4 commits into
developfrom
harness/INT-7466-test-hs-verify-merged-contact-u-cd829a98
Oct 29, 2026
Merged

shekhar-rudder merged 4 commits into
developfrom
harness/INT-7466-test-hs-verify-merged-contact-u-cd829a98

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Require both jobs in HubSpot’s merged-record live batch to deliver, verify the update on the surviving contact, and clean up the survivor and unrelated contact. Preserve mocked regression coverage for silently omitted batch inputs with merge-neutral wording.

What is the related Linear task?

Resolves INT-7466

Please explain the objectives of your changes below

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

The merged-record live scenario previously expected failure for the merged-away ID. HubSpot now resolves that ID and echoes its trace ID, so the scenario requires successful delivery and read-back instead. No delivery-handler logic changed.

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

Cleanup deletes the actual survivor only once. If a merge succeeds but both the merge response and fallback GET fail to identify the survivor, teardown falls back to the registered original IDs and may report a deletion failure.

Validation

  • Passed: npm run lint; npx tsc --noEmit -p tsconfig.test.json; npm test -- --testPathPattern="hs" --no-coverage (223 tests); npm run test:ts -- component --destination=hs (86 tests); git diff --check.
  • HubSpot-only secret-path generation confirmed the existing HS: ["headers.Authorization"] entry; the full generated artifact was restored and has no diff.
  • The parallel code-simplify pass resulted in moving scenario-specific cleanup beside setup; the merge-response GET fallback was retained because the response may lack an ID.
  • Live tests were not run: LIVE_SECRET_HS is unavailable. Both credential variants and remote cleanup still need verification. No PR was created or Slack link posted.

⚠️ Known Issues

  • LOG_LEVEL=silent npm run test:live -- --destination=hs remains unrun because LIVE_SECRET_HS is unavailable. Both credential variants, remote survivor cleanup, and a green live (hs) run on develop remain unverified.
  • The PR link still needs to be posted in the Slack heads-up thread once the PR exists.

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change? (None needed)
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?
  • Verified that there are no credentials or confidential data exposed with the changes.

⚠️ Auto-review unresolved

Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.

  • medium: Cleanup cannot recognize a merge that succeeded before the request failed — test/integrations/destinations/hs/live/setup.ts:106 — not auto-fixed (iteration budget exhausted)

@rudder-devbox

rudder-devbox Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from task INT-7466.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9481312f-3e36-44a5-b0a0-498da33ce81f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (4a3987d) to head (7ec0bb9).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5748   +/-   ##
========================================
  Coverage    92.42%   92.42%           
========================================
  Files          741      741           
  Lines        41048    41048           
  Branches      9553     9636   +83     
========================================
  Hits         37938    37938           
+ Misses        2926     2848   -78     
- Partials       184      262   +78     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

shekhar-rudder and others added 2 commits October 29, 2026 14:32
Resolve every registered contact id to its current id and delete each
once, in parallel, instead of tracking the merge in a module-level
WeakMap and registering an unread survivor id. This also cleans up when
the merge landed although its request failed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@shekhar-rudder
shekhar-rudder marked this pull request as ready for review October 29, 2026 09:10
Copilot AI balanced review requested due to automatic review settings October 29, 2026 09:10
@shekhar-rudder
shekhar-rudder requested review from a team as code owners October 29, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A failed resolution GET excludes an unrelated contact from cleanup despite its valid registered ID, potentially leaving a live sandbox contact behind instead of attempting best-effort deletion.

1 open issue
What changed in this PR

Updates HubSpot’s live merged-contact scenario to require both batch updates to succeed and verify that the merged-away ID’s update reaches the survivor. Delivery-handler logic remains unchanged.

Changes:

  • Require successful delivery and read-back for both contacts.
  • Resolve registered contact IDs during cleanup and deduplicate deletion targets.
  • Preserve mocked silent-omission coverage with merge-neutral descriptions and error wording.
File Description
test/​integrations/​destinations/​hs/​network.ts Clarifies comments describing synthetic silent-omission responses.
test/​integrations/​destinations/​hs/​live/​scenarios.ts Requires both updates to succeed and uses merge-aware cleanup.
test/​integrations/​destinations/​hs/​live/​api.ts Adds contact ID resolution and deduplicated cleanup.
test/​integrations/​destinations/​hs/​dataDelivery/​upsert.ts Updates omission-case naming and expected error wording.
src/​v1/​destinations/​hs/​networkHandler.ts Revises documentation and error text without changing handler logic.

Review effort: Balanced

HubSpot contact DELETE is idempotent and deleting through a merged-away
id removes the survivor, so the resolve-then-delete teardown is
unnecessary. It also skipped the unrelated contact whenever its lookup
failed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The scenario’s cleanup still deletes all three original IDs rather than resolving and deleting the survivor once, leaving a mismatch with the PR description.

1 open issue
1 resolved since last review

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

@shekhar-rudder
shekhar-rudder merged commit 0f4947b into develop Oct 29, 2026
39 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/INT-7466-test-hs-verify-merged-contact-u-cd829a98 branch October 29, 2026 10:18
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