Skip to content

PM-5194: Bypass approval for Fun challenges - #146

Merged
jmgasper merged 1 commit into
developfrom
PM-5194
Aug 12, 2026
Merged

PM-5194: Bypass approval for Fun challenges#146
jmgasper merged 1 commit into
developfrom
PM-5194

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

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

  • Added approval-policy coverage showing Fun challenges skip manual approval and are not launch-blocked by a pending approval state.
  • Added a database-backed regression that activates and auto-approves a persisted pending Fun challenge.
  • Updated the existing Fun creation expectation to Approved and kept the paid budget-lock fixture explicitly non-Fun.
  • Focused approval-policy suite: 11 passed.
  • Focused persisted-Fun activation regression: 1 passed.
  • pnpm lint: passed.
  • pnpm build: passed.

The repository-wide pnpm test command 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.

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.
@jmgasper
jmgasper merged commit ff2ddb2 into develop Aug 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant