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

Creates voiceover migration job #20165

Merged
merged 78 commits into from May 13, 2024
Merged

Conversation

Nik-09
Copy link
Member

@Nik-09 Nik-09 commented Apr 15, 2024

Overview

The PR creates beam job for voiceover migration i.e., copying the exiting voiceover data from curated exploration (ExplorationModel) to new storage system for voiceovers (EntityVoiceoversModel).

Note: Due to manual dependency on voiceover admins i.e., they should assign accents to voice artists before EntityVoiceoversModel creation. Hence we can’t automatically create EntityVoiceoversModel when a new voiceover is added, after the voiceover migration job runs (this PR).
One solution we are accepting is to make the UI ready for creators and learners (upcoming PR) so that after a successful run of this job, the release coordinator enables the feature flag so that all later voiceovers will be directly added to EntityVoiceoversModel instead of ExplorationModel.
This job is safe to merge because successively running the job updates the old data that are stored in the EntityVoiceoversmodel.
Some of the post-migration scenarios are discussed in this document making this PR safe to merge.

Essential Checklist

Please follow the instructions for making a code change.

  • I have linked the issue that this PR fixes in the "Development" section of the sidebar.
  • I have checked the "Files Changed" tab and confirmed that the changes are what I want to make.
  • I have written tests for my code.
  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I can't assign them directly).

Testing doc (for PRs with Beam jobs that modify production server data)

  • A testing doc has been written: here
  • (To be confirmed by the server admin) All jobs in this PR have been verified on a live server, and the PR is safe to merge.

Proof that changes are correct

voiceover_migration.mp4

Proof of changes on desktop with slow/throttled network

Proof of changes on mobile phone

Proof of changes in Arabic language

PR Pointers

@Nik-09 Nik-09 assigned seanlip and unassigned Nik-09 May 9, 2024
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Just one comment, everything else looks good. Thanks @Nik-09!

) -> voiceover_models.EntityVoiceoversModel:
"""Creates an entity voiceovers model instance.
"""Creates an entity voiceovers model instance without putting it into
Copy link
Member

Choose a reason for hiding this comment

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

Creates --> Creates and returns

Put a comma after "instance"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

"""
entity_voiceovers_dict = entity_voiceovers.to_dict()

entity_id = entity_voiceovers_dict['entity_id']
Copy link
Member

Choose a reason for hiding this comment

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

Per this comment: #20165 (comment)

I see, this is an interesting use case for to_dict().

I think the part I'm confused about is why we can't write entity_id = entity_voiceovers.id or similar, and same for a bunch of the others below. I suggest you use the domain object where possible, and use the to_dict() for voiceovers_mapping only.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@seanlip seanlip assigned Nik-09 and unassigned seanlip May 10, 2024
Signed-off-by: Nik-09 <nikhil.agarwal.2019@gmail.com>
@Nik-09 Nik-09 assigned seanlip and unassigned Nik-09 May 11, 2024
Copy link
Member Author

@Nik-09 Nik-09 left a comment

Choose a reason for hiding this comment

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

Hi @seanlip I have addressed the comments, PTAL once you are free.
Thank you.

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks @Nik-09! LGTM.

@seanlip seanlip assigned chris7716 and unassigned seanlip May 11, 2024
@seanlip
Copy link
Member

seanlip commented May 11, 2024

@chris7716 @JayVivarekar Could one of you please put a review hold on this for the server admin test of the job? Thanks.

@seanlip
Copy link
Member

seanlip commented May 11, 2024

@Nik-09 Just to check: why is the second checkbox in "Testing doc (for PRs with Beam jobs that modify production server data)" ticked? Has the job been run on the server? The PR only just got approved so I'm a bit surprised by that.

@oppiabot oppiabot bot added the PR: LGTM label May 11, 2024
Copy link

oppiabot bot commented May 11, 2024

Hi @Nik-09, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

@Nik-09
Copy link
Member Author

Nik-09 commented May 12, 2024

@Nik-09 Just to check: why is the second checkbox in "Testing doc (for PRs with Beam jobs that modify production server data)" ticked? Has the job been run on the server? The PR only just got approved so I'm a bit surprised by that.

Unticked.

@Nik-09
Copy link
Member Author

Nik-09 commented May 13, 2024

I have completed the job run in the backup server. @seanlip can you please verify the data in the datastore and merge this PR. Thank you

@Nik-09 Nik-09 assigned seanlip and unassigned chris7716 and Nik-09 May 13, 2024
@seanlip
Copy link
Member

seanlip commented May 13, 2024

Datastore looks good; merging. Thanks!

@seanlip seanlip added this pull request to the merge queue May 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 13, 2024
@Nik-09 Nik-09 added this pull request to the merge queue May 13, 2024
Merged via the queue into oppia:develop with commit 2f1ae2e May 13, 2024
81 checks passed
@Nik-09 Nik-09 deleted the voiceover_migration_job branch May 13, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Affects datastore layer Labels to indicate a PR that changes the datastore layer. PR: LGTM
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

9 participants