Conversation
What was broken Fun challenges were created with pending budget approval and the API rejected attempts to move legacy pending Fun challenges from Draft to Active. Root cause The existing approval-flow bypass handled configured Topgear billing accounts only and did not consider the Fun challenge flag. What was changed Extended the existing approval bypass to auto-approve Fun challenges on create and update, including persisted Fun challenges when an activation payload omits the flag. Kept the separate billing-account and funds validations unchanged. Any added/updated tests Added approval-policy coverage for Fun challenges and a database-backed regression for activating a persisted pending Fun challenge. Updated the existing Fun creation expectation and kept the paid budget-lock fixture explicitly non-Fun.
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.
What was broken
Fun challenges entered pending budget approval and the API rejected Draft-to-Active updates until that approval became Approved. Consequently, enabling the UI alone would still leave Fun challenges impossible to launch.
Root cause
The existing challenge approval-flow bypass handled configured Topgear billing accounts only and did not consider the Fun challenge flag during create, update, or activation validation.
What was changed
The existing bypass now auto-approves Fun challenges on create and update. Activation derives the effective Fun flag from either the incoming payload or the persisted challenge, so legacy pending Fun challenges can launch even when the status update omits that flag. Separate billing-account and funds validations remain unchanged.
Any added/updated tests
pnpm lint: passed.pnpm build: passed.The repository-wide
pnpm testcommand was also attempted against the documented local databases. It still has pre-existing failures caused by missing external-service configuration and stale unrelated fixtures; the PM-5194 focused suites pass.