Repository navigation
refactor: move the onboarding request classifier to project-onboarding (CM-1841) - #4883
Conversation
PR SummaryLow Risk Overview The lib now exposes
Reviewed by Cursor Bugbot for commit 352d4df. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Remove stale worker dependencies and regenerate the manually edited lockfile before merging.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Moves reusable onboarding classification logic into @crowd/project-onboarding, enabling additional consumers while retaining worker-specific orchestration.
Changes:
- Extracts classification, tracing, and CDP lookup logic into the shared library.
- Moves dependency wiring behind a subpath import.
- Updates discovery-worker imports and dependencies.
| File | Description |
|---|---|
services/libs/project-onboarding/tsconfig.json |
Adds required project references. |
services/libs/project-onboarding/src/requestClassifierDeps.ts |
Provides infrastructure dependency wiring. |
services/libs/project-onboarding/src/index.ts |
Exports classifier and tracing APIs. |
services/libs/project-onboarding/src/classifyRequest.ts |
Implements the reusable classifier. |
services/libs/project-onboarding/src/classificationTrace.ts |
Moves classification tracing into the library. |
services/libs/project-onboarding/src/classificationTrace.test.ts |
Relocates tracing tests. |
services/libs/project-onboarding/src/cdpSegmentLookup.ts |
Moves CDP segment lookup wiring. |
services/libs/project-onboarding/package.json |
Adds classifier infrastructure dependencies. |
services/apps/automatic_projects_discovery_worker/src/bin/classify-onboarding-cases.ts |
Uses shared dependency wiring. |
services/apps/automatic_projects_discovery_worker/src/bin/classificationCases.ts |
Imports the shared node type. |
services/apps/automatic_projects_discovery_worker/src/activities/requestClassification.ts |
Delegates classification to the library. |
services/apps/automatic_projects_discovery_worker/src/activities/requestClassification.test.ts |
Updates shared type imports. |
services/apps/automatic_projects_discovery_worker/src/activities/activities.ts |
Uses shared classifier utilities. |
pnpm-lock.yaml |
Records new workspace dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "@crowd/common_services": "workspace:*", | ||
| "@crowd/data-access-layer": "workspace:*", | ||
| "@crowd/logging": "workspace:*", | ||
| "@crowd/snowflake": "workspace:*", | ||
| "@crowd/types": "workspace:*" |
bf5e214 to
c8a8b84
Compare
…g (CM-1841) Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
…boarding (CM-1841) Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
388dca8 to
a97359b
Compare
| export async function classifyOnboardingRequest( | ||
| requestText: string, | ||
| deps: IRequestClassificationDeps, | ||
| ): Promise<IRequestClassification> { |
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The extraction preserves existing behavior, updates dependency metadata consistently, and includes focused regression coverage.
Review effort: Balanced
Findings: 2
Open (2)
Resolved since last review (1)
Files not reviewed (1)
- pnpm-lock.yaml: Generated file


Summary
@crowd/project-onboardingso the backend Slack bot can use it:classifyOnboardingRequest(text, deps)returning{resolution, node, trace}, the trace/log-entry module and the CDP segment lookup.withRequestClassifierDeps) lives inproject-onboarding/src/requestClassifierDeps.tsand is imported by subpath, not through the index, so the other importers of the lib do not pick up the heavy dependencies.Notes
project-onboardingnow depends oncommon_services,data-access-layer,logging,snowflakeandtypes(package.json, tsconfig references). No dependency cycle: none of them imports the lib.common_services,snowflakeandtypes, which moved with the code.pnpm-lock.yamlis consistent withpnpm install --lockfile-onlyand--frozen-lockfile.Test plan
vitest(worker and lib),tsc -bfor the worker andautomatic_onboarding_worker,pnpm lint --deny-warnings,pnpm format,check-tsconfig-references.sh