Challenge Map: build + utils + focused tests#574
Merged
utsab merged 4 commits intofreeCodeCamp:mainfrom Feb 10, 2026
Merged
Conversation
7 tasks
utsab
approved these changes
Feb 10, 2026
- 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
802b4a0 to
5dede2c
Compare
Collaborator
|
Your PR looks good overall. One point of feedback regarding the tests. Right now, the tests generate a mock challengeMap.json object and then run the tests on that mock object. It would be better if the tests run against the actual challengeMap.json file that is fetched from FCC Proper. This way, if the test can ensure that the actual file retrieved from FCC Proper is something that Classroom App can digest. If the challengeMap.json file does not exist on the local machine, perhaps the test should fail and tell the user to go generate that file before running the test. One other request: Please add some documentation to the README.md file that details how to generate the challengeMap.json file. |
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)This PR is part of the PRs for FCC Proper Integration
Summary
This PR adds challenge map generation from FCC GraphQL and utilities to transform FCC Proper student data into classroom dashboard format.
In addition it scopes tests to challenge-map only; excludes FCC Proper and sync tests (those remain in their feature PRs).
Changes
Build script: build-challenge-map-graphql.mjs (generates data/challengeMap.json)
Utilities: challengeMapUtils.js (buildStudentDashboardData, resolveAllStudentsToDashboardFormat)
Tests: challengeMapUtils.test.js (23 unit/integration cases)
NPM script: test:challenge-map
Rationale
This provides a stable, static curriculum lookup for transforming student progress into dashboard-ready structures.
It also keeps scope tight; FCC Proper proxy/sync work is handled separately so those are separate PRs
Testing
Focused unit tests:
npm run test:challenge-mapOptional manual map build:
node scripts/build-challenge-map-graphql.mjsOut of Scope
FCC Proper two-call validation utilities/endpoints
Sync utilities for FCC Proper IDs
Authorization, error handling, v1→v2 migration
Follow-Ups
Merge feat/fcc-proxy-two-call-validation (endpoints + tests)
Add authorization/error handling middleware
Migrate internal endpoints v1→v2
Wire utilities to endpoints for end-to-end flow
Checklist
Build challenge map from GraphQL
Transformation utilities for student data
Focused challenge-map tests
npm run test:challenge-map
FCC Proper/sync tests excluded from this PR