Restore "Migrate UNIT_AND_LEVEL_TO_LESSON_S3_NAME to ai_rubric_s3_config on unit model"#71285
Draft
davidsbailey wants to merge 3 commits intostagingfrom
Draft
Restore "Migrate UNIT_AND_LEVEL_TO_LESSON_S3_NAME to ai_rubric_s3_config on unit model"#71285davidsbailey wants to merge 3 commits intostagingfrom
davidsbailey wants to merge 3 commits intostagingfrom
Conversation
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.
Background
Reverts #71278, restoring #71016.
I didn't get a complete root cause on the original PR, but the problem was that seeding failed during the seed step during deploy in the
testandproductionchef-managed environments. The issue was able to reach production because I manually worked around the issue intestby explicitly seeding each ai-rubric-enabled unit viacd dashboard; bundle exec rake seed:single_script SCRIPT_NAME=allthethings(for example).Here is the error log from the initial failure in the test environment (slack):
I was able to determine that the error occurred because
ai_rubric_s3_configdid not appear in the properties field on the unit object at the timeimport_learning_goalswas called, even though it should have been set earlier in the same file when the unit was seeded:code-dot-org/dashboard/lib/services/script_seed.rb
Line 225 in 2121317
code-dot-org/dashboard/lib/services/script_seed.rb
Line 272 in 2121317
After reverting the original PR, I wasn't able to get a local repro.
Description
Since I wasn't able to get a local repro, but I was able to debug far enough to determine that the problem was
ai_rubric_s3_confignot getting seeded early enough, the new approach I'm going with here is to have this PR add ai_s3_rubric_config to the unit model and the affected units, and then change the implementation to start using the new config in a next PR (by reverting 8830412).Caveats
Since a root cause of the initial issue was not determined, there's some risk that adding a new ai-enabled rubric to a new unit could cause similar problems. if that happens, we can investigate at that time.