Skip to content

Conversation

@skwowet
Copy link
Member

@skwowet skwowet commented Jan 10, 2025

Changes proposed ✍️

What

copilot:summary

copilot:poem

Why

How

copilot:walkthrough

Summary by CodeRabbit

Based on the comprehensive summary, here are the release notes:

  • Removed Features

    • Removed HubSpot integration functionality
    • Removed Discord integration support
    • Eliminated automation-related features and workflows
    • Discontinued integration sync worker service
  • Configuration Changes

    • Removed several configuration files and environment settings
    • Updated temporal configuration across services
    • Removed references to HubSpot and Discord in platform types
  • API and Service Modifications

    • Deleted multiple API endpoints related to HubSpot and automation
    • Removed synchronization and stream processing for HubSpot
    • Simplified integration and worker services

These changes significantly reduce the complexity of the platform by removing specific integrations and automation capabilities.

@skwowet skwowet self-assigned this Jan 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request represents a comprehensive removal of HubSpot integration and automation-related functionality across multiple services and modules. The changes span configuration files, API endpoints, repositories, services, and type definitions. The primary focus appears to be eliminating all HubSpot-specific code, including integration streams, synchronization processes, field mappers, and related configurations.

Changes

File/Group Change Summary
Backend Configuration Removed HubSpot-related environment variables and configuration settings
API Endpoints Deleted multiple HubSpot and automation-related API routes and handlers
Repositories Removed repositories for automation, member sync, and organization sync
Services Eliminated integration and automation services for HubSpot and related workflows
Type Definitions Removed enums, interfaces, and type definitions related to HubSpot and automations
Queue Configuration Deleted integration sync worker queue settings and references

Possibly related PRs

  • Activities sync fixes #2685: Changes to synchronization logic for activities, which might indicate a broader refactoring of integration processes

Suggested Reviewers

  • themarolt

Poem

🐰 Farewell, HubSpot, your time has passed
Integrations stripped away so fast
Repositories deleted with glee
Automation's dance, no longer free
A clean slate emerges, code refined! 🔧


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@skwowet skwowet requested review from epipav and themarolt January 13, 2025 14:26
Base automatically changed from deprecate-stuff to main January 13, 2025 16:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🔭 Outside diff range comments (3)
scripts/cli (1)

Line range hint 765-769: Fix typo in variable name and update commented services.

The commented-out services list contains a typo in the variable name and includes services that should be removed.

Apply this diff to fix the issues:

-        # INGORED_SERVICES=("python-worker" "job-generator" "discord-ws" "webhook-api" "profiles-worker" "organizations-enrichment-worker" "merge-suggestions-worker" "members-enrichment-worker" "exports-worker" "entity-merging-worker")
+        # IGNORED_SERVICES=("python-worker" "job-generator" "webhook-api" "profiles-worker" "organizations-enrichment-worker" "merge-suggestions-worker" "members-enrichment-worker" "exports-worker" "entity-merging-worker")
backend/src/services/integrationService.ts (1)

Line range hint 938-974: Potential unintended overwriting of the integration variable

In the gerritConnectOrUpdate method (lines 938-974), the integration variable is assigned twice. First, when creating or updating the Gerrit integration, and then potentially again when enableGit is true, creating or updating the Git integration. This could lead to the original Gerrit integration being overwritten by the Git integration, and the method may return the incorrect integration.

To fix this, assign the results to separate variables and ensure you return the intended integration:

async gerritConnectOrUpdate(integrationData) {
  const transaction = await SequelizeRepository.createTransaction(this.options)
- let integration: any
+ let gerritIntegration: any
  try {
    const res = await IntegrationService.getGerritServerRepos(integrationData.remote.orgURL)
    if (integrationData.remote.enableAllRepos) {
      integrationData.remote.repoNames = res.repoNames
    }
-   integration = await this.createOrUpdate(
+   gerritIntegration = await this.createOrUpdate(
      {
        platform: PlatformType.GERRIT,
        settings: {
          remote: integrationData.remote,
        },
        status: 'done',
      },
      transaction,
    )
    if (integrationData.remote.enableGit) {
      const stripGit = (url: string) => {
        if (url.endsWith('.git')) {
          return url.slice(0, -4)
        }
        return url
      }

-     integration = await this.createOrUpdate(
+     const gitIntegration = await this.createOrUpdate(
        {
          platform: PlatformType.GIT,
          settings: {
            remotes: integrationData.remote.repoNames.map((repo) =>
              stripGit(`${integrationData.remote.orgURL}${res.urlPartial}/${repo}`),
            ),
          },
          status: 'done',
        },
        transaction,
      )
    }

    await SequelizeRepository.commitTransaction(transaction)
-   return integration
+   return gerritIntegration
  } catch (err) {
    await SequelizeRepository.rollbackTransaction(transaction)
    throw err
  }
}
services/apps/data_sink_worker/src/service/member.service.ts (1)

Temporal Client Dependencies Need to be Removed

The temporal client is still being used in the MemberService class even though the temporal workflow has been removed. This needs to be addressed to prevent potential runtime issues:

  • Remove the temporal client from the constructor parameters
  • Remove temporal client usage in processMemberEnrich method where new MemberService instances are created (2 occurrences)
🔗 Analysis chain

Line range hint 59-59: Ensure All References to this.temporal Are Removed or Updated.

Since the temporal workflow has been removed, verify that any usage of this.temporal within the class is also removed or properly refactored to prevent runtime errors.

Run the following script to search for references to this.temporal:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of `this.temporal` in `member.service.ts`.

rg 'this\.temporal' services/apps/data_sink_worker/src/service/member.service.ts

Length of output: 132


Script:

#!/bin/bash
# Get more context around the temporal usages
rg -B 3 -A 3 'this\.temporal' services/apps/data_sink_worker/src/service/member.service.ts

# Look at the class structure
ast-grep --pattern 'class MemberService {
  $$$
}'

Length of output: 29523


Script:

#!/bin/bash
# Find the actual MemberService class implementation
ast-grep --pattern 'class MemberService {
  constructor($$$) {
    $$$
  }
  $$$
}' services/apps/data_sink_worker/src/service/member.service.ts

Length of output: 146


Script:

#!/bin/bash
# Look at the entire file content
cat services/apps/data_sink_worker/src/service/member.service.ts

# Backup: search for any class definition
rg "class.*{" services/apps/data_sink_worker/src/service/member.service.ts

Length of output: 21458

🧹 Nitpick comments (5)
backend/src/api/auth/authMe.ts (1)

11-11: Add error handling if async operation is needed

If the Promise.all operation needs to stay for future async operations, proper error handling should be added to prevent unhandled promise rejections.

- payload.tenants = await Promise.all(payload.tenants.map(async (tenantUser) => tenantUser))
+ try {
+   payload.tenants = await Promise.all(payload.tenants.map(async (tenantUser) => tenantUser))
+ } catch (error) {
+   await req.responseHandler.error(req, res, error)
+   return
+ }
services/apps/integration_run_worker/src/service/integrationRunService.ts (3)

Line range hint 35-124: Consider breaking down complex stream processing logic.

The handleStreamProcessed method has high cyclomatic complexity with nested conditionals and multiple responsibilities. Consider extracting the following into separate methods:

  • Stream state counting logic
  • Error handling for failed streams
  • Post-processing logic for successful runs

Example refactor:

- public async handleStreamProcessed(runId: string): Promise<void> {
+ private async countStreamStates(runId: string): Promise<{count: number, finishedCount: number, error: boolean}> {
+   const counts = await this.repo.getStreamCountsByState(runId)
+   let count = 0
+   let finishedCount = 0
+   let error = false
+   for (const [state, stateCount] of counts.entries()) {
+     // ... existing counting logic
+   }
+   return { count, finishedCount, error }
+ }

+ private async handleFailedStreams(runId: string, runInfo: any): Promise<void> {
+   // ... existing error handling logic
+ }

+ private async handleSuccessfulRun(runId: string, runInfo: any): Promise<void> {
+   // ... existing success handling logic
+ }

+ public async handleStreamProcessed(runId: string): Promise<void> {
+   const { count, finishedCount, error } = await this.countStreamStates(runId)
+   if (count === finishedCount) {
+     const runInfo = await this.repo.getGenerateStreamData(runId)
+     if (error) {
+       await this.handleFailedStreams(runId, runInfo)
+     } else {
+       await this.handleSuccessfulRun(runId, runInfo)
+     }
+   }
+ }

Line range hint 206-334: Consider separating concerns in stream generation.

The generateStreams method handles multiple responsibilities including:

  • Run validation
  • Member attribute settings management
  • Cache management
  • Stream generation context setup

Consider extracting these into separate methods or even a dedicated StreamGenerationService class to improve maintainability and testability.


Line range hint 336-428: Consider implementing typed error handling.

The error handling pattern is consistent but could benefit from typed errors to improve error handling predictability and maintainability.

Example implementation:

class IntegrationRunError extends Error {
  constructor(
    public readonly location: string,
    message: string,
    public readonly metadata?: unknown,
    public readonly cause?: Error
  ) {
    super(message)
  }
}

private async triggerRunError(
  runId: string,
  location: string,
  message: string,
  metadata?: unknown,
  error?: Error,
): Promise<void> {
  const runError = new IntegrationRunError(location, message, metadata, error)
  await this.repo.markRunError(runId, {
    location: runError.location,
    message: runError.message,
    metadata: runError.metadata,
    errorMessage: runError.cause?.message,
    errorStack: runError.cause?.stack,
    errorString: runError.cause ? JSON.stringify(runError.cause) : undefined,
  })
}
services/apps/data_sink_worker/config/default.json (1)

5-5: Document the purpose of the unleash configuration.

The empty unleash configuration object has been added but lacks documentation about its purpose and expected configuration properties.

Consider adding a comment above the unleash configuration to explain its purpose:

+  // Configuration for Unleash feature flag system
   "unleash": {},
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa58cc2 and 728a18f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (145)
  • backend/.env.dist.local (1 hunks)
  • backend/config/custom-environment-variables.json (0 hunks)
  • backend/config/default.json (1 hunks)
  • backend/id-openapi.yaml (2 hunks)
  • backend/src/api/auth/authMe.ts (1 hunks)
  • backend/src/api/automation/automationCreate.ts (0 hunks)
  • backend/src/api/automation/automationDestroy.ts (0 hunks)
  • backend/src/api/automation/automationExecutionFind.ts (0 hunks)
  • backend/src/api/automation/automationFind.ts (0 hunks)
  • backend/src/api/automation/automationList.ts (0 hunks)
  • backend/src/api/automation/automationSlackCallback.ts (0 hunks)
  • backend/src/api/automation/automationSlackConnect.ts (0 hunks)
  • backend/src/api/automation/automationUpdate.ts (0 hunks)
  • backend/src/api/automation/index.ts (0 hunks)
  • backend/src/api/index.ts (0 hunks)
  • backend/src/api/integration/helpers/discordAuthenticate.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotConnect.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotGetLists.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotGetMappableFields.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotOnboard.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotStopSyncMember.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotStopSyncOrganization.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotSyncMember.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotSyncOrganization.ts (0 hunks)
  • backend/src/api/integration/helpers/hubspotUpdateProperties.ts (0 hunks)
  • backend/src/api/integration/index.ts (0 hunks)
  • backend/src/api/tenant/tenantFind.ts (0 hunks)
  • backend/src/bin/discord-ws.ts (0 hunks)
  • backend/src/conf/configTypes.ts (0 hunks)
  • backend/src/conf/index.ts (2 hunks)
  • backend/src/database/models/automation.ts (0 hunks)
  • backend/src/database/models/automationExecution.ts (0 hunks)
  • backend/src/database/models/index.ts (0 hunks)
  • backend/src/database/repositories/automationExecutionRepository.ts (0 hunks)
  • backend/src/database/repositories/automationRepository.ts (0 hunks)
  • backend/src/database/repositories/integrationRepository.ts (0 hunks)
  • backend/src/database/repositories/memberRepository.ts (0 hunks)
  • backend/src/database/repositories/memberSyncRemoteRepository.ts (0 hunks)
  • backend/src/database/repositories/organizationSyncRemoteRepository.ts (0 hunks)
  • backend/src/database/repositories/types/automationTypes.ts (0 hunks)
  • backend/src/security/permissions.ts (0 hunks)
  • backend/src/serverless/utils/queueService.ts (0 hunks)
  • backend/src/services/activityService.ts (1 hunks)
  • backend/src/services/auth/passportStrategies/slackStrategy.ts (1 hunks)
  • backend/src/services/automationExecutionService.ts (0 hunks)
  • backend/src/services/automationService.ts (0 hunks)
  • backend/src/services/integrationService.ts (1 hunks)
  • backend/src/services/memberService.ts (0 hunks)
  • backend/src/types/automationTypes.ts (0 hunks)
  • backend/src/types/webhooks.ts (0 hunks)
  • scripts/builders/automations-worker.env (0 hunks)
  • scripts/builders/backend.env (1 hunks)
  • scripts/builders/integration-sync-worker.env (0 hunks)
  • scripts/cli (3 hunks)
  • scripts/services/automations-worker.yaml (0 hunks)
  • scripts/services/docker/Dockerfile.automations_worker (0 hunks)
  • scripts/services/docker/Dockerfile.automations_worker.dockerignore (0 hunks)
  • scripts/services/docker/Dockerfile.integration_sync_worker (0 hunks)
  • scripts/services/docker/Dockerfile.integration_sync_worker.dockerignore (0 hunks)
  • scripts/services/integration-sync-worker.yaml (0 hunks)
  • services/apps/automations_worker/package.json (0 hunks)
  • services/apps/automations_worker/src/activities.ts (0 hunks)
  • services/apps/automations_worker/src/activities/newActivityAutomations.ts (0 hunks)
  • services/apps/automations_worker/src/activities/newMemberAutomations.ts (0 hunks)
  • services/apps/automations_worker/src/main.ts (0 hunks)
  • services/apps/automations_worker/src/services/automation.service.ts (0 hunks)
  • services/apps/automations_worker/src/services/slack/newActivityBlocks.ts (0 hunks)
  • services/apps/automations_worker/src/services/slack/newMemberBlocks.ts (0 hunks)
  • services/apps/automations_worker/src/workflows.ts (0 hunks)
  • services/apps/automations_worker/src/workflows/newActivityAutomations.ts (0 hunks)
  • services/apps/automations_worker/src/workflows/newMemberAutomations.ts (0 hunks)
  • services/apps/automations_worker/tsconfig.json (0 hunks)
  • services/apps/data_sink_worker/config/default.json (1 hunks)
  • services/apps/data_sink_worker/src/conf/index.ts (1 hunks)
  • services/apps/data_sink_worker/src/service/activity.service.ts (1 hunks)
  • services/apps/data_sink_worker/src/service/member.service.ts (1 hunks)
  • services/apps/integration_run_worker/src/main.ts (0 hunks)
  • services/apps/integration_run_worker/src/queue/index.ts (0 hunks)
  • services/apps/integration_run_worker/src/service/integrationRunService.ts (1 hunks)
  • services/apps/integration_sync_worker/config/custom-environment-variables.json (0 hunks)
  • services/apps/integration_sync_worker/config/default.json (0 hunks)
  • services/apps/integration_sync_worker/config/docker.json (0 hunks)
  • services/apps/integration_sync_worker/config/production.json (0 hunks)
  • services/apps/integration_sync_worker/config/staging.json (0 hunks)
  • services/apps/integration_sync_worker/package.json (0 hunks)
  • services/apps/integration_sync_worker/src/conf/index.ts (0 hunks)
  • services/apps/integration_sync_worker/src/errors.ts (0 hunks)
  • services/apps/integration_sync_worker/src/main.ts (0 hunks)
  • services/apps/integration_sync_worker/src/queue/index.ts (0 hunks)
  • services/apps/integration_sync_worker/src/service/member.sync.service.ts (0 hunks)
  • services/apps/integration_sync_worker/src/service/opensearch.data.ts (0 hunks)
  • services/apps/integration_sync_worker/src/service/opensearch.service.ts (0 hunks)
  • services/apps/integration_sync_worker/src/service/organization.sync.service.ts (0 hunks)
  • services/apps/integration_sync_worker/tsconfig.json (0 hunks)
  • services/libs/common/src/env.ts (0 hunks)
  • services/libs/common/src/i18n/en.ts (0 hunks)
  • services/libs/common_services/src/services/emitters/index.ts (0 hunks)
  • services/libs/common_services/src/services/emitters/integrationSyncWorker.emitter.ts (0 hunks)
  • services/libs/data-access-layer/src/old/apps/automations_worker/automation.repo.ts (0 hunks)
  • services/libs/data-access-layer/src/old/apps/integration_run_worker/automation.repo.ts (0 hunks)
  • services/libs/data-access-layer/src/old/apps/integration_sync_worker/automation.repo.ts (0 hunks)
  • services/libs/data-access-layer/src/old/apps/integration_sync_worker/automationExecution.repo.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/addContactsToList.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/batchCreateMembers.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/batchCreateOrganizations.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/batchUpdateMembers.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/batchUpdateOrganizations.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/common.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/companies.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/companyById.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/contactAssociations.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/contactById.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/contacts.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/lists.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/properties.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/tokenInfo.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/types.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/api/utils/getOrganizationDomain.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/field-mapper/hubspotFieldMapper.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/field-mapper/mapperFactory.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/field-mapper/memberFieldMapper.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/field-mapper/organizationFieldMapper.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/field-mapper/utils/serialization.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/generateStreams.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/index.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/memberAttributes.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/processData.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/processStream.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/processSyncRemote.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/startSyncRemote.ts (0 hunks)
  • services/libs/integrations/src/integrations/hubspot/types.ts (0 hunks)
  • services/libs/integrations/src/integrations/index.ts (0 hunks)
  • services/libs/integrations/src/types.ts (0 hunks)
  • services/libs/queue/src/config.ts (0 hunks)
  • services/libs/queue/src/types.ts (0 hunks)
  • services/libs/queue/src/vendors/kafka/config.ts (0 hunks)
  • services/libs/queue/src/vendors/sqs/config.ts (0 hunks)
  • services/libs/types/src/automations.ts (0 hunks)
  • services/libs/types/src/enums/organizations.ts (0 hunks)
  • services/libs/types/src/enums/platforms.ts (0 hunks)
  • services/libs/types/src/enums/temporal.ts (0 hunks)
  • services/libs/types/src/index.ts (0 hunks)
  • services/libs/types/src/queue/integration_sync_worker/index.ts (0 hunks)
  • services/libs/types/src/temporal/automations.ts (0 hunks)
  • services/libs/types/src/temporal/index.ts (0 hunks)
💤 Files with no reviewable changes (130)
  • services/apps/integration_sync_worker/config/docker.json
  • backend/src/api/index.ts
  • services/apps/integration_sync_worker/config/staging.json
  • services/libs/common_services/src/services/emitters/index.ts
  • services/apps/integration_sync_worker/config/production.json
  • services/libs/types/src/enums/organizations.ts
  • services/apps/automations_worker/tsconfig.json
  • backend/src/api/integration/helpers/hubspotOnboard.ts
  • services/apps/integration_sync_worker/tsconfig.json
  • services/libs/types/src/temporal/index.ts
  • services/apps/integration_sync_worker/src/service/opensearch.data.ts
  • services/apps/integration_sync_worker/src/errors.ts
  • backend/src/api/integration/helpers/hubspotGetLists.ts
  • services/apps/integration_sync_worker/package.json
  • scripts/services/docker/Dockerfile.automations_worker.dockerignore
  • backend/src/api/integration/helpers/hubspotSyncOrganization.ts
  • backend/src/api/automation/automationSlackCallback.ts
  • services/apps/integration_run_worker/src/queue/index.ts
  • services/libs/queue/src/config.ts
  • backend/src/database/models/index.ts
  • backend/src/bin/discord-ws.ts
  • services/libs/queue/src/types.ts
  • services/libs/integrations/src/integrations/hubspot/memberAttributes.ts
  • backend/src/database/repositories/organizationSyncRemoteRepository.ts
  • backend/src/api/integration/helpers/hubspotStopSyncMember.ts
  • scripts/builders/integration-sync-worker.env
  • services/libs/queue/src/vendors/kafka/config.ts
  • backend/src/types/webhooks.ts
  • services/libs/common/src/env.ts
  • backend/src/api/integration/helpers/hubspotSyncMember.ts
  • backend/src/api/integration/helpers/hubspotUpdateProperties.ts
  • backend/src/api/integration/helpers/hubspotGetMappableFields.ts
  • backend/config/custom-environment-variables.json
  • scripts/builders/automations-worker.env
  • backend/src/api/integration/helpers/hubspotConnect.ts
  • services/apps/integration_sync_worker/config/default.json
  • services/libs/integrations/src/integrations/hubspot/startSyncRemote.ts
  • backend/src/api/automation/automationFind.ts
  • services/apps/integration_sync_worker/src/service/opensearch.service.ts
  • backend/src/api/automation/automationSlackConnect.ts
  • services/apps/automations_worker/src/activities.ts
  • services/apps/integration_sync_worker/config/custom-environment-variables.json
  • scripts/services/docker/Dockerfile.integration_sync_worker.dockerignore
  • services/libs/types/src/index.ts
  • backend/src/api/automation/automationCreate.ts
  • backend/src/api/integration/helpers/discordAuthenticate.ts
  • backend/src/database/repositories/integrationRepository.ts
  • backend/src/conf/configTypes.ts
  • backend/src/api/tenant/tenantFind.ts
  • backend/src/services/automationExecutionService.ts
  • services/libs/integrations/src/integrations/hubspot/api/utils/getOrganizationDomain.ts
  • services/libs/integrations/src/integrations/hubspot/api/tokenInfo.ts
  • services/libs/integrations/src/integrations/hubspot/api/common.ts
  • scripts/services/integration-sync-worker.yaml
  • services/apps/automations_worker/package.json
  • services/apps/automations_worker/src/workflows.ts
  • services/libs/integrations/src/integrations/hubspot/field-mapper/organizationFieldMapper.ts
  • backend/src/serverless/utils/queueService.ts
  • services/libs/queue/src/vendors/sqs/config.ts
  • backend/src/security/permissions.ts
  • services/apps/integration_run_worker/src/main.ts
  • backend/src/api/automation/automationList.ts
  • services/libs/data-access-layer/src/old/apps/integration_sync_worker/automation.repo.ts
  • services/apps/automations_worker/src/main.ts
  • backend/src/database/models/automationExecution.ts
  • backend/src/api/automation/index.ts
  • scripts/services/automations-worker.yaml
  • services/apps/integration_sync_worker/src/main.ts
  • services/libs/common_services/src/services/emitters/integrationSyncWorker.emitter.ts
  • services/libs/data-access-layer/src/old/apps/integration_sync_worker/automationExecution.repo.ts
  • services/libs/integrations/src/integrations/hubspot/processSyncRemote.ts
  • services/libs/types/src/enums/temporal.ts
  • services/libs/integrations/src/integrations/hubspot/api/contactAssociations.ts
  • services/libs/integrations/src/integrations/hubspot/api/addContactsToList.ts
  • services/libs/common/src/i18n/en.ts
  • scripts/services/docker/Dockerfile.integration_sync_worker
  • services/apps/integration_sync_worker/src/service/organization.sync.service.ts
  • services/libs/integrations/src/integrations/hubspot/field-mapper/mapperFactory.ts
  • services/libs/integrations/src/integrations/hubspot/api/contactById.ts
  • services/libs/data-access-layer/src/old/apps/integration_run_worker/automation.repo.ts
  • services/libs/integrations/src/integrations/hubspot/processStream.ts
  • services/libs/integrations/src/integrations/hubspot/field-mapper/hubspotFieldMapper.ts
  • services/apps/integration_sync_worker/src/conf/index.ts
  • services/libs/integrations/src/integrations/index.ts
  • services/libs/integrations/src/integrations/hubspot/api/batchCreateMembers.ts
  • services/libs/integrations/src/integrations/hubspot/field-mapper/memberFieldMapper.ts
  • backend/src/api/automation/automationExecutionFind.ts
  • services/libs/integrations/src/integrations/hubspot/processData.ts
  • backend/src/database/repositories/types/automationTypes.ts
  • services/apps/automations_worker/src/workflows/newActivityAutomations.ts
  • backend/src/database/repositories/memberRepository.ts
  • backend/src/api/integration/helpers/hubspotStopSyncOrganization.ts
  • services/libs/integrations/src/integrations/hubspot/api/companyById.ts
  • backend/src/database/repositories/memberSyncRemoteRepository.ts
  • backend/src/database/repositories/automationExecutionRepository.ts
  • services/libs/types/src/enums/platforms.ts
  • services/libs/integrations/src/integrations/hubspot/field-mapper/utils/serialization.ts
  • services/apps/automations_worker/src/workflows/newMemberAutomations.ts
  • services/apps/automations_worker/src/activities/newActivityAutomations.ts
  • backend/src/services/automationService.ts
  • services/libs/integrations/src/integrations/hubspot/api/properties.ts
  • backend/src/database/models/automation.ts
  • services/libs/integrations/src/integrations/hubspot/generateStreams.ts
  • services/apps/automations_worker/src/services/slack/newActivityBlocks.ts
  • backend/src/api/automation/automationUpdate.ts
  • services/libs/data-access-layer/src/old/apps/automations_worker/automation.repo.ts
  • backend/src/api/automation/automationDestroy.ts
  • services/libs/integrations/src/integrations/hubspot/api/lists.ts
  • services/libs/integrations/src/integrations/hubspot/api/batchUpdateMembers.ts
  • backend/src/services/memberService.ts
  • services/libs/types/src/temporal/automations.ts
  • backend/src/api/integration/index.ts
  • services/libs/integrations/src/types.ts
  • services/libs/integrations/src/integrations/hubspot/api/contacts.ts
  • services/libs/integrations/src/integrations/hubspot/index.ts
  • services/apps/integration_sync_worker/src/service/member.sync.service.ts
  • services/libs/integrations/src/integrations/hubspot/api/batchCreateOrganizations.ts
  • services/libs/integrations/src/integrations/hubspot/api/companies.ts
  • services/libs/integrations/src/integrations/hubspot/api/batchUpdateOrganizations.ts
  • services/libs/types/src/queue/integration_sync_worker/index.ts
  • services/apps/integration_sync_worker/src/queue/index.ts
  • backend/src/database/repositories/automationRepository.ts
  • services/libs/integrations/src/integrations/hubspot/api/types.ts
  • scripts/services/docker/Dockerfile.automations_worker
  • services/apps/automations_worker/src/services/slack/newMemberBlocks.ts
  • services/apps/automations_worker/src/services/automation.service.ts
  • services/libs/types/src/automations.ts
  • services/apps/automations_worker/src/activities/newMemberAutomations.ts
  • backend/src/types/automationTypes.ts
  • services/libs/integrations/src/integrations/hubspot/types.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint-format-services
🔇 Additional comments (18)
backend/src/services/auth/passportStrategies/slackStrategy.ts (1)

Line range hint 8-45: Verify impact of removing getSlackNotifierStrategy

The removal of getSlackNotifierStrategy function might affect other parts of the codebase that were using the Slack notifier functionality. Let's verify there are no remaining references to this function.

services/apps/integration_run_worker/src/service/integrationRunService.ts (3)

Line range hint 1-14: LGTM! Clean-up of imports aligns with PR objectives.

The removal of automation and HubSpot-related imports streamlines the service to focus on core integration run functionality.


Line range hint 18-33: LGTM! Clean dependency injection pattern maintained.

The constructor maintains a clean dependency injection pattern while removing unnecessary automation-related dependencies.


Line range hint 1-428: Overall changes align well with PR objectives.

The removal of HubSpot and automation-related code has been executed cleanly while maintaining the core integration functionality and code quality. The service remains focused and well-structured.

scripts/cli (2)

744-746: LGTM! Removed integration-related services.

The changes align with the PR objectives by removing integration-related services from the ignored list.


Line range hint 744-861: Verify the impact of service removals across the codebase.

Let's verify that the removed services are not referenced elsewhere in the codebase.

scripts/builders/backend.env (1)

4-4: Ensure all references to discord-ws are removed

The SERVICES variable has been updated to remove discord-ws. Please verify that any dependencies, scripts, or configurations that previously referenced discord-ws have been updated or removed to prevent potential errors.

backend/.env.dist.local (1)

112-112: Confirm removal of hubspot from integrations

The CROWD_NANGO_INTEGRATIONS variable no longer includes hubspot. Ensure that all configurations, code dependencies, and documentation related to the HubSpot integration have been properly updated or removed to reflect this change.

backend/id-openapi.yaml (2)

191-191: LGTM! Consistent with POST endpoint changes.

The removal of 'hubspot' from the source enum maintains consistency with the changes in the POST endpoint.


106-106: Verify impact of removing 'hubspot' source.

The removal of 'hubspot' from the source enum aligns with the PR objective. However, this is a breaking change that could affect existing API clients.

Let's verify if there are any existing API clients using the 'hubspot' source:

✅ Verification successful

Removal of 'hubspot' source is safe and aligned with integration removal.

The removal of 'hubspot' from the source enum is part of the broader cleanup of HubSpot integration. The codebase search confirms that all HubSpot-related functionality is being removed, making this a safe and necessary change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to hubspot source in the codebase
rg -i "source.*['\"]hubspot['\"]" --type ts --type js

Length of output: 59


Script:

#!/bin/bash
# Search for any remaining hubspot-related code
rg -i "hubspot" --type ts --type js --type yaml

# Search for API client implementations and tests related to organization endpoints
rg -i "member/.*/organization" --type ts --type js

# Search for test files containing organization-related tests
fd -e test.ts -e test.js -e spec.ts -e spec.js | xargs rg -i "organization.*source"

Length of output: 27415

services/apps/data_sink_worker/src/service/member.service.ts (1)

Line range hint 92-95: Verify Member Creation Logic Without Temporal Workflows.

With the removal of temporal workflows, ensure that the member creation process still functions as expected, and any dependent asynchronous processes are handled appropriately.

Please confirm that removing the temporal workflows does not affect member onboarding or other related processes.

services/apps/data_sink_worker/src/conf/index.ts (1)

59-63: 🛠️ Refactor suggestion

Update Configuration Type Consistently Across the Codebase.

The type for temporalConfig and the return type of TEMPORAL_CONFIG have been changed from IDataSinkWorkerTemporalConfig to ITemporalConfig. Ensure that all usages and references to IDataSinkWorkerTemporalConfig are updated accordingly to prevent type errors.

Run the following script to identify any remaining references to IDataSinkWorkerTemporalConfig:

✅ Verification successful

Type Change Verification Complete - All References Updated

The codebase consistently uses ITemporalConfig from @crowd/temporal, and there are no remaining references to IDataSinkWorkerTemporalConfig. The type change has been properly implemented across all files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find references to `IDataSinkWorkerTemporalConfig` in the codebase.

rg 'IDataSinkWorkerTemporalConfig'

Length of output: 34


Script:

#!/bin/bash
# Search for ITemporalConfig type definition and usage
echo "=== Searching for ITemporalConfig ==="
rg "ITemporalConfig" -A 2

echo -e "\n=== Checking imports in the configuration file ==="
cat services/apps/data_sink_worker/src/conf/index.ts | grep -A 5 "import.*{.*}"

echo -e "\n=== Searching for similar temporal config types ==="
rg "I.*TemporalConfig"

Length of output: 3357

backend/src/conf/index.ts (2)

147-147: Confirm Compatibility with Updated TEMPORAL_CONFIG Type.

The TEMPORAL_CONFIG constant now uses the ITemporalConfig type. Verify that all properties and methods previously accessed on TEMPORAL_CONFIG are compatible with ITemporalConfig to prevent any runtime issues.

Please review any usage of TEMPORAL_CONFIG in the codebase to ensure compatibility with the new type.


7-7: 🛠️ Refactor suggestion

Import ITemporalConfig and Remove IBackendTemporalConfig.

The import statement now includes ITemporalConfig from @crowd/temporal. Ensure that IBackendTemporalConfig is no longer used and that all references are replaced with ITemporalConfig.

Run the following script to find any remaining uses of IBackendTemporalConfig:

✅ Verification successful

Successful Migration to ITemporalConfig

The codebase shows no remaining uses of IBackendTemporalConfig and demonstrates proper implementation of ITemporalConfig from @crowd/temporal.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for `IBackendTemporalConfig` usages in the codebase.

rg 'IBackendTemporalConfig'

Length of output: 27


Script:

#!/bin/bash
# Search for ITemporalConfig usages and related patterns
echo "=== Searching for ITemporalConfig ==="
rg "ITemporalConfig" -A 2

echo -e "\n=== Checking for temporal config type definitions ==="
ast-grep --pattern 'interface $_ extends ITemporalConfig'
ast-grep --pattern 'type $_ = ITemporalConfig'

Length of output: 65888

services/apps/data_sink_worker/config/default.json (1)

6-6: LGTM! Removal of automations queue configuration.

The removal of the automationsTaskQueue from temporal configuration aligns with the PR objective of removing automation functionality.

backend/config/default.json (1)

49-49: LGTM! Consistent removal of automations configuration.

The removal of automationsTaskQueue from temporal configuration is consistent with the changes in the data sink worker and aligns with the PR objective.

backend/src/services/activityService.ts (1)

22-22: LGTM! Clean removal of automation-related imports.

The removal of WorkflowIdReusePolicy and TemporalWorkflowId imports is clean and aligns with the PR objective of removing automation functionality.

services/apps/data_sink_worker/src/service/activity.service.ts (1)

38-38: LGTM! Consistent removal of automation-related code.

The removal of temporal workflow code and edition-specific logic is consistent with the changes in the backend service and aligns with the PR objective.

@themarolt themarolt merged commit 7c1c0dc into main Jan 16, 2025
7 checks passed
@themarolt themarolt deleted the remove/LFX-1947 branch January 16, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants