Skip to content

Restore "Migrate UNIT_AND_LEVEL_TO_LESSON_S3_NAME to ai_rubric_s3_config on unit model"#71285

Open
davidsbailey wants to merge 1 commit intostagingfrom
revert-71278-revert-71016-move-rubric-ai-config-to-unit
Open

Restore "Migrate UNIT_AND_LEVEL_TO_LESSON_S3_NAME to ai_rubric_s3_config on unit model"#71285
davidsbailey wants to merge 1 commit intostagingfrom
revert-71278-revert-71016-move-rubric-ai-config-to-unit

Conversation

@davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Mar 11, 2026

Depends on

Background

Reverts #71278, restoring #71016.

I was able to get a local repro of the seeding issue which caused the original PR to be reverted. The root cause was that having the script cache enabled, combined with the changes in #71016 , causes script seeding to fail. the more specific reason is that unit.ai_rubric_s3_config was being set during import_scripts but that change was not visible later during import_learning_goals due to old unit state being stored in the script cache. invalidating the cache explicitly did not seem to fix, causing me to look into disabling script caching entirely during seeding.

error details

Here is the error log from the initial failure in the test environment (slack):

Aws::S3::Errors::NoSuchKey: Error parsing script file ./config/scripts_json/allthethings.script_json: The specified key does not exist.
...
Caused by:
Aws::S3::Errors::NoSuchKey: The specified key does not exist.
...
/home/ubuntu/test/dashboard/app/jobs/concerns/ai_rubric_config.rb:39:in `read_file_from_s3'
/home/ubuntu/test/dashboard/app/jobs/concerns/ai_rubric_config.rb:89:in `get_s3_learning_goals'
/home/ubuntu/test/dashboard/app/models/learning_goal.rb:29:in `validate_ai_config'
...
/home/ubuntu/test/dashboard/lib/services/script_seed.rb:736:in `import_learning_goals'

Description

We don't need or want script caching during seeding anyway, so the solution is to disable script caching during seeding in #71467. once that PR is merged, this PR can be safely merged without additional changes.

Deployment notes

  • we'll have to keep an eye on only cache units and courses within running web application #71467 as it goes out since that could in theory have subtle effects on how rake tasks and cronjobs work in every environment.
  • we already have data showing that seeding passed on the original version of this PR in environments where Unit.should_cache? is disabled, so we can just "proceed with normal caution" when shipping this PR.

@davidsbailey davidsbailey force-pushed the revert-71278-revert-71016-move-rubric-ai-config-to-unit branch from 51da9f3 to 3f7103b Compare March 19, 2026 16:13
@davidsbailey davidsbailey changed the base branch from staging to simplify-unit-should-cache March 19, 2026 16:14
@davidsbailey davidsbailey requested a review from etaderhold March 19, 2026 17:28
Base automatically changed from simplify-unit-should-cache to staging March 19, 2026 17:32
@davidsbailey davidsbailey force-pushed the revert-71278-revert-71016-move-rubric-ai-config-to-unit branch from 83a4f33 to dfbbdea Compare March 19, 2026 17:39
@davidsbailey davidsbailey marked this pull request as ready for review March 19, 2026 18:24
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.

1 participant