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

Synchronous stream processing in hubspot #1538

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

epipav
Copy link
Collaborator

@epipav epipav commented Sep 22, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 64cfd71

Refactored the Hubspot integration to use an enum type for the streams and handle multiple streams in the root stream data. This improves the code quality and enables mapping Hubspot entities to Crowd.dev entities.

🤖 Generated by Copilot at 64cfd71

HubspotStream.ROOT
Refactored with enum type
Spring cleaning the code

Why

How

🤖 Generated by Copilot at 64cfd71

  • Add HubspotStream.ROOT to HubspotStream enum to identify the root stream (link)
  • Initialize an empty array of type HubspotStream[] to store the streams to be generated based on the settings and the entities in generateStreams.ts (link)
  • Push HubspotStream.MEMBERS and HubspotStream.ORGANIZATIONS to the streams array instead of publishing them directly in generateStreams.ts (link, link)
  • Publish the root stream with the streams array as its data if the array is not empty in generateStreams.ts (link)
  • Modify processRootStream function in processStream.ts to use the streams array as the data of the root stream (link)
  • Check if the streams array includes HubspotStream.MEMBERS or HubspotStream.ORGANIZATIONS and proceed with the corresponding mapping logic in processStream.ts (link, link)
  • Remove the else branch that aborted the process for unknown root stream identifiers in processStream.ts, as the streams array should only contain valid values from the HubspotStream enum (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@epipav epipav self-assigned this Sep 22, 2023
@epipav epipav added the Improvement Created by Linear-GitHub Sync label Sep 22, 2023
@epipav epipav marked this pull request as ready for review September 22, 2023 08:00
@epipav epipav merged commit 1f260fd into main Sep 22, 2023
8 checks passed
@epipav epipav deleted the improvement/hubspot-integration-synchronous-streams branch September 22, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants