Skip to content

Migrate more misc ui-test units' levels into ui test partition - #74562

Draft
davidsbailey wants to merge 1 commit into
migrate-ui-test-oceans-levels-v2from
migrate-ui-test-other-v2
Draft

Migrate more misc ui-test units' levels into ui test partition#74562
davidsbailey wants to merge 1 commit into
migrate-ui-test-oceans-levels-v2from
migrate-ui-test-other-v2

Conversation

@davidsbailey

Copy link
Copy Markdown
Member

Run bin/curriculum/clone_ui_test_levels.rb on the four remaining ui-test-* units that still referenced production levels:

  ui-test-unnumbered-lessons
    unnumbered-lesson-level-one -> UI Test unnumbered-lesson-level-one  (new)
  ui-test-versioned-script-2017
    courseB_video_Unspotted     -> UI Test courseB_video_Unspotted      (new)
  ui-test-versioned-script-2019
    courseB_video_Unspotted     -> UI Test courseB_video_Unspotted      (shared)
  ui-test-single-unit-2026
    K-1 Artist1 1               -> UI Test K-1 Artist1 1                (existing)
    Standalone_Artist_9         -> UI Test Standalone_Artist_9          (existing)
    flappy_1                    -> UI Test flappy_1                    (new)
    flappy_11                   -> UI Test flappy_11                   (new)

Four new level files for seven repointed script_levels. The two versioned-script units share one level, so the second unit lands on the clone the first one created; the two Artist clones already existed, from ui-test-csf (#73718) and ui-test-artist earlier in this stack, and were found by name. That get-or-create by name is what keeps a level shared by several units to a single copy.

All of these are plain custom levels: no contained levels, no project templates, no sublevels, no encrypted properties, no rubrics. Each new clone differs from its source only in name, created_at, updated_at, audit_log, and the ordering of null-valued properties.

ui-test-shared-unit is already migrated -- #73718 did it as part of that PR's prove-out -- so it is not touched here. Running the script on it raises on its first script_level ("UI Test Sample Free Response" already carries the prefix), which is the guard against double-prefixing.

With this commit, none of the 25 ui-test-* units whose script_json lives in dashboard/test/ui/config/scripts_json references a production level. What remains are the deprecated blockly levels of ui-test-maze and ui-test-shared-unit, which are exempt from the partition.

levelbuilder_mode is off in locals.yml here, so the script was loaded under rails runner with Rails.application.config.levelbuilder_mode set for that process, as in the parent commits.

Verified:

  • Every committed .level file is byte-identical to Level#to_xml for its row, at the path Policies::LevelFiles.level_file_path picks: nothing here is hand-edited or misfiled.
  • Rebuilt from the committed files alone: destroyed the four new clone rows, cleared units.md5 on the four units so the incremental seed could not skip them, then ran seed:custom_levels_ui_tests and seed:reseed_scripts_ui_tests. All four units come back with every script_level on a UI Test level and no production level.
  • Every migrated level page renders against a local dashboard: all four level pages of ui-test-single-unit-2026 and the level page of ui-test-unnumbered-lessons and ui-test-versioned-script-2019 return 200 and serve the clone. ui-test-versioned-script-2017's level page redirects to the 2019 version for an unassigned student, as it did before.
  • Local UI features, runner.rb -l against a dashboard on localhost:3000: teacher_tools/unnumbered_lessons.feature (1 scenario), teacher_tools/course_overview.feature (5) and teacher_tools/course_versions.feature (3) pass, as does the "Unit overview for unit in single-unit course" scenario of teacher_tools/script_overview.feature, which walks the 2025 -> 2026 version redirect into ui-test-single-unit-course-2026. Between them these load all four units.
  • That feature's other two scenarios, "Viewing student progress" and "Unit overview contents", fail here for an environmental reason that predates the branch: both wait on /courses/allthethingscourse/units/1, which 500s on a box with no properties_encryption_key. Two of allthethings' LevelGroups are encrypted, so the DSL seed skips their content and LevelGroup#pages returns nil under Unit#summarize (level_group.rb:113 via script_level.rb:548). Nothing in this commit touches allthethings.

Incidental churn in the four script_json files, from re-serializing: a new serialized_at, a level_keys property on each repointed script_level (set by the clone script, as in the units migrated by #73718 and #74377), and an empty jit_pl_concepts_lessons array, a seed model added since these four files were last written.

[reset db] so drone seeds from empty instead of incrementally, which is the path a fresh CI container takes.

Testing story

Deployment notes

Run bin/curriculum/clone_ui_test_levels.rb on the four remaining ui-test-*
units that still referenced production levels:

  ui-test-unnumbered-lessons
    unnumbered-lesson-level-one -> UI Test unnumbered-lesson-level-one  (new)
  ui-test-versioned-script-2017
    courseB_video_Unspotted     -> UI Test courseB_video_Unspotted      (new)
  ui-test-versioned-script-2019
    courseB_video_Unspotted     -> UI Test courseB_video_Unspotted      (shared)
  ui-test-single-unit-2026
    K-1 Artist1 1               -> UI Test K-1 Artist1 1                (existing)
    Standalone_Artist_9         -> UI Test Standalone_Artist_9          (existing)
    flappy_1                    -> UI Test flappy_1                    (new)
    flappy_11                   -> UI Test flappy_11                   (new)

Four new level files for seven repointed script_levels. The two
versioned-script units share one level, so the second unit lands on the
clone the first one created; the two Artist clones already existed, from
ui-test-csf (#73718) and ui-test-artist earlier in this stack, and were
found by name. That get-or-create by name is what keeps a level shared by
several units to a single copy.

All of these are plain custom levels: no contained levels, no project
templates, no sublevels, no encrypted properties, no rubrics. Each new
clone differs from its source only in name, created_at, updated_at,
audit_log, and the ordering of null-valued properties.

ui-test-shared-unit is already migrated -- #73718 did it as part of that
PR's prove-out -- so it is not touched here. Running the script on it
raises on its first script_level ("UI Test Sample Free Response" already
carries the prefix), which is the guard against double-prefixing.

With this commit, none of the 25 ui-test-* units whose script_json lives
in dashboard/test/ui/config/scripts_json references a production level.
What remains are the deprecated blockly levels of ui-test-maze and
ui-test-shared-unit, which are exempt from the partition.

levelbuilder_mode is off in locals.yml here, so the script was loaded
under `rails runner` with Rails.application.config.levelbuilder_mode set
for that process, as in the parent commits.

Verified:

- Every committed .level file is byte-identical to Level#to_xml for its
  row, at the path Policies::LevelFiles.level_file_path picks: nothing
  here is hand-edited or misfiled.
- Rebuilt from the committed files alone: destroyed the four new clone
  rows, cleared units.md5 on the four units so the incremental seed could
  not skip them, then ran seed:custom_levels_ui_tests and
  seed:reseed_scripts_ui_tests. All four units come back with every
  script_level on a UI Test level and no production level.
- Every migrated level page renders against a local dashboard: all four
  level pages of ui-test-single-unit-2026 and the level page of
  ui-test-unnumbered-lessons and ui-test-versioned-script-2019 return 200
  and serve the clone. ui-test-versioned-script-2017's level page redirects
  to the 2019 version for an unassigned student, as it did before.
- Local UI features, `runner.rb -l` against a dashboard on localhost:3000:
  teacher_tools/unnumbered_lessons.feature (1 scenario),
  teacher_tools/course_overview.feature (5) and
  teacher_tools/course_versions.feature (3) pass, as does the "Unit
  overview for unit in single-unit course" scenario of
  teacher_tools/script_overview.feature, which walks the 2025 -> 2026
  version redirect into ui-test-single-unit-course-2026. Between them these
  load all four units.
- That feature's other two scenarios, "Viewing student progress" and "Unit
  overview contents", fail here for an environmental reason that predates
  the branch: both wait on /courses/allthethingscourse/units/1, which 500s
  on a box with no properties_encryption_key. Two of allthethings'
  LevelGroups are encrypted, so the DSL seed skips their content and
  LevelGroup#pages returns nil under Unit#summarize
  (level_group.rb:113 via script_level.rb:548). Nothing in this commit
  touches allthethings.

Incidental churn in the four script_json files, from re-serializing: a new
serialized_at, a level_keys property on each repointed script_level (set by
the clone script, as in the units migrated by #73718 and #74377), and an
empty jit_pl_concepts_lessons array, a seed model added since these four
files were last written.

[reset db] so drone seeds from empty instead of incrementally, which is
the path a fresh CI container takes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@davidsbailey davidsbailey changed the title Migrate more misc ui-test units' levels Migrate more misc ui-test units' levels into ui test partition Aug 12, 2026
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