-
Notifications
You must be signed in to change notification settings - Fork 481
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
stop writing lesson descriptions to scripts.en.yml #46188
Conversation
18207a5
to
145f474
Compare
@@ -911,21 +904,6 @@ class UnitEditor extends React.Component { | |||
this.setState({projectWidgetTypes}) | |||
} | |||
/> | |||
{!this.props.isMigrated && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably should have started deleting from this point in the code, since everything on levelbuilder contingent upon !isMigrated
is dead 🤷
@@ -1635,40 +1622,27 @@ def summarize_i18n_for_copy(new_name, new_course_version) | |||
data['lessons'] = {} | |||
lessons.each do |lesson| | |||
lesson_data = { | |||
'key' => lesson.key, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bethanyaconnor , was there any special reason you included the key when you copied lesson translations? It didn't exist for any scripts before 2021. these are the scripts I found them on:
ai-ethics-2021
coursea-2021
courseb-2021
coursec-2021
coursed-2021
coursee-2021
coursef-2021
csa6-2022
csa7-2022
csa8-2022
csd1-2021
csd1-2022
csd2-2021
csd2-2022
csd3-2022
csd4-preview-2021
csd5-2022
csd5-preview-2021
csd7-2022
csp1-2021
csp1-2022
csp10-2021
csp2-2021
csp2-2022
csp3-2021
csp3-2022
csp4-2021
csp4-2022
csp5-2021
csp5-2022
csp6-2021
csp6-2022
csp7-2021
csp7-2022
csp8-2021
csp9-2021
csp9-2022
express-2021
express-2022
hello-world-animals-2021
hello-world-emoji-2021
hello-world-food-2021
hello-world-retro-2021
k5-onlinepd-2021
k5-onlinepd-2022
kodea-pd-2021
poem-art-2021
pre-express-2021
pre-express-2022
self-paced-pl-csd2-2022
vpl-csd-2021
vpl-csd-2022
vpl-csp-2021
vpl-csp-2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that line was added in https://github.com/code-dot-org/code-dot-org/pull/36020/files#diff-22769ab80ff34eaf4aadc1dc87e1b9bdad8b445cec233c9a5a1d2bcc5a7a7978, which was before my time on cplat, so I can't provide background, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry to jump to conclusions Bethany. At the link you shared, it looks like a copy-paste error to me -- we were trying to populate the new lesson.key field from lesson.name, and it looks like we incorrectly also added a translation for the key at the same time, without a scenario where we'd need to ever show that translated value to the user. So I think this line is safe to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries -- I just didn't remember writing this :) I agree that it looks it can be removed. We never want to use translated unique identifiers anyway so it's better to not even give ourselves the option
I want to check my understanding. Looking at these lines: code-dot-org/dashboard/app/models/lesson.rb Lines 275 to 278 in b7fdd2a
It looks like we are only using the |
Great question Dani! We have unmigrated scripts in production, but not in levelbuilder. We did our migration by migrating all scripts on levelbuilder, and then propagating those changes to production via github and the seed process. because there are scripts in production which no longer exist on levelbuilder, those scripts in production were not migrated. Once we do our first one-time cleanup of unused scripts in production, those unmigrated scripts will all be removed. then we'll be able to remove any code which affects only unmigrated scripts. |
So, we shouldn't remove the lines you linked to because they affect scripts in production. but we can remove the lines I'm removing because they only get used on levelbuilder (to be verified by the reviewer, of course :-) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see these complicated code paths getting simpler!
Thank you for taking a close look, Dani! |
step 5a of PLAT-1528. This should have an immediate reduction in write contention on scripts.en.yml, because many of the edits made to this file are due to lesson descriptions being updated.
The real work is done in this commit: b0dc844
the rest of the PR removes a dead codepath which the script edit page previously used to import lesson descriptions from Curriculum Builder. this does not immediately reduce write contention, because we should already be skipping these writes here:
code-dot-org/dashboard/app/models/script.rb
Line 1339 in 6739e3b
Testing story
description_student
ordescription_teacher
lesson translations anywhere else in our codebase