Skip to content

feat: adding project-discovery-worker (CM-949)#3832

Merged
ulemons merged 35 commits intomainfrom
feat/add-project-discovery-worker
Mar 26, 2026
Merged

feat: adding project-discovery-worker (CM-949)#3832
ulemons merged 35 commits intomainfrom
feat/add-project-discovery-worker

Conversation

@ulemons
Copy link
Copy Markdown
Contributor

@ulemons ulemons commented Feb 9, 2026

Summary

This PR introduces the basic structure for the new worker.

The implementation includes the foundational setup required to run the worker, without full business logic.

Included

  • Worker initialization and configuration
  • Base execution flow
  • Placeholder structure for future processing logic

⚠️ This is just the basic structure of the worker, i won't probably merge this before the other prs of the POC will be completed


Note

Medium Risk
Introduces new database tables plus a scheduled Temporal worker that ingests large external datasets into Postgres, which can impact migrations, load, and operational stability if misconfigured. Most changes are additive but touch persistence, background scheduling, and deployment artifacts.

Overview
Adds automatic project discovery persistence and ingestion. This introduces new Postgres tables projectCatalog and evaluatedProjects (with indexes and down-migration), plus a data-access-layer for querying/inserting/upserting both entities.

Adds a new Temporal worker app automatic_projects_discovery_worker that schedules a daily discoverProjects workflow and processes external datasets (CSV from OSSF bucket and paginated JSON from an LF Criticality Score API) in batches, bulk-upserting into projectCatalog. Includes new Dockerfile/compose and build env for running/deploying the worker, along with lockfile updates for the new workspace package and dependencies.

Written by Cursor Bugbot for commit 75cb4b6. This will update automatically on new commits. Configure here.

@ulemons ulemons self-assigned this Feb 9, 2026
@ulemons ulemons added the POC label Feb 11, 2026
@ulemons ulemons changed the title feat: adding project-discovery-worker feat: adding project-discovery-worker (CM-949) Feb 11, 2026
@ulemons ulemons requested a review from Copilot February 11, 2026 10:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new Temporal worker app (automatic_projects_discovery_worker) and adds initial database schema to support automatic project discovery/evaluation.

Changes:

  • Added a new worker service with Temporal workflow/activity scaffolding plus a schedule that registers a cron-based Temporal Schedule.
  • Added Docker and compose definitions to run the worker in the existing services stack.
  • Added DB migrations for projectCatalog and evaluatedProjects tables.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/apps/automatic_projects_discovery_worker/tsconfig.json Adds TS config for the new worker package.
services/apps/automatic_projects_discovery_worker/src/workflows/discoverProjects.ts Introduces a placeholder Temporal workflow that calls a logging activity.
services/apps/automatic_projects_discovery_worker/src/workflows.ts Exports the worker’s workflows for registration.
services/apps/automatic_projects_discovery_worker/src/schedules/scheduleProjectsDiscovery.ts Registers a Temporal Schedule to trigger the workflow on a cron.
services/apps/automatic_projects_discovery_worker/src/main.ts Worker bootstrap: init, schedule registration, start.
services/apps/automatic_projects_discovery_worker/src/activities/activities.ts Placeholder activity implementation (logs a run).
services/apps/automatic_projects_discovery_worker/src/activities.ts Barrel export for activities registration.
services/apps/automatic_projects_discovery_worker/package.json Adds the new worker package and scripts.
scripts/services/docker/Dockerfile.automatic_projects_discovery_worker Adds container build/run definition for the worker.
scripts/services/automatic-projects-discovery-worker.yaml Adds docker-compose definitions for running the worker (prod + dev).
scripts/builders/automatic-projects-discovery-worker.env Adds builder configuration for publishing/building the worker image.
pnpm-lock.yaml Adds lockfile entries for the new workspace package (but currently includes an extra incorrect importer).
backend/src/database/migrations/V1770653666__add-automatic_projects_discovery-tables.sql Adds tables/indexes for project discovery catalog + evaluations.
backend/src/database/migrations/U1770653666__add-automatic_projects_discovery-tables.sql Adds down migration to drop the tables/indexes.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 468 to +533
version: 3.3.3

services/apps/automatic_project_discovery_worker:
dependencies:
'@crowd/archetype-standard':
specifier: workspace:*
version: link:../../archetypes/standard
'@crowd/archetype-worker':
specifier: workspace:*
version: link:../../archetypes/worker
'@crowd/common':
specifier: workspace:*
version: link:../../libs/common
'@crowd/common_services':
specifier: workspace:*
version: link:../../libs/common_services
'@crowd/data-access-layer':
specifier: workspace:*
version: link:../../libs/data-access-layer
'@crowd/logging':
specifier: workspace:*
version: link:../../libs/logging
'@crowd/redis':
specifier: workspace:*
version: link:../../libs/redis
'@crowd/temporal':
specifier: workspace:*
version: link:../../libs/temporal
'@crowd/types':
specifier: workspace:*
version: link:../../libs/types
'@temporalio/activity':
specifier: ~1.11.8
version: 1.11.8
'@temporalio/client':
specifier: ~1.11.8
version: 1.11.8
'@temporalio/workflow':
specifier: ~1.11.8
version: 1.11.8
tsx:
specifier: ^4.7.1
version: 4.7.3
typescript:
specifier: ^5.6.3
version: 5.6.3
devDependencies:
'@types/node':
specifier: ^20.8.2
version: 20.12.7
nodemon:
specifier: ^3.0.1
version: 3.1.0

services/apps/automatic_projects_discovery_worker:
dependencies:
'@crowd/archetype-standard':
specifier: workspace:*
version: link:../../archetypes/standard
'@crowd/archetype-worker':
specifier: workspace:*
version: link:../../archetypes/worker
'@crowd/common':
specifier: workspace:*
version: link:../../libs/common
'@crowd/common_services':
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

pnpm-lock.yaml contains two importers for this new app: services/apps/automatic_projects_discovery_worker (correct) and services/apps/automatic_project_discovery_worker (missing the s in projects). The latter path doesn’t exist in the repo and will leave the lockfile in an inconsistent state (pnpm will warn/error depending on settings). Please regenerate or edit the lockfile so only the correct importer remains.

Copilot uses AI. Check for mistakes.
@ulemons ulemons requested a review from themarolt February 11, 2026 10:44
@ulemons ulemons marked this pull request as ready for review February 11, 2026 10:45
nodemon:
specifier: ^3.0.1
version: 3.1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale workspace importer in lockfile

Medium Severity

pnpm-lock.yaml adds an importer for services/apps/automatic_project_discovery_worker, but that workspace path is not present while the real app is services/apps/automatic_projects_discovery_worker. This leaves a stale duplicate importer in the lockfile, creating an inconsistent workspace definition that can destabilize pnpm install --frozen-lockfile behavior and dependency maintenance.

Fix in Cursor Fix in Web

themarolt
themarolt previously approved these changes Feb 11, 2026
svc.log.info('Schedule already registered in Temporal.')
svc.log.info('Configuration may have changed since. Please make sure they are in sync.')
} else {
throw new Error(err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

throw new Error(err) loses original error context

Low Severity

throw new Error(err) wraps the caught err (likely already an Error) inside a new Error, which discards the original stack trace, error type, and any custom properties. The resulting error message will be the stringified version of the original error (e.g., "Error: ...") rather than the original message. Rethrowing err directly would preserve all original context, making debugging much easier.

Fix in Cursor Fix in Web

@ulemons ulemons force-pushed the feat/add-project-discovery-worker branch from e669595 to b03cb7a Compare March 24, 2026 10:22
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ulemons ulemons force-pushed the feat/add-project-discovery-worker branch from b03cb7a to 425e4cb Compare March 24, 2026 10:23
ulemons and others added 7 commits March 24, 2026 15:01
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons force-pushed the feat/add-project-discovery-worker branch from b5c3b03 to 7e6dc18 Compare March 24, 2026 14:01
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
themarolt
themarolt previously approved these changes Mar 25, 2026
ulemons and others added 4 commits March 26, 2026 09:25
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
ulemons and others added 13 commits March 26, 2026 10:13
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
ulemons and others added 7 commits March 26, 2026 10:18
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons force-pushed the feat/add-project-discovery-worker branch from 28630f1 to b765959 Compare March 26, 2026 09:18
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons merged commit b201f9f into main Mar 26, 2026
15 checks passed
@ulemons ulemons deleted the feat/add-project-discovery-worker branch March 26, 2026 10:29
mbani01 pushed a commit that referenced this pull request Mar 26, 2026
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants