Skip to content
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

Remove code docs that don't exist on curriculumbuilder #44799

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

bethanyaconnor
Copy link
Contributor

@bethanyaconnor bethanyaconnor commented Feb 11, 2022

Remove all the code docs that are on levelbuilder but not on curriculumbuilder.

I did this by grabbing a list of docs on my local curriculumbuilder (DB synced in the last couple months), that looked like:

cb_docs = [
  ...
 'applab,getRed',
 'applab,buzzer.playNotes',
 'gamelab,destroyEach',
 'applab,getGreen',
 'gamelab,pointToEach',
 'applab,buzzer.playSong',
 'gamelab,setAnimationEach',
 'gamelab,setTintEach',
 'applab,createLed',
 'gamelab,setColorEach',
 ...
]

Essentially, the ide then expression key of all the blocks. Then I used this to create a list of corresponding expressions seeding locally on dashboard:

lb_conterparts = cb_docs.map {|str| tokens = str.split(',') ; ProgrammingEnvironment.find_by_name(tokens[0]).programming_expressions.find_by_key(tokens[1]) }

Then I deleted everything not in that list:

to_delete = ProgrammingExpression.all.reject {|exp| lb_conterparts.include?(exp) }
to_delete.each {|exp| File.delete(exp.file_path) ; exp.destroy! }

(Note: I added the file_path method locally but didn't include it in this PR as I don't want there to be any code changes in this PR.)

Now, there are 483 expressions on my local levelbuilder dev environment and 488 on my local curriculumbuilder environment. The difference are these five docs:

["weblab,text-decoration", "spritelab,spritelab_adding-and-removing-behaviors", "spritelab,codestudio_defining-behaviors", "gamelab,moduloOperator", "applab,createRecordSync"]

I've been keeping a doc of code docs that we may need to do extra steps with and these are all already on the list. :) Essentially, we will want to create these on levelbuilder just before importing from curriculumbuilder.

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@bethanyaconnor bethanyaconnor requested review from a team and tess323 February 11, 2022 21:49
Copy link
Contributor

@tim-dot-org tim-dot-org left a comment

Choose a reason for hiding this comment

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

where did these extra docs come from originally?

@bethanyaconnor
Copy link
Contributor Author

where did these extra docs come from originally?

Good question! We generated these from all of the blocks that we have in our system, whether or not we have code docs for them on curriculumbuilder and whether or not they're still used. I think Dani did some work to filter them a bit but didn't catch them all. I forgot to mention that I did check that none of these are used in any lessons.

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.

None yet

2 participants