Skip to content
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

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Conversation

timmcca-be
Copy link
Contributor

@timmcca-be timmcca-be commented Jan 23, 2025

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.

@timmcca-be timmcca-be self-assigned this Jan 23, 2025
@timmcca-be timmcca-be marked this pull request as ready for review January 23, 2025 00:13
@timmcca-be timmcca-be requested a review from a team as a code owner January 23, 2025 00:13
Copy link
Member

@csilvers csilvers left a 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();
Copy link
Member

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.

Copy link
Contributor Author

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");
Copy link
Member

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.

@timmcca-be timmcca-be merged commit 490f055 into master Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants