-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add job to validate exercise IDs in assessments #261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
import org.khanacademy.Setup; | ||
|
||
|
||
new Setup(steps).apply(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to run this as a cronjob, right? So you need to add a cron step here. Though maybe you're planning to do that later once you confirm this works? I'd probably do it from the beginning, tbh. It's pretty straightforward what you're doing and all the work is in the go binary, so this won't take a lot of iterating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I thought I was supposed to configure that in Jenkins! Will add it now
def runScript() { | ||
withTimeout('1h') { | ||
dir("webapp") { | ||
sh("go run services/assessments/cmd/check_assessments_exercise_ids/main.go"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, and certainly very common in our jenkins code, but I think it's a bit safer to do exec:
exec(["go", "run", "services/..."]);
It's totally up to you.
Summary:
Our interim assessments contain exercise IDs that we use to look up content, and we need to be alerted if any of those IDs become invalid. This job checks for invalid exercise IDs and alerts us if it finds any.
Issue: INFRA-10509
Test plan:
Verify that the job ran correctly in Jenkins. Note that the failure is intended - I made a test configuration invalid to ensure the alert would work.