Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Track leads to Hubspot #3473

Merged
merged 15 commits into from
Feb 28, 2024
Merged

feat: Track leads to Hubspot #3473

merged 15 commits into from
Feb 28, 2024

Conversation

zachaysan
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Upon a user being successfully added to a new organisation we trigger a task where the user's basic info (first and last name as well as email) are associated with the organisation in Hubspot via their API. The lead tracking implementation was partially mirrored with the existing Pipedrive implementation, including matching leads based off of domain names or regexes as well as using the same abstract base class LeadTracker although modelling the responses in the same way didn't seem necessary to get the functionality in place.

How did you test this code?

Tested the actual API responses with a locally set access token and then moved the relevant responses into mocked requests for the three unit tests that cover the various edge cases.

Copy link

vercel bot commented Feb 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2024 4:30pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2024 4:30pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2024 4:30pm

@github-actions github-actions bot added the api Issue related to the REST API label Feb 27, 2024
Comment on lines +13 to +19
try:
import re2 as re

logger.info("Using re2 library for regex.")
except ImportError:
logger.warning("Unable to import re2. Falling back to re.")
import re
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This import logic was to mirror the functionality of the existing pipedrive code which had this way of importing re.

Copy link
Contributor

github-actions bot commented Feb 27, 2024

Uffizzi Preview deployment-47355 was deleted.

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 84.24658% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 95.86%. Comparing base (76def7c) to head (aa0631d).
Report is 5 commits behind head on main.

❗ Current head aa0631d differs from pull request most recent head 91a2116. Consider uploading reports for the commit 91a2116 to get more accurate results

Files Patch % Lines
api/integrations/lead_tracking/hubspot/client.py 48.27% 15 Missing ⚠️
...integrations/lead_tracking/hubspot/lead_tracker.py 82.50% 7 Missing ⚠️
api/integrations/lead_tracking/hubspot/tasks.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3473      +/-   ##
==========================================
- Coverage   95.91%   95.86%   -0.06%     
==========================================
  Files        1092     1097       +5     
  Lines       33991    34136     +145     
==========================================
+ Hits        32601    32723     +122     
- Misses       1390     1413      +23     

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

@dabeeeenster
Copy link
Contributor

Should we remove the pipedrive code here too?

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Approved with one minor typo fix.

api/integrations/lead_tracking/hubspot/client.py Outdated Show resolved Hide resolved
Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
@zachaysan
Copy link
Contributor Author

Should we remove the pipedrive code here too?

According to @matthewelwell we're holding onto the pipedrive code for now since there is still a need for a bit.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants