Feat/graphql challenge map readme/tests update#578
Open
CarlyAThomas wants to merge 10 commits intofreeCodeCamp:mainfrom
Open
Feat/graphql challenge map readme/tests update#578CarlyAThomas wants to merge 10 commits intofreeCodeCamp:mainfrom
CarlyAThomas wants to merge 10 commits intofreeCodeCamp:mainfrom
Conversation
- Add scripts/build-challenge-map-graphql.mjs to generate challengeMap.json
* Fetches curriculum from FCC GraphQL API
* Builds flat map with { certification, block, name } structure
* Output: data/challengeMap.json with 12,847 unique challenges
* Run: node scripts/build-challenge-map-graphql.mjs
- Add util/challengeMapUtils.js for transforming student data
* resolveAllStudentsToDashboardFormat() - converts FCC Proper student data to dashboard format
* buildStudentDashboardData() - groups challenges by certification and block
- Update .gitignore to exclude generated data/challengeMap.json
- Update challenge map builder to store all superblocks and blocks as arrays - This allows tracking when a challenge appears across multiple superblocks/blocks - Update challengeMapUtils to use first array element as canonical for dashboard grouping - First occurrence becomes the primary certification/block for the student dashboard - Full association history preserved in allSuperblocks/allBlocks arrays for future use Resolves: Ability to know all superblock associations per challenge
…C Proper/sync tests to their feature PR
NewtonLC
approved these changes
Feb 17, 2026
Contributor
NewtonLC
left a comment
There was a problem hiding this comment.
I tested this out in a Windows environment and originally, upon running node scripts/build-challenge-map-graphql.mjs, there was an issue with the pathing of the challenge map. I updated the file path to use the fileURLToPath() function and it should now work on all machines!
Aside from that, this PR looks ready for review.
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.
Checklist:
Update index.md)Summary
This PR extends the work merged in #574 by:
challengeMap.jsonand recommending a weekly refresh.challengeMap.json(when present) to validate that FCC Proper output is digestible by Classroom.Co-authored-by: Newton Chung <NewtonLC@users.noreply.github.com>
Why keep both synthetic and real-map tests?
Synthetic tests validate the transformation logic in isolation (stable, deterministic).
Real-map tests validate that the actual FCC Proper map format is compatible with Classroom. This is important since the upstream map can change over time.
This aligns with the feedback:
“Tests should run against the actual challengeMap.json from FCC Proper … If the file does not exist, the test should fail and tell the user to generate it.”
New real-map test descriptions
loads a non-empty challenge map
Confirms
challengeMap.jsonexists, parses, and has entries. Prevents downstream logic from running on empty or missing data.builds dashboard data using the first valid map entry
Verifies the map’s real structure can be transformed into the expected nested dashboard shape.
skips unknown challenge IDs
Ensures the logic ignores unknown/missing IDs safely (no crashes or mis-grouping).
resolves multiple students against the current map
Validates per-student transformation with real map data and the expected output shape.
Fail example (missing map):
Pass example (map generated):
Testing:
npm run test:challenge-mapTesting / CI Note
Local dev: If
challengeMap.jsonis missing, the real‑map suite fails with a clear error and guidance to run node scripts/build-challenge-map-graphql.mjs.CI: When CI=true and the map is missing, the real‑map suite is skipped to keep the pipeline green. Synthetic tests still run.