-
Notifications
You must be signed in to change notification settings - Fork 6
feat(PM-2540): added ai workflow id to default reviewer #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
hentrymartin
wants to merge
6
commits into
develop
Choose a base branch
from
pm-2540
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
df1f216
feat: added ai workflow id to default reviewer
hentrymartin 77cd473
fix: deploy to dev for testing
hentrymartin df0ad7a
Merge branch 'develop' of github.com:topcoder-platform/challenge-api-…
jmgasper 5b01637
Fix for migration / db drift
jmgasper 34e998f
fix: migrations
hentrymartin 1b00196
Remove 'pm-2540' branch from CircleCI config
kkartunov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,7 @@ workflows: | |
| only: | ||
| - develop | ||
| - module-updates | ||
| - pm-2540 | ||
|
|
||
| - "build-qa": | ||
| context: org-global | ||
|
|
||
61 changes: 57 additions & 4 deletions
61
prisma/migrations/20251107090000_add_my_reviews_indexes/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,66 @@ | ||
| -- Add indexes to support faster `/v6/my-reviews` queries. | ||
|
|
||
| CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
| CREATE SCHEMA IF NOT EXISTS skills; | ||
| CREATE SCHEMA IF NOT EXISTS reviews; | ||
|
|
||
| CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA skills; | ||
| CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA pg_catalog; | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA reviews; | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA skills; | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| CREATE INDEX IF NOT EXISTS "challenge_status_type_track_created_at_idx" | ||
| ON "Challenge" ("status", "typeId", "trackId", "createdAt" DESC); | ||
|
|
||
| DROP INDEX IF EXISTS "challenge_name_idx"; | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "challenge_name_trgm_idx" | ||
| ON "Challenge" USING gin ("name" pg_catalog.gin_trgm_ops); | ||
|
|
||
| DO | ||
| $$ | ||
| DECLARE | ||
| challenge_phase_schema TEXT; | ||
| BEGIN | ||
| SELECT n.nspname | ||
| INTO challenge_phase_schema | ||
| FROM pg_class c | ||
| JOIN pg_namespace n ON n.oid = c.relnamespace | ||
| WHERE c.relname = 'ChallengePhase' | ||
| AND c.relkind = 'r' | ||
| LIMIT 1; | ||
|
|
||
| IF challenge_phase_schema IS NULL THEN | ||
| RETURN; | ||
| END IF; | ||
|
|
||
| IF NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_class idx | ||
| JOIN pg_namespace ns ON ns.oid = idx.relnamespace | ||
| WHERE idx.relname = 'challenge_phase_order_idx' | ||
| AND ns.nspname = challenge_phase_schema | ||
| ) | ||
| AND EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_class idx | ||
| JOIN pg_namespace ns ON ns.oid = idx.relnamespace | ||
| WHERE idx.relname = 'challenge_phase_challenge_open_end_idx' | ||
| AND ns.nspname = challenge_phase_schema | ||
| AND pg_get_indexdef(idx.oid) LIKE '%("challengeId", "isOpen", "scheduledEndDate", "actualEndDate", name)%' | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| THEN | ||
| EXECUTE format( | ||
| 'ALTER INDEX %I.%I RENAME TO %I', | ||
| challenge_phase_schema, | ||
| 'challenge_phase_challenge_open_end_idx', | ||
| 'challenge_phase_order_idx' | ||
| ); | ||
| END IF; | ||
| END | ||
| $$ LANGUAGE plpgsql; | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "challenge_phase_challenge_open_end_idx" | ||
| ON "ChallengePhase" ("challengeId", "isOpen", "scheduledEndDate", "actualEndDate"); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "challenge_name_trgm_idx" | ||
| ON "Challenge" | ||
| USING gin ("name" pg_catalog.gin_trgm_ops); | ||
| CREATE INDEX IF NOT EXISTS "challenge_phase_order_idx" | ||
| ON "ChallengePhase" ("challengeId", "isOpen", "scheduledEndDate", "actualEndDate", "name"); | ||
9 changes: 9 additions & 0 deletions
9
prisma/migrations/20251107194833_default_reviewer_aiworkflowid/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| Warnings: | ||
| - You are about to drop the column `isAIReviewer` on the `DefaultChallengeReviewer` table. All the data in the column will be lost. | ||
| */ | ||
| -- AlterTable | ||
| ALTER TABLE "DefaultChallengeReviewer" DROP COLUMN "isAIReviewer", | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ADD COLUMN "aiWorkflowId" VARCHAR(14); | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.