-
Notifications
You must be signed in to change notification settings - Fork 4
562: Updated AdminController with shouldExpireBy and syntaxHighlighti… #594
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
base: main
Are you sure you want to change the base?
Conversation
|
/deploy |
|
The command to deploy to staging for the commit 4896827 has been triggered. View action run |
There was a problem hiding this comment.
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 adds support for optional shouldExpireBy and syntaxHighlightingLanguage fields to leaderboards. These fields allow administrators to set an expiration date for leaderboards and specify the programming language for syntax highlighting.
- Added database columns for
shouldExpireByandsyntaxHighlightingLanguageto the Leaderboard table - Implemented validation logic in AdminController to ensure expiration dates are in the future
- Added comprehensive test coverage for the new optional fields including null handling, validation, and combinations
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| db/migration/V0066__Add_expireBy_and_syntaxHighlighting_to_leaderboard_table.SQL | Adds database columns for the new leaderboard fields (note: these columns already exist from previous migrations) |
| src/main/java/com/patina/codebloom/api/admin/body/NewLeaderboardBody.java | Adds shouldExpireBy and syntaxHighlightingLanguage as optional fields to the request body |
| src/main/java/com/patina/codebloom/api/admin/AdminController.java | Implements validation for shouldExpireBy (must be in future) and maps both new fields to the Leaderboard model |
| src/main/java/com/patina/codebloom/common/db/repos/leaderboard/LeaderboardSqlRepository.java | Updates SQL INSERT statement to include the new columns and sets their values when creating a leaderboard |
| src/test/java/com/patina/codebloom/api/admin/AdminControllerTest.java | Adds comprehensive tests for the new fields including success cases, validation, null handling, and combinations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db/migration/V0066__Add_expireBy_and_syntaxHighlighting_to_leaderboard_table.SQL
Outdated
Show resolved
Hide resolved
|
|
/deploy |
|
The command to deploy to staging for the commit bad69ce has been triggered. View action run |
|
1 similar comment
|
|
/deploy |
|
The command to deploy to staging for the commit 3d5af15 has been triggered. View action run |
|
/deploy |
|
The command to deploy to staging for the commit 3d5af15 has been triggered. View action run |
…ngLanguage
562
Description of changes
Checklist before review
Screenshots
Dev
A. Integration Tests Passing

B. Created Leaderboard with shouldExpireBy set and syntaxHighlightingLanguage set to NULL
C. Created Leaderboard with shouldExpireBy not set and syntaxHighlightingLanguage set to cpp
Staging