Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
103c3bd
Potential fix for code scanning alert no. 72: Incomplete string escap…
kkartunov Nov 4, 2025
93e0da8
pnpm update --latest
kkartunov Nov 4, 2025
0ffaffb
on dev env
kkartunov Nov 4, 2025
0d99cea
uuid API version updates
kkartunov Nov 4, 2025
b8ccdfa
axios-retry api update
kkartunov Nov 4, 2025
663e1e8
joi & express fixes
kkartunov Nov 4, 2025
6530304
fix error, schema.validate
kkartunov Nov 4, 2025
611ee56
clean up readmes
kkartunov Nov 4, 2025
de2bc0d
remove unused
kkartunov Nov 4, 2025
d4aa9b4
up aws sdk to v3
kkartunov Nov 4, 2025
127cce1
hid pnpm-lock
kkartunov Nov 5, 2025
29ae9d7
Merge pull request #31 from topcoder-platform/alert-autofix-72
kkartunov Nov 5, 2025
972cb96
Merge pull request #32 from topcoder-platform/module-updates
kkartunov Nov 5, 2025
d464096
drop yarn
kkartunov Nov 5, 2025
67d72d4
Merge pull request #33 from topcoder-platform/module-updates
kkartunov Nov 5, 2025
f5914e2
Fix for processing phases in challenge update
jmgasper Nov 9, 2025
85ff0c7
Merge pull request #34 from topcoder-platform/PS-441
jmgasper Nov 9, 2025
bc505af
Build fix
jmgasper Nov 10, 2025
e41826c
Performance changes for PM-2206
jmgasper Nov 11, 2025
87a1eb2
Merge pull request #37 from topcoder-platform/PM-2206-develop
jmgasper Nov 11, 2025
82232ba
Add in view to help with performance issue seen in dev
jmgasper Nov 11, 2025
c6d02f3
Automate migrations
kkartunov Nov 11, 2025
6c0e4d8
use entrypoint
kkartunov Nov 11, 2025
016a1b3
Merge pull request #40 from topcoder-platform/master
kkartunov Nov 11, 2025
b829e34
Merge pull request #41 from topcoder-platform/auto-migrations
kkartunov Nov 11, 2025
cb14e83
Prisma drift fix
jmgasper Nov 11, 2025
38dd16c
Prisma drift fix
jmgasper Nov 11, 2025
cb285b3
Merge pull request #43 from topcoder-platform/migration-history-fix
jmgasper Nov 11, 2025
c0ff57f
Fix errors seen in build
jmgasper Nov 11, 2025
170cbc5
Merge pull request #44 from topcoder-platform/build_fix
jmgasper Nov 11, 2025
900e2da
Merge pull request #46 from topcoder-platform/submissionEndDateFix
jmgasper Nov 11, 2025
9588596
Allow for registration phase reopening if submission or TG submission…
jmgasper Nov 12, 2025
7ed9d4b
Merge pull request #48 from topcoder-platform/registrationReopen
jmgasper Nov 12, 2025
0f5d076
Merge pull request #50 from topcoder-platform/master
jmgasper Nov 12, 2025
0a4a03f
Merge pull request #51 from topcoder-platform/PM-2206-2nd-fix
jmgasper Nov 12, 2025
6a9bb43
feat: added ai workflow id to default reviewer
hentrymartin Nov 12, 2025
c6c5463
fix: make scorecardId optional
hentrymartin Nov 12, 2025
38c74bd
Merge pull request #53 from topcoder-platform/master
kkartunov Nov 12, 2025
8c73a69
Merge branch 'develop' into pm-2540_3
hentrymartin Nov 12, 2025
d8c7eef
feat: added ai workflow id to default reviewer
hentrymartin Nov 12, 2025
9a79208
Merge pull request #52 from topcoder-platform/pm-2540_3
hentrymartin Nov 12, 2025
7c61551
point to latest tc-core-lib
kkartunov Nov 17, 2025
c1fb037
point code-lib to security
kkartunov Nov 17, 2025
fcf4ede
rever core-lib
kkartunov Nov 17, 2025
81b85c5
Fix filtering of types / tracks
jmgasper Nov 17, 2025
30a34e2
Merge branch 'security' of github.com:topcoder-platform/challenge-api…
jmgasper Nov 17, 2025
ae34b10
tc-core-library-js security branch and additional debug logging of au…
jmgasper Nov 17, 2025
e8fe599
Merge pull request #54 from topcoder-platform/security
jmgasper Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use entrypoint
  • Loading branch information
kkartunov committed Nov 11, 2025
commit 6c0e4d8e07b2cf89d70ecdfdfd3ca238f31658c2
9 changes: 6 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ ENV PRISMA_LOG_LEVEL=info

RUN mkdir -p /challenge-api/reports

RUN echo "Running database migrations..."
RUN npx prisma migrate deploy
# Copy entrypoint script and make it executable
COPY docker/entrypoint.sh /entrypoint.sh

Choose a reason for hiding this comment

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

[⚠️ security]
Consider verifying the integrity of entrypoint.sh after copying it into the image. This can help ensure that the script has not been tampered with and is safe to execute.

RUN chmod +x /entrypoint.sh

CMD ["node","/challenge-api/app.js"]
# Use entrypoint to run migrations at startup (not build time)
# Prisma uses PostgreSQL advisory locks to prevent concurrent migrations
ENTRYPOINT ["/entrypoint.sh"]

Choose a reason for hiding this comment

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

[⚠️ correctness]
Using an entrypoint script to run migrations at startup can be risky if the script fails or if the database is not ready. Consider adding error handling or retry logic within entrypoint.sh to handle such cases gracefully.

22 changes: 22 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
set -e

echo "Starting Challenge API v6..."

# Run database migrations
# Prisma uses PostgreSQL advisory locks to prevent concurrent migrations
# Only one instance will run migrations, others will wait
echo "Running database migrations..."
npx prisma migrate deploy

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Consider adding a retry mechanism or handling specific errors for npx prisma migrate deploy to improve robustness in case of transient issues with the database connection.


# Check migration status
if [ $? -eq 0 ]; then
echo "Migrations completed successfully"
else
echo "Migration failed with exit code $?"
exit 1
fi

# Start the application
echo "Starting application server..."
exec node /challenge-api/app.js

Choose a reason for hiding this comment

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

[⚠️ correctness]
Using exec to start the application server is good for replacing the shell process with the node process, but ensure that /challenge-api/app.js handles termination signals properly to allow graceful shutdowns.