-
Notifications
You must be signed in to change notification settings - Fork 9
Performance and minor fixes for prod release #138
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ed16ca
Performance indices and also updates for handling TG Task Submissions…
jmgasper 4202154
Merge pull request #135 from topcoder-platform/performance
jmgasper 570451d
Minor tweak for better support of the upload panel in CA
jmgasper 9a5055a
Merge pull request #136 from topcoder-platform/performance
jmgasper 3412d87
Use legacy scorecard ID as a fallback for legacy data
jmgasper 26d7ffb
Merge pull request #137 from topcoder-platform/performance
jmgasper 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
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
prisma/migrations/20251101013110_add_additional_my_review_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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| -- CreateIndex | ||
| CREATE INDEX "appeal_response_appeal_resource_idx" ON "appealResponse"("appealId", "resourceId"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE INDEX "review_resource_status_phase_idx" ON "review"("resourceId", "status", "phaseId"); | ||
|
|
||
| -- Clean up orphaned reviewSummations before enforcing FK | ||
| UPDATE "reviewSummation" rs | ||
| SET "scorecardId" = NULL | ||
| WHERE "scorecardId" IS NOT NULL | ||
| AND NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM "scorecard" sc | ||
| WHERE sc."id" = rs."scorecardId" | ||
| ); | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "reviewSummation" ADD CONSTRAINT "reviewSummation_scorecardId_fkey" FOREIGN KEY ("scorecardId") REFERENCES "scorecard"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20251101030908_additional_comment_index/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,2 @@ | ||
| -- CreateIndex | ||
| CREATE INDEX "appeal_comment_resource_idx" ON "appeal"("reviewItemCommentId", "resourceId"); |
10 changes: 10 additions & 0 deletions
10
prisma/migrations/20251108093000_add_my_review_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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| -- Add composite indexes to improve My Reviews query performance | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "review_resource_status_phase_idx" | ||
| ON "reviews"."review"("resourceId", "status", "phaseId"); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "appeal_response_appeal_resource_idx" | ||
| ON "reviews"."appealResponse"("appealId", "resourceId"); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS "appeal_comment_resource_idx" | ||
| ON "reviews"."appeal"("reviewItemCommentId", "resourceId"); |
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
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.
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
Copilot Autofix
AI 14 days ago
The fix is to properly parse
body.urland check its host rather than searching for a substring. Use the standard Node.jsURLclass to parse the URL. Then, check whether the host is one of the allowed hosts for S3 (e.g.,s3.amazonaws.comor region-specific variants likes3.<region>.amazonaws.com).In this code, to replace the substring check, introduce host checks such as:
s3.amazonaws.com.s3.amazonaws.commy-bucket.s3.eu-west-1.amazonaws.com)To implement this:
body.urlis a string, parse it withnew URL(body.url), and test the host.No external packages are needed, as the built-in
URLclass suffices.