Skip to content

Commit 704d7ea

Browse files
authored
Merge branch 'main' into bugfix/tb-issue-analysis-filtering-old-dates-out
2 parents 444beef + 2a78530 commit 704d7ea

100 files changed

Lines changed: 3934 additions & 1849 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"pg": "^8.7.3",
129129
"pg-promise": "^11.4.3",
130130
"sanitize-html": "^2.7.1",
131-
"sequelize": "6.21.2",
131+
"sequelize": "6.37.8",
132132
"sequelize-cli-typescript": "^3.2.0-c",
133133
"slack-block-builder": "^2.7.2",
134134
"socket.io": "^4.5.4",

backend/src/api/member/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default (app) => {
99
app.put(`/member/:id`, safeWrap(require('./memberUpdate').default))
1010
app.delete(`/member`, safeWrap(require('./memberDestroy').default))
1111
app.post(`/member/autocomplete`, safeWrap(require('./memberAutocomplete').default))
12-
app.get(`/member/active`, safeWrap(require('./memberActiveList').default))
1312
app.get(`/member/bot-suggestions`, safeWrap(require('./memberBotSuggestionsList').default))
1413

1514
app.get(`/member/:id`, safeWrap(require('./memberFind').default))

backend/src/api/member/memberActiveList.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

backend/src/api/organization/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default (app) => {
66
app.put(`/organization/:id`, safeWrap(require('./organizationUpdate').default))
77
app.delete(`/organization`, safeWrap(require('./organizationDestroy').default))
88
app.post(`/organization/autocomplete`, safeWrap(require('./organizationAutocomplete').default))
9-
app.get(`/organization/active`, safeWrap(require('./organizationActiveList').default))
109
app.get(`/organization/:id`, safeWrap(require('./organizationFind').default))
1110

1211
app.put(`/organization/:organizationId/merge`, safeWrap(require('./organizationMerge').default))

backend/src/api/organization/organizationActiveList.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
DROP INDEX IF EXISTS "ix_evaluatedProjects_onboarded";
2+
DROP INDEX IF EXISTS "ix_evaluatedProjects_evaluationScore";
3+
DROP INDEX IF EXISTS "ix_evaluatedProjects_evaluationStatus";
4+
DROP INDEX IF EXISTS "uix_evaluatedProjects_projectCatalogId";
5+
DROP TABLE IF EXISTS "evaluatedProjects";
6+
7+
DROP INDEX IF EXISTS "ix_projectCatalog_syncedAt";
8+
DROP INDEX IF EXISTS "ix_projectCatalog_lfCriticalityScore";
9+
DROP INDEX IF EXISTS "ix_projectCatalog_ossfCriticalityScore";
10+
DROP INDEX IF EXISTS "uix_projectCatalog_repoUrl";
11+
DROP TABLE IF EXISTS "projectCatalog";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX CONCURRENTLY IF EXISTS "idx_memberIdentities_verified_email_lower_value";

backend/src/database/migrations/U1774430554__covering-indexes-for-member-identity-lookups.sql

Whitespace-only changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- Project Catalog: candidate projects discovered from OSSF Criticality Score and other sources
2+
CREATE TABLE IF NOT EXISTS "projectCatalog" (
3+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
4+
"projectSlug" VARCHAR(255) NOT NULL,
5+
"repoName" VARCHAR(255) NOT NULL,
6+
"repoUrl" VARCHAR(1024) NOT NULL,
7+
"ossfCriticalityScore" DOUBLE PRECISION,
8+
"lfCriticalityScore" DOUBLE PRECISION,
9+
"syncedAt" TIMESTAMP WITH TIME ZONE DEFAULT NULL,
10+
"createdAt" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
11+
"updatedAt" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
12+
);
13+
14+
CREATE UNIQUE INDEX "uix_projectCatalog_repoUrl" ON "projectCatalog" ("repoUrl");
15+
CREATE INDEX "ix_projectCatalog_ossfCriticalityScore" ON "projectCatalog" ("ossfCriticalityScore" DESC NULLS LAST);
16+
CREATE INDEX "ix_projectCatalog_lfCriticalityScore" ON "projectCatalog" ("lfCriticalityScore" DESC NULLS LAST);
17+
CREATE INDEX "ix_projectCatalog_syncedAt" ON "projectCatalog" ("syncedAt");
18+
19+
-- Evaluated Projects: AI evaluation results linked to catalog entries
20+
CREATE TABLE IF NOT EXISTS "evaluatedProjects" (
21+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
22+
"projectCatalogId" UUID NOT NULL REFERENCES "projectCatalog"(id) ON DELETE CASCADE,
23+
"evaluationStatus" VARCHAR(50) NOT NULL DEFAULT 'pending',
24+
"evaluationScore" DOUBLE PRECISION,
25+
"evaluation" JSONB,
26+
"evaluationReason" TEXT,
27+
"evaluatedAt" TIMESTAMP WITH TIME ZONE,
28+
"starsCount" INTEGER,
29+
"forksCount" INTEGER,
30+
"commitsCount" INTEGER,
31+
"pullRequestsCount" INTEGER,
32+
"issuesCount" INTEGER,
33+
"onboarded" BOOLEAN NOT NULL DEFAULT FALSE,
34+
"onboardedAt" TIMESTAMP WITH TIME ZONE,
35+
"createdAt" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
36+
"updatedAt" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
37+
);
38+
39+
CREATE UNIQUE INDEX "uix_evaluatedProjects_projectCatalogId" ON "evaluatedProjects" ("projectCatalogId");
40+
CREATE INDEX "ix_evaluatedProjects_evaluationStatus" ON "evaluatedProjects" ("evaluationStatus");
41+
CREATE INDEX "ix_evaluatedProjects_evaluationScore" ON "evaluatedProjects" ("evaluationScore" DESC NULLS LAST);
42+
CREATE INDEX "ix_evaluatedProjects_onboarded" ON "evaluatedProjects" ("onboarded");
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- The existing idx_memberIdentities_email_verified_trgm covers the right partial
2+
-- conditions (verified = true, type = 'email', deletedAt IS NULL) but is a GIN
3+
-- trigram index -- PostgreSQL will not use it for equality joins on
4+
-- lower(mi.value) against input emails, for example:
5+
--
6+
-- JOIN ON lower(mi.value) = input_email
7+
-- WHERE mi.verified = true AND mi.type = 'email' AND mi."deletedAt" IS NULL
8+
--
9+
-- The only usable B-tree index (idx_memberIdentities_lower_value) only carries
10+
-- the partial condition deletedAt IS NULL, so PG must heap-fetch every matched
11+
-- row to re-check verified and type, which degrades as the table grows.
12+
--
13+
-- This B-tree partial index lets the planner do a direct nested-loop index scan
14+
-- (one lookup per input email) with no extra heap fetches for verified/type.
15+
16+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "idx_memberIdentities_verified_email_lower_value"
17+
ON "memberIdentities" (lower(value))
18+
WHERE verified = true
19+
AND type = 'email'
20+
AND "deletedAt" IS NULL;

0 commit comments

Comments
 (0)