Skip to content

Synchronous stream processing in hubspot#1538

Merged
epipav merged 3 commits intomainfrom
improvement/hubspot-integration-synchronous-streams
Sep 22, 2023
Merged

Synchronous stream processing in hubspot#1538
epipav merged 3 commits intomainfrom
improvement/hubspot-integration-synchronous-streams

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 requested a review from themarolt September 22, 2023 08:03
@epipav epipav merged commit 1f260fd into main Sep 22, 2023
@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.

2 participants