Skip to content

fix: refactor project table (CM-1165)#4113

Merged
ulemons merged 1 commit into
mainfrom
feat/refactor-project-catalogs-table
May 14, 2026
Merged

fix: refactor project table (CM-1165)#4113
ulemons merged 1 commit into
mainfrom
feat/refactor-project-catalogs-table

Conversation

@ulemons

@ulemons ulemons commented May 14, 2026

Copy link
Copy Markdown
Contributor

Note

High Risk
High risk because it drops the evaluatedProjects table and removes the ossfCriticalityScore column/index, which can cause irreversible data loss and break any code or queries still depending on them.

Overview
This migration removes legacy project evaluation storage by dropping the evaluatedProjects table and deleting the projectCatalog.ossfCriticalityScore column (and its index).

It extends projectCatalog with new metadata fields (source, action, evaluatedAt, onboardedAt) and adds indexes on source and action to support the updated querying model.

Reviewed by Cursor Bugbot for commit db4a8f4. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulemons ulemons self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 10:24
@ulemons ulemons added the Feature Created by Linear-GitHub Sync label May 14, 2026
@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.

Copilot AI 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.

Pull request overview

This PR introduces a database schema refactor for the projects catalog by removing the separate evaluatedProjects table and reshaping projectCatalog (dropping ossfCriticalityScore, adding source/action/evaluatedAt/onboardedAt, and indexing the new fields).

Changes:

  • Drop evaluatedProjects table.
  • Remove ossfCriticalityScore from projectCatalog and add source, action, evaluatedAt, onboardedAt columns.
  • Add new indexes on projectCatalog.source and projectCatalog.action.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
backend/src/database/migrations/V1778749030__refactor-projects-catalog.sql Drops evaluatedProjects, removes ossfCriticalityScore, adds new catalog columns + indexes.
backend/src/database/migrations/U1778749030__refactor-projects-catalog.sql Present but empty undo migration file.
Comments suppressed due to low confidence (3)

backend/src/database/migrations/V1778749030__refactor-projects-catalog.sql:2

  • This migration drops the "evaluatedProjects" table, but the codebase still queries/inserts/updates it (e.g. services/libs/data-access-layer/src/evaluated-projects/evaluatedProjects.ts). If the table is being replaced by projectCatalog columns, the corresponding data-access layer and any workers/jobs need to be updated in the same release to prevent runtime SQL errors after migration.
-- Drop evaluatedProjects table (data migrated into projectCatalog)
DROP TABLE IF EXISTS "evaluatedProjects";

backend/src/database/migrations/V1778749030__refactor-projects-catalog.sql:6

  • This migration drops projectCatalog.ossfCriticalityScore, but it is still referenced by ingestion/upsert code (e.g. services/apps/automatic_projects_discovery_worker/... and services/libs/data-access-layer/src/project-catalog/*). Without updating those call sites (and possibly the projectCatalog column list/types), deploys will start failing with "column does not exist" errors.
-- Remove ossfCriticalityScore from projectCatalog
ALTER TABLE "projectCatalog" DROP COLUMN IF EXISTS "ossfCriticalityScore";
DROP INDEX IF EXISTS "ix_projectCatalog_ossfCriticalityScore";

backend/src/database/migrations/V1778749030__refactor-projects-catalog.sql:16

  • This migration uses IF EXISTS/IF NOT EXISTS for DROP/ADD COLUMN, but the new CREATE INDEX statements are not guarded. If the migration is re-run or partially applied in any environment, CREATE INDEX will error out. Consider using CREATE INDEX IF NOT EXISTS (and/or CONCURRENTLY if this table can be large) for consistency and safer replays.
CREATE INDEX "ix_projectCatalog_source" ON "projectCatalog" ("source");
CREATE INDEX "ix_projectCatalog_action" ON "projectCatalog" ("action");

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

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons force-pushed the feat/refactor-project-catalogs-table branch from 637047e to db4a8f4 Compare May 14, 2026 11:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 2 potential issues.

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.

Reviewed by Cursor Bugbot for commit db4a8f4. Configure here.

@ulemons ulemons merged commit 4b7dcce into main May 14, 2026
15 checks passed
@ulemons ulemons deleted the feat/refactor-project-catalogs-table branch May 14, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants