Repository navigation
feat(codes): super admin toggle to open sponsor codes when hacking starts - #363
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments. I'll skip comments containing "(aside)".
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Sponsor codes (Lovable, NVIDIA, …) were claimable/requestable the moment a hacker checked in. This adds a super admin Open codes to hackers switch on
/admin/sa/codes, backed by a newcodes_enabledsetting that defaults to off.GET/PUT /superadmin/settings/codes-enabled({ "enabled": bool }), stored viaSettingsStore.GetCodesEnabled/SetCodesEnabled. No migration — absent key reads asfalse.GET /codesnow returnsopen. Checked-in hackers still see every card, but while closed the badge is Soon and the disabled button reads Available when hacking starts.codePoolForHacker:POST /codes/{id}/claimandPOST /codes/{id}/requestsreturn403 "sponsor codes are available when hacking starts"while closed (checked before the pool lookup).codeStandingchecks those first). Super admin preview is unchanged.Testing
go test ./cmd/api/... ./internal/...,tsc,eslint, vitest forhacker/codes+superadmin/codes(new cases for closed claim/request, closed card copy, held code while closed).POST /v1/codes/{lovable}/claimgets 403 while closed.Note: after deploy, codes are closed until a super admin flips the switch.
Link to Devin session: https://app.devin.ai/sessions/d8e19df93b774e33b38363ae66efd630
Open in Devin Desktop: https://app.devin.ai/desktop/session/d8e19df93b774e33b38363ae66efd630?variant=devin
Requested by: @balebbae