Skip to content

fix(Integrations): Let HubSpot handle company creation and association#7138

Closed
Holmus wants to merge 2 commits intomainfrom
fix/hubspot-stop-overwriting-company-names
Closed

fix(Integrations): Let HubSpot handle company creation and association#7138
Holmus wants to merge 2 commits intomainfrom
fix/hubspot-stop-overwriting-company-names

Conversation

@Holmus
Copy link
Copy Markdown
Contributor

@Holmus Holmus commented Apr 6, 2026

The HubSpot lead tracking integration was creating and updating companies from Flagsmith org data, overwriting enriched company names with user-entered org names. HubSpot already handles company creation and contact association automatically from email domains.

Changes

  • Simplify create_lead to only create the contact - HubSpot handles company creation and association
  • Simplify should_track to just check if the feature is enabled - HubSpot handles domain filtering
  • Remove regex import (no longer needed)
  • Remove obsolete tests for company association and domain filtering

Review effort: 1/5

🤖 Generated with Claude Code

@Holmus Holmus requested a review from a team as a code owner April 6, 2026 15:13
@Holmus Holmus requested review from khvn26 and removed request for a team April 6, 2026 15:13
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Apr 6, 2026 3:29pm
flagsmith-frontend-preview Ignored Ignored Preview Apr 6, 2026 3:29pm
flagsmith-frontend-staging Ignored Ignored Preview Apr 6, 2026 3:29pm

Request Review

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@github-actions github-actions bot added the api Issue related to the REST API label Apr 6, 2026
@khvn26 khvn26 changed the title fix(Integrations): Stop overwriting HubSpot company names with Flagsmith org names fix(Integrations): HubSpot company names overwritten with Flagsmith org names Apr 6, 2026
@github-actions github-actions bot added the fix label Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-e2e:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7138 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7138 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7138 Finished ✅ Results

khvn26
khvn26 previously approved these changes Apr 6, 2026
…ith org names

When a user signs up, the HubSpot integration overwrites the company
name with whatever the user typed as their Flagsmith org name. This
leads to incorrect names replacing real company names that HubSpot
already enriched from the email domain.

Now only sets the company name if HubSpot doesn't already have one,
using the email domain as a fallback instead of the org name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Holmus Holmus force-pushed the fix/hubspot-stop-overwriting-company-names branch from 6364631 to 123b18d Compare April 6, 2026 15:17
@github-actions github-actions bot added fix and removed fix labels Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49.5 seconds
commit  ed6e5a7
info  🔄 Run: #15789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  44 seconds
commit  ed6e5a7
info  🔄 Run: #15789 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.8 seconds
commit  ed6e5a7
info  🔄 Run: #15789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  28.7 seconds
commit  6364631
info  🔄 Run: #15790 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  46.5 seconds
commit  6364631
info  🔄 Run: #15790 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 8 seconds
commit  ed6e5a7
info  🔄 Run: #15789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  44.4 seconds
commit  123b18d
info  🔄 Run: #15791 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  28.8 seconds
commit  123b18d
info  🔄 Run: #15791 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 15 seconds
commit  6364631
info  🔄 Run: #15790 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  52.9 seconds
commit  123b18d
info  🔄 Run: #15791 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  1 minute, 7 seconds
commit  123b18d
info  🔄 Run: #15791 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 1 second
commit  6364631
info  🔄 Run: #15790 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43.7 seconds
commit  507b504
info  🔄 Run: #15792 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  28.9 seconds
commit  507b504
info  🔄 Run: #15792 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  47.2 seconds
commit  507b504
info  🔄 Run: #15792 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 10 seconds
commit  507b504
info  🔄 Run: #15792 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43.8 seconds
commit  f265e20
info  🔄 Run: #15794 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  24.7 seconds
commit  26c5add
info  🔄 Run: #15795 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  46.2 seconds
commit  f265e20
info  🔄 Run: #15794 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  27.7 seconds
commit  177bffe
info  🔄 Run: #15796 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  53.3 seconds
commit  26c5add
info  🔄 Run: #15795 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  53.1 seconds
commit  177bffe
info  🔄 Run: #15796 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  32.8 seconds
commit  26c5add
info  🔄 Run: #15795 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  59.4 seconds
commit  26c5add
info  🔄 Run: #15795 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  37.3 seconds
commit  177bffe
info  🔄 Run: #15796 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  48.8 seconds
commit  f265e20
info  🔄 Run: #15794 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 7 seconds
commit  f265e20
info  🔄 Run: #15794 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 10 seconds
commit  177bffe
info  🔄 Run: #15796 (attempt 1)

@matthewelwell matthewelwell requested a review from Zaimwa9 April 6, 2026 15:20
@matthewelwell
Copy link
Copy Markdown
Contributor

I've requested @Zaimwa9's review here as he has the most contextual knowledge of this area of code.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.32%. Comparing base (b4cf014) to head (177bffe).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7138      +/-   ##
==========================================
- Coverage   98.34%   98.32%   -0.03%     
==========================================
  Files        1336     1336              
  Lines       50129    50120       -9     
==========================================
- Hits        49299    49278      -21     
- Misses        830      842      +12     

☔ View full report in Codecov by Sentry.
📢 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.

@Holmus Holmus changed the title fix(Integrations): HubSpot company names overwritten with Flagsmith org names fix(Integrations): Let HubSpot handle company creation and association Apr 6, 2026
@github-actions github-actions bot added fix and removed fix labels Apr 6, 2026
@Holmus Holmus force-pushed the fix/hubspot-stop-overwriting-company-names branch from 507b504 to f265e20 Compare April 6, 2026 15:28
@Holmus Holmus requested a review from a team as a code owner April 6, 2026 15:28
The HubSpot lead tracking integration was creating and updating
companies from Flagsmith org data, overwriting enriched company
names with user-entered org names. HubSpot already handles company
creation and contact association automatically from email domains.

Simplify create_lead to only create the contact. Remove domain
filtering from should_track since HubSpot handles that natively.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Holmus Holmus force-pushed the fix/hubspot-stop-overwriting-company-names branch from 26c5add to 177bffe Compare April 6, 2026 15:29
@Holmus Holmus closed this Apr 6, 2026
@github-actions github-actions bot removed the fix label Apr 6, 2026
@Holmus Holmus deleted the fix/hubspot-stop-overwriting-company-names branch April 6, 2026 15:29
@github-actions github-actions bot added fix and removed fix labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants