Skip to content

refactor: delete orphan modules - #43046

Open
tassoevan wants to merge 4 commits into
developfrom
refactor/delete-orphans
Open

tassoevan wants to merge 4 commits into
developfrom
refactor/delete-orphans

Conversation

@tassoevan

@tassoevan tassoevan commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Deletes modules in apps/meteor that nothing imports. Each was found with an esbuild reachability graph from the client and server entry points (plus every spec, story and test file as an extra entry), then confirmed by grepping the repo for the exported symbol.

Deleted, unreachable from any entry point:

  • client/lib/utils/callWithErrorHandling.ts, client/lib/utils/timeAgo.ts
  • server/lib/cloud/{checkUserHasCloudLogin,finishOAuthAuthorization,getOAuthAuthorizationUrl,getWorkspaceKey,startRegisterWorkspace}.ts
  • server/lib/http/call.ts, server/lib/integrations/lib/compileIntegrationScript.ts
  • server/lib/users/{getStatusText,gravatarDeprecation}.ts, server/lib/utils/functions/isDocker.ts
  • ee/server/sdk/types/index.ts (type barrel; callers import from the source files)

Narrowed:

  • engagementDashboard/dataView/colors.ts was only used by LegendSymbol.stories.tsx; inlined into the story.
  • OutboundMessageWizard/forms/index.ts re-exported runtime modules but its two importers only needed SubmitPayload; replaced by forms/SubmitPayload.ts.

Issue(s)

Steps to test or reproduce

No behavior change. Typecheck and unit tests cover it.

Further comments

Left out on purpose:

  • ee/server/patches/fetchContactHistory.ts is also never imported, but it is a missing wire-up rather than dead code; it is fixed in fix/contact-history-source-filter.
  • server/lib/cloud/userLogout.ts is only reached from its own test; removing it with its test is a separate change.

🤖 Generated with Claude Code

View guided diff

Task: ARCH-2585

Summary by CodeRabbit

  • Changes
    • Several legacy helper functions have been removed, including utilities for cloud workspace registration and authorization, date formatting, and server-side HTTP requests.
    • No changes to end-user behavior are specified in this update.

@tassoevan
tassoevan requested review from a team as code owners October 22, 2026 20:29
@tassoevan tassoevan added this to the 9.0.0 milestone Oct 22, 2026
@dionisio-bot

dionisio-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@tassoevan

Copy link
Copy Markdown
Member Author

/jira ARCH

@changeset-bot

changeset-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 958625f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86461d4a-4b0d-43e8-886a-ca46a7d204a8
📥 Commits

Reviewing files that changed from the base of the PR and between 8d9fbae and 958625f.

📒 Files selected for processing: 18
  • apps/meteor/client/lib/utils/callWithErrorHandling.ts
  • apps/meteor/client/lib/utils/timeAgo.ts
  • apps/meteor/client/views/admin/engagementDashboard/dataView/LegendSymbol.stories.tsx
  • apps/meteor/client/views/admin/engagementDashboard/dataView/colors.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/OutboundMessageWizard.tsx
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/forms/SubmitPayload.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/utils/outbound-message.ts
  • apps/meteor/ee/server/sdk/types/index.ts
  • apps/meteor/server/lib/cloud/checkUserHasCloudLogin.ts
  • apps/meteor/server/lib/cloud/finishOAuthAuthorization.ts
  • apps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.ts
  • apps/meteor/server/lib/cloud/getWorkspaceKey.ts
  • apps/meteor/server/lib/cloud/startRegisterWorkspace.ts
  • apps/meteor/server/lib/http/call.ts
  • apps/meteor/server/lib/integrations/lib/compileIntegrationScript.ts
  • apps/meteor/server/lib/users/getStatusText.ts
  • apps/meteor/server/lib/users/gravatarDeprecation.ts
  • apps/meteor/server/lib/utils/functions/isDocker.ts
💤 Files with no reviewable changes: 15
  • apps/meteor/server/lib/utils/functions/isDocker.ts
  • apps/meteor/server/lib/cloud/finishOAuthAuthorization.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/forms/SubmitPayload.ts
  • apps/meteor/ee/server/sdk/types/index.ts
  • apps/meteor/server/lib/cloud/startRegisterWorkspace.ts
  • apps/meteor/server/lib/cloud/checkUserHasCloudLogin.ts
  • apps/meteor/server/lib/cloud/getWorkspaceKey.ts
  • apps/meteor/server/lib/integrations/lib/compileIntegrationScript.ts
  • apps/meteor/client/views/admin/engagementDashboard/dataView/colors.ts
  • apps/meteor/server/lib/cloud/getOAuthAuthorizationUrl.ts
  • apps/meteor/client/lib/utils/callWithErrorHandling.ts
  • apps/meteor/client/lib/utils/timeAgo.ts
  • apps/meteor/server/lib/http/call.ts
  • apps/meteor/server/lib/users/getStatusText.ts
  • apps/meteor/server/lib/users/gravatarDeprecation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 6
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: ⚙️ Test Guard
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📚 Code guidelines: 1
CLAUDE.md — auto-discovered
📓 Path-based instructions: 1
Source excerpt: Comments state the **intent** of a function, never the mechanism, and never explain code that lives in another file — that belongs in `docs/features/`.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • apps/meteor/client/views/omnichannel/components/outboundMessage/utils/outbound-message.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/OutboundMessageWizard.tsx
  • apps/meteor/client/views/admin/engagementDashboard/dataView/LegendSymbol.stories.tsx
🔇 Additional comments: 3
apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/OutboundMessageWizard.tsx: 1

13-13: LGTM!

apps/meteor/client/views/omnichannel/components/outboundMessage/utils/outbound-message.ts: 1

11-11: LGTM!

apps/meteor/client/views/admin/engagementDashboard/dataView/LegendSymbol.stories.tsx: 1

2-2: LGTM!

Also applies to: 21-21, 26-26

Walkthrough

This pull request removes client and server helpers and exports. It updates the engagement dashboard story to import Fuselage color tokens and changes outbound-message type imports to target the SubmitPayload module directly.

Changes

Utility and export cleanup

Layer / File(s) Summary
Client helper removals
apps/meteor/client/lib/utils/*
The callWithErrorHandling wrapper and timeAgo helper were removed.
Dashboard color tokens
apps/meteor/client/views/admin/engagementDashboard/dataView/*
The story now imports Fuselage color tokens directly. The local color arrays were removed.
Outbound payload imports
apps/meteor/client/views/omnichannel/components/outboundMessage/...
The SubmitPayload imports now target the module directly. The form component re-exports were removed from that module.
Cloud registration and OAuth helpers
apps/meteor/server/lib/cloud/*
The cloud login, workspace-key, registration, and OAuth authorization helpers were removed.
Server utilities and type export
apps/meteor/server/lib/http/call.ts, apps/meteor/server/lib/integrations/lib/compileIntegrationScript.ts, apps/meteor/server/lib/users/*, apps/meteor/server/lib/utils/functions/isDocker.ts, apps/meteor/ee/server/sdk/types/index.ts
The HTTP call and integration script helpers, user helpers, Docker detection utility, and IMessageReadsService type re-export were removed.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested labels: type: chore

Suggested reviewers: pierre-lehnen-rc, ggazzo, dougfabris

Merge Risk: ⚪ Minimal · up to 95862

The cleanup is mergeable; no in-repository behavior or build risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: deleting unused or orphaned modules as a refactor.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors: 1
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 18 files

View guided diff | Re-trigger cubic

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.49%. Comparing base (8d9fbae) to head (958625f).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #43046      +/-   ##
===========================================
+ Coverage    71.45%   71.49%   +0.04%     
===========================================
  Files         5295     5295              
  Lines       228091   228091              
  Branches     42229    42334     +105     
===========================================
+ Hits        162981   163084     +103     
+ Misses       59884    59784     -100     
+ Partials      5226     5223       -3     
Flag Coverage Δ
e2e 58.95% <ø> (+0.07%) ⬆️
e2e-api 49.35% <ø> (+0.30%) ⬆️
unit 71.55% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant