Skip to content

Conversation

@0x29a
Copy link
Contributor

@0x29a 0x29a commented Dec 25, 2022

Description

Note: for now, the PR depends on and includes #31384, so use this link to see and review the actual diff.

This PR is the continuation of our previous effort to unify XBlock naming across the platform. This time, each module occurrence reviewed and changed to block if it satisfied these criteria:

  • It meant "XBlock".
  • It was in *.py, *.rst, or *.md file.
  • It didn't mean "Module Store" / "Module System" / "Student Module".
  • It could be renamed without causing more confusion than clarity. For example, I wasn't renaming module to block alongside module_id, which can't be renamed as it's the part of the CCX API. Same about module_data and module_state_key.

This regex has been used to filter out the larger part of false-positive occurrences:

(?i)(?![^\s]*?store[^\s]*)(?![^\s]*?xmodule\.[^\s]*)(\b[^\s]*?module[^\s]*\b)

Basically, it excludes modulestore and from xmodule.<something> import <something> from the search results.

The following table shows the distribution by files:

Level 1 Level 2 Level 3 Occurrences Notes
openedx 617
openedx core 564
openedx core djangolib 5
openedx core djangoapps 356
openedx core lib 200
openedx features 31
openedx features course_experience 16
openedx features enterprise_support 3
openedx features content_type_gating 5
openedx features discounts 1
openedx features calendar_sync 3
openedx features personalized_learner_schedules 3
openedx tests 22
openedx tests completion_integration 20
openedx tests ci 2
cms 366 Also renamed item -> block, including cms/djangoapps/contentstore/views/item.py file.
cms djangoapps 316
cms djangoapps xblock_config 4
cms djangoapps pipeline_js 4
cms djangoapps contentstore 305
cms djangoapps models 1
cms djangoapps api 2
cms lib 1
cms lib xblock 1
cms envs 32
xmodule 2206 Didn't rename xblocks fields, didn't touch modulestore API.
xmodule capa 92
xmodule capa safe_exec 54
xmodule capa tests 24
xmodule modulestore 654 Didn't rename anything meaning "module store".
xmodule modulestore perf_tests 3
xmodule modulestore split_mongo 81
xmodule modulestore mongo 109
xmodule modulestore tests 158
xmodule contentstore 8
xmodule docs 1
xmodule docs decisions 1
xmodule util 4
xmodule tests 832
xmodule tests rendering 3
xmodule tests xml 15
xmodule video_block 34
scripts 48
scripts xsslint 19
scripts xsslint xsslint 12
scripts xsslint tests 7
scripts xblock 1
common 201
common test 13
common test data 3
common djangoapps 188
common djangoapps entitlements 2
common djangoapps course_modes 4
common djangoapps static_replace 2
common djangoapps track 31
common djangoapps student 20
common djangoapps split_modulestore_django 1
common djangoapps xblock_django 3
common djangoapps util 64
common djangoapps edxmako 26
common djangoapps pipeline_mako 7
common djangoapps third_party_auth 28
docs 148
docs decisions 41
docs guides 103
docs guides hooks 2
docs guides testing 18
docs guides frontend 24
docs guides docstrings 32
docs technical 1
docs api 3
lms 2435 Didn't rename module_score and module_completion, as they're used together, and module_score is the LTI consumer block field. Didn't touch module_id because of the same reason.
lms djangoapps 2355
lms djangoapps mobile_api 79
lms djangoapps verify_student 15
lms djangoapps bulk_email 5
lms djangoapps ora_staff_grader 2
lms djangoapps discussion 69
lms djangoapps static_template_view 1
lms djangoapps learner_dashboard 12
lms djangoapps program_enrollments 2
lms djangoapps courseware 1011 Didn't rename 1) StudentModule and anything related, as this would generate Django migration. 2) StudentModule's fields. Also, removed unused _has_access_xmodule from access.py file.
lms djangoapps instructor_task 396 Didn't rename anything related to module state, or XModule in in the context of StudentModule.
lms djangoapps lms_xblock 18
lms djangoapps ccx 131 Didn't rename anything in this directory, because module term is extensively used in the REST API.
lms djangoapps teams 2
lms djangoapps grades 111 Removed unused _iter_scorable_xmodules from transformer.py file.
lms djangoapps instructor 294 Didn't rename module_state_key, as it's StudentModule's field, didn't rename delete_module, as it's an API part.
lms djangoapps lms_initialization 1
lms djangoapps survey 1
lms djangoapps experiments 6
lms djangoapps certificates 9
lms djangoapps lti_provider 9
lms djangoapps rss_proxy 1
lms djangoapps instructor_analytics 11
lms djangoapps coursewarehistoryextended 52
lms djangoapps learner_home 1
lms djangoapps commerce 2
lms djangoapps course_api 9
lms djangoapps course_blocks 32
lms djangoapps gating 11
lms djangoapps save_for_later 1
lms djangoapps edxnotes 32
lms djangoapps course_wiki 5
lms djangoapps monitoring 13
lms djangoapps branding 3
lms djangoapps badges 8
lms lib 1
lms lib courseware_search 1
lms envs 64
lms envs docs 9
pavelib 76
pavelib utils 24
pavelib utils test 4
pavelib paver_tests 10

Supporting information

This PR has to be merged simultaneously with:

Testing instructions

Use the sandbox to perform general testing (courseware, course tabs, activation emails, course authoring, course exporting/importing, etc):

Questions

Some ugettext_lazy-wrapped strings were changed. Should I re-generate *.po files and update translations, or this is done automatically by some regular job, like dependencies upgrades?

Private-ref: BB-6926

@openedx-webhooks
Copy link

openedx-webhooks commented Dec 25, 2022

Thanks for the pull request, @0x29a!

When this pull request is ready, tag your edX technical lead.

@openedx-webhooks openedx-webhooks added the blended PR is managed through 2U's blended developmnt program label Dec 25, 2022
@0x29a 0x29a force-pushed the 0x29a/bb6926/rename_module_to_block branch 17 times, most recently from fbadbab to 87c7a2c Compare December 31, 2022 12:15
@0x29a 0x29a force-pushed the 0x29a/bb6926/rename_module_to_block branch 2 times, most recently from ef5305d to 2ece590 Compare January 3, 2023 14:24
@0x29a 0x29a changed the title [WIP][BD-13][BB-6926] refactor: convert module term to block [BD-13][BB-6926] refactor: convert module term to block Jan 4, 2023
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

@0x29a, as always, fantastic work! I still need to test some parts (I will continue tomorrow), but I'm posting my review to unblock you. Everything looks reasonable to me.


This PR has to be merged simultaneously with: (...) edx-sga

Fortunately, integration tests are not part of the CI , so this is not a blocker - we can merge mitodl/edx-sga#333 at its own pace.


Some ugettext_lazy-wrapped strings were changed. Should I re-generate *.po files and update translations, or this is done automatically by some regular job, like dependencies upgrades?

These files will be re-generated by the transifex bot. We can remove all translation changes from this PR. Please see this example change and the follow-up update.

Copy link
Member

Choose a reason for hiding this comment

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

Just leaving an open comment to remember about changing this:

  • requirements/edx/base.txt
  • requirements/edx/development.txt
  • requirements/edx/testing.txt

@0x29a 0x29a force-pushed the 0x29a/bb6926/rename_module_to_block branch 5 times, most recently from b34c122 to df30178 Compare January 9, 2023 12:15
@0x29a
Copy link
Contributor Author

0x29a commented Jan 9, 2023

Thank you for the thorough review, @Agrendalath! I think I addressed all comments. Triggering the sandbox update now.

These files will be re-generated by the transifex bot. We can remove all translation changes from this PR. Please see #30826 and #30879.

Got it, thanks for the explanation. I left file rename changes in *.po files, as I'm not sure this script is clever enough to change the path instead of adding new translation records.

Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: checked for regressions
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

@Agrendalath
Copy link
Member

@ormsbee, would you like to do a sanity check here too? I will prepare an announcement for this and #31384 once we merge them.

@0x29a 0x29a force-pushed the 0x29a/bb6926/rename_module_to_block branch from df30178 to 9e26985 Compare January 11, 2023 13:13
@Agrendalath Agrendalath force-pushed the 0x29a/bb6926/rename_module_to_block branch from 9e26985 to fc6060c Compare January 23, 2023 14:25
@Agrendalath
Copy link
Member

@ormsbee, just a friendly reminder about this PR.

Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

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

@Agrendalath, @0x29a : This is fantastic. I'm sorry for not getting back to you earlier. For things like this, feel free to merge without blocking on me–just as long as you coordinate with @jristau1984 on the window. Please do block on me if you're making a breaking change, model change, or database migration.

Thank you.

@Agrendalath Agrendalath force-pushed the 0x29a/bb6926/rename_module_to_block branch from fc6060c to e576478 Compare January 30, 2023 17:31
@Agrendalath Agrendalath changed the title [BD-13][BB-6926] refactor: convert module term to block refactor: convert module term to block [BD-13] Jan 30, 2023
@Agrendalath Agrendalath merged commit a50ef12 into openedx:master Jan 30, 2023
@Agrendalath Agrendalath deleted the 0x29a/bb6926/rename_module_to_block branch January 30, 2023 17:49
@openedx-webhooks
Copy link

@0x29a 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@bradenmacdonald
Copy link
Contributor

This makes me so happy :) Thanks for getting this done!

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blended PR is managed through 2U's blended developmnt program

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants