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

[Spritelab] Continue migrating away from v3 animations #36056

Merged
merged 5 commits into from
Aug 4, 2020

Conversation

ajpal
Copy link
Contributor

@ajpal ajpal commented Jul 29, 2020

Follow up to #35939

  1. un-deletes the levels deleted in that PR (I didn't realize deleting levels wasn't supported)

  2. Removes the start_animations from those levels (instead of deleting the whole level, just sets start_animations to nil.

  3. Replaces the following v3 animations with v1 animations using the new custom_animations api endpoint
    image
    code snippet to find/replace:

import os
import csv

csv_file = '/Users/anjali/Downloads/animations.csv'
animations = []
with open(csv_file, 'r') as f:
    reader = csv.reader(f)
    for row in reader:
        animations.append({'name': row[0], 'old': row[1], 'new': row[3]})

levels = os.listdir('/Users/anjali/code-dot-org/dashboard/config/scripts/levels')
for level in levels:
    with open(level, 'r') as file:
        filedata = file.read()
    
    for animation in animations:
        filedata = filedata.replace(animation['old'], animation['new'])
    
    with open(level, 'w') as file:
        file.write(filedata)

Next step: Continue building out the custom_animations bucket on S3 and replacing v3 animations with those.

Links

Testing story

Reviewer Checklist:

  • Tests provide adequate coverage
  • 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

Revert "last two levels to delete"

This reverts commit 68af0dd.

Revert "delete more broken levels"

This reverts commit 22573e7.

Revert "delete more broken levels"

This reverts commit b2610cd.

Revert "delete levels with broken animations"

This reverts commit 61f4fa3.
@ajpal ajpal requested a review from a team July 29, 2020 20:40
@ajpal
Copy link
Contributor Author

ajpal commented Jul 29, 2020

Second find and replace commit:
image
https://docs.google.com/spreadsheets/d/1nP9NP8mYqWkAuy7xleWWooqTqC5wjU3L_jWuefQ2sQo/edit#gid=458531085
(Same python snippet)

@maddiedierker
Copy link
Contributor

i can't comment on the file itself, but i think the change to schema_cache.dump should be reverted here

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

once the change to schema_cache.dump is reverted, this looks good to go!

@ajpal ajpal merged commit 047c5b9 into staging Aug 4, 2020
@ajpal ajpal deleted the jul29-animation-levels branch August 4, 2020 17:55
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