freeCodeCamp / freeCodeCamp/classroom
feat: Detect changes coming from FCC API responses inside of the classroom mode project using a CRON job
- Dominant language
- JavaScript
- Stars
- 155
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Recently, we came across an issue that seems to have originated from changes on the FCC backend. Our API processing file (`/util/api_processor`) started creating undefined data inside the `allChallenges` key inside our `CreateDashboardObject` function.
The fault came from attempting to access a zeroth index inside of our response object. We did some digging and found that the issue persists despite rolling back changes made to the processing file and files associated with it, leaving us with the assumption that this was caused by changes in the fcc API that we use to build and display classrooms.
**To Reproduce**
Steps to reproduce the behavior:
This issue will be patched by #401 however, we want to at the very least be more aware of changes happening on FCC's end so that we do not waste time figuring out what caused our code to break.
**Expected behavior**
We want to set up a [cron](https://en.wikipedia.org/wiki/Cron) job to ping the endpoints used by classroom mode and compare them to what the project is currently expecting. I found this [article](https://medium.com/nerd-for-tech/lets-run-cron-jobs-using-github-actions-df64496ffc4a) that walks through how to set one up using GitHub Actions, so it should be a good starting point. From there, if there is a change detected we want to display what it is and possibly alert the maintainers of the repo (or at the very least set up triggers for associated files) to alert contributors about the changes.
Contributor guide
Assessment
This issue has not been assessed yet.