Skip to content

PM-4151: fallback MM export final scores to submission data#73

Merged
jmgasper merged 1 commit intodevelopfrom
PM-4151-3
Apr 8, 2026
Merged

PM-4151: fallback MM export final scores to submission data#73
jmgasper merged 1 commit intodevelopfrom
PM-4151-3

Conversation

@jmgasper
Copy link
Copy Markdown
Collaborator

@jmgasper jmgasper commented Apr 8, 2026

What was broken
Marathon Match submitter, valid submitter, and winner exports could leave finalScore blank when a final score existed only on the reviews.submission record. That left production challenge exports without the score data QA expected.

Root cause
The challenge export SQL only projected final_score_raw from the latest non-provisional reviewSummation row even though the surrounding score logic already treats submission.finalScore as a valid fallback source.

What was changed
Updated the Marathon Match submitter, valid submitter, and winner SQL queries to use COALESCE(final_review.aggregateScore, submission.finalScore) for final_score_raw, so the exported finalScore column remains populated when review summary rows are absent.

Any added/updated tests
Added src/reports/challenges/challenge-export-sql.spec.ts to load the three SQL files and assert they all preserve the submission.finalScore fallback. Also reran the existing challenge report service spec.

Validation
pnpm lint passed, pnpm test --runInBand src/reports/challenges/challenge-export-sql.spec.ts src/reports/challenges/challenges-reports.service.spec.ts passed, and pnpm build passed. The full pnpm test --runInBand suite still fails in unrelated pre-existing SFDC specs on the current develop baseline.

What was broken
Marathon Match submitter, valid submitter, and winner exports could leave finalScore blank when a final score existed only on the reviews.submission record. QA still reported blank score columns in production for those cases.

Root cause
The challenge export SQL only projected final_score_raw from the latest non-provisional reviewSummation row even though the surrounding scoring logic already treats submission.finalScore as a valid fallback source.

What was changed
Updated the three Marathon Match challenge export queries to use COALESCE(final_review.aggregateScore, submission.finalScore) for final_score_raw so the export keeps finalScore populated when review summary rows are absent.

Any added/updated tests
Added a regression spec that loads the submitters, valid-submitters, and winners SQL files and asserts they all preserve the submission.finalScore fallback.
@jmgasper jmgasper merged commit 114fa73 into develop Apr 8, 2026
6 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