fix(destination-hubspot): use Properties API to discover Deal and Company objects (AI-Triage PR)#74082
Conversation
…pany objects
Switch from Schemas API (/crm/v3/schemas/{objectType}) to Properties API
(/crm/v3/properties/{objectType}) for standard object property discovery.
The Schemas API only returns built-in property definitions for standard
objects, which means custom properties with hasUniqueValue=true are not
visible. This causes Deal and Company objects to be silently excluded
from the destination catalog since they have no built-in properties with
hasUniqueValue=true.
The Properties API returns both built-in and custom properties, allowing
Deal and Company objects to appear in the catalog when the customer has
created a custom property with unique values enabled.
Co-Authored-By: bot_apk <apk@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
|
|
↪️ Triggering Reason: Draft PR switches standard object property discovery from Schemas API to Properties API, fixing missing Deal and Company objects. CI mostly passing (1 test failure appears pre-existing). |
|
Fix Validation EvidenceOutcome: Fix/Feature Proven Successfully Evidence SummaryTested on 2 internal connections after pinning to pre-release
Both connections confirmed: Next Steps
Connector & PR DetailsConnector: Evidence PlanProving CriteriaA sync on a connection using the COMPANY or DEAL object completes successfully after pinning to the pre-release, demonstrating that the Properties API correctly discovers properties for these object types and the connector can write to them. Disproving Criteria
Cases Attempted
Pre-flight Checks
WARNING (Design Intent): This PR also switches CONTACT from Schemas API to Properties API (not just DEAL/COMPANY). The Properties API is a superset, so this should be safe, but it broadens the change surface. Missing artifacts: No version bump or changelog entry in this PR (still Detailed Evidence Log
Both syncs confirmed:
Note: Connection IDs and detailed logs are recorded in the linked private issue. |
|
What
Resolves https://github.com/airbytehq/oncall/issues/11460:
Deal and Company objects are missing from the HubSpot destination object dropdown because the connector uses the Schemas API (
/crm/v3/schemas/{objectType}) for property discovery, which only returns built-in property definitions for standard objects. Since Deal and Company have no built-in properties withhasUniqueValue: true, they are silently excluded from the catalog.How
Switches standard object property discovery from the Schemas API to the Properties API (
/crm/v3/properties/{objectType}), which returns both built-in and custom properties. This means Deal and Company will appear in the catalog when the customer has created a custom property withhasUniqueValue: true.Key changes:
STANDARD_OBJECT_PROPERTIES_URLpointing to/crm/v3/properties/PROPERTIES_API_RESULTS_PATH(["results"]) since the Properties API wraps properties under"results"instead of"properties"Review guide
HubSpotOperationRepository.kt— the core fix. Verify the URL and path changes are correct.HubSpotOperationRepositoryTest.kt— updated mocks + new test for Deal withhasUniqueValueproperty.HubSpotSchemaResponseBuilder.kt— newHubSpotPropertiesApiResponseBuilderandwithHasUniqueValuehelper."DEAL","COMPANY"to/crm/v3/properties/{objectType}. Confirm the HubSpot Properties API accepts uppercase object type names, or whether it requires lowercase/plural forms (e.g.,deals,companies). The unit tests mock HTTP calls so they won't catch a mismatch.modificationMetadata.readOnlyValue,calculated,hasUniqueValue,type,name). Confirm these fields are present in Properties API responses, not just Schemas API responses.anUnavailablePropertiesApiObject()was added but is not currently referenced by any test. Consider removing it to keep the test surface clean.User Impact
Customers using the HubSpot destination will be able to see Deal and Company in the object dropdown if they have created custom properties with "Require unique values" enabled on those objects. Without such a property, Deal and Company will still be excluded (by design, since upsert requires a matching key).
Can this PR be safely reverted and rolled back?
Link to Devin run: https://app.devin.ai/sessions/e920bcdd0bfc4ffca6fad2df9e3fa995
Requested by: bot_apk (apk@cognition.ai)