-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Detect changes coming from FCC API responses inside of the classroom mode project using a CRON job #410
Comments
Related to I believe the following changes in From freeCodeCamp/freeCodeCamp#50769 (review) by @ojeytonwilliams to @naomi-lgbt on June 28th: It's not really relevant to this PR, but I wonder if we should switch the meta.json format from "challengeOrder": [ "challengeOrder": [ Anyways, back on topic, some nitpicks: From freeCodeCamp/freeCodeCamp#50955 by @naomi-lgbt on July 12th: As mentioned in freeCodeCamp/freeCodeCamp#50769 (review), this migrates the meta.json files to use objects instead of tuples. |
I want to highlight that a JSON object is unordered by design based on the JSON standard in RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format • When we request the FCC API that responds with a JSON object (instead of a tuple), the order isn't guaranteed. • Item 0 in a JSON object probably won't be the same as item 0 in a tuple, and the ordering in the JSON response can change from one request to the next. Therefore, when you implement:
I believe you would need a JSON diff tool that understands semantics and ignores the ordering in the response. Reference: From https://datatracker.ietf.org/doc/html/rfc8259.html
Thank you! |
Sorry about this, I didn't realise that Classroom was relying on the shape of that data. I should have realised given that it changed the schema. For the short term I'll try and keep that in mind. In the longer term the api-rewrite should handle this issue since any changes to the api will come with a change in the api version. |
Actually the challenge data is taken from the client static files. |
Right, but we changed that in freeCodeCamp/freeCodeCamp#50955 |
Yup. I was pointing out this part
Classroom doesn't use the main API, it gets the challenge data from client static files |
Ah, good point. Just to reiterate, once we have the new API up and running there should no longer be a need to rely on those static files since Classroom will be able to get whatever it needs from (hopefully) stable api endpoints. |
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 theallChallenges
key inside ourCreateDashboardObject
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 job to ping the endpoints used by classroom mode and compare them to what the project is currently expecting. I found this article 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.
The text was updated successfully, but these errors were encountered: