Skip to content

Create migration to update unversioned hoc scripts - #43534

Merged
dmcavoy merged 4 commits into
stagingfrom
unversioned-hoc-scripts
Nov 11, 2021
Merged

Create migration to update unversioned hoc scripts#43534
dmcavoy merged 4 commits into
stagingfrom
unversioned-hoc-scripts

Conversation

@dmcavoy

@dmcavoy dmcavoy commented Nov 11, 2021

Copy link
Copy Markdown
Contributor

We created a bunch of HOC scripts without version years in the URL (ex. spelling-bee). We want the final scripts for HOC to have -2021 in the url. We are doing this by making copies of the old script and adding -2021 to the URL. The old scripts should have unversioned as their version_year and the new ones should have 2021. We were able to do this for 7/10 scripts we wanted [by following these steps](by following these steps ) because their version_year was unversioned or we were able to set it to unversioned because they had no resources or vocab. The remaining 3 scripts have vocab and/or resources and a version_year of 2021. In order to make copies of these scripts we need to get their version_year to be unversioned. The only way to do this is to update the version_year on the script and key and display_name on the course_version directly on each environment. The safest way to do that is with a migration.

Testing story

  • Ran the migration
  • Ran bundle exec rake build

@dmcavoy
dmcavoy requested a review from a team as a code owner November 11, 2021 19:30
@dmcavoy
dmcavoy requested a review from a team November 11, 2021 19:31
@davidsbailey

Copy link
Copy Markdown
Member

I believe this resource link will break as a result of this [r data_visualizer_in_app_lab_part_1/explore-data-1/2021]:

"description": "<i class=\"fa fa-list-alt\" aria-hidden=\"true\"></i> **Video:** Watch the \n[r data_visualizer_in_app_lab_part_1/explore-data-1/2021]",

@bethanyaconnor

Copy link
Copy Markdown
Contributor

It looks like only explore-data-1 uses that syntax, and only twice, so I think we could just update it, either in this PR or on levelbuilder. It doesn't look like we're currently translating explore-data-1 so I don't think there should be any problems with doing that

@davidsbailey

Copy link
Copy Markdown
Member

+1 for manually updating that. seems fine to do in this PR. I do think we need to update it, because here is how it looks after pull down this PR, migrate and seed:
Screen Shot 2021-11-11 at 11 50 29 AM

@davidsbailey davidsbailey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after fixing 2 resource links. everything else looks ok to me after migrating + seeding locally.

changing a version year is definitely harder than I would like it tobe, but I think we may be somewhat committed to that as long as we have markdown content relying on course version keys

@bethanyaconnor

Copy link
Copy Markdown
Contributor

changing a version year is definitely harder

100% agree. I hope whenever we get around to changing how course version exists in our system, changing version year and family name get a lot easier.

script.course_version.save!

script.reload
script.write_script_json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want this in the migration do we? It will create modifications in every environment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This one and the one above)

@dmcavoy dmcavoy Nov 11, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ya thats true. I've already updated the script_json as part of the PR so I think we are good.

@dmcavoy

dmcavoy commented Nov 11, 2021

Copy link
Copy Markdown
Contributor Author

Merging to unblock staging.

@dmcavoy
dmcavoy merged commit 42c736b into staging Nov 11, 2021
@dmcavoy
dmcavoy deleted the unversioned-hoc-scripts branch November 11, 2021 21:52
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.

3 participants