Skip to content

feat: refresh_xblock_skills management command - #129

Merged
sameenfatima78 merged 1 commit into
openedx:masterfrom
open-craft:navin/refresh-xblock-skills-command
Dec 29, 2022
Merged

feat: refresh_xblock_skills management command#129
sameenfatima78 merged 1 commit into
openedx:masterfrom
open-craft:navin/refresh-xblock-skills-command

Conversation

@navinkarkera

@navinkarkera navinkarkera commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

Adds command refresh_xblock_skills to update skills related to passed xblocks, or all xblocks in passed courses or all xblocks in all courses available from get_course_metadata_provider.

Reviewers:

Test instructions:

If you try out below commands in project directory, it should fail at ESME/lightcast API call due to incorrect URL and not before that. It should use test settings by default and use mock data for content. If not run make test once.

python manage.py migrate
python manage.py refresh_xblock_skills --xblock block-v1:edX+DemoX+Demo_Course+type@video+block@0b9e39477cf34507a7a48f74be381fdd
python manage.py refresh_xblock_skills --course some-id
python manage.py refresh_xblock_skills --all

To test args-from-database argument open django shell and run below commands:

from taxonomy.models import RefreshXBlockSkillsConfig
config = RefreshXBlockSkillsConfig.get_solo()
config.arguments = ' --all --commit '
config.save()

Then run below command:
python manage.py refresh_xblock_skills --args-from-database

Although, running above commands should cover the code in this MR, for end to end test with real metadata provider from course-discovery, I'll try to come up with test instructions once I figure out way to mock lightcast API or get free access to lightcast API

Merge checklist:

  • Any new requirements are in the right place (do not manually modify the requirements/*.txt files)
    • make upgrade && make requirements have been run to regenerate requirements
  • ./manage.py makemigrations has been run
    • Checkout the Database Migration Confluence page for helpful tips on creating migrations.
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.
  • Version bumped
  • Changelog record added
  • feat: adds events to handle changes in xblocks openedx-events#143
  • Update openedx-events dependency

Post merge:

  • Tag pushed and a new version released
    • Note: Assets will be added automatically. You just need to provide a tag (should match your version number) and title and description.
  • After versioned build finishes in GitHub Actions, verify version has been pushed to PyPI
    • Each step in the release build has a condition flag that checks if the rest of the steps are done and if so will deploy to PyPi.
      (so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
  • PR created in course-discovery to upgrade dependencies (including taxonomy-connector)
    • This must be done after the version is visible in PyPi as make upgrade in course-discovery will look for the latest version in PyPi.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 7, 2022
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@navinkarkera
navinkarkera force-pushed the navin/refresh-xblock-skills-command branch 2 times, most recently from f6ebadc to 7c06170 Compare December 12, 2022 06:09

@kaustavb12 kaustavb12 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Great job here @navinkarkera
I have left a few minor comments, otherwise this looks good to go from my end.

  • I tested this: Tested the management command works as expected in devstack
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

Comment thread taxonomy/management/commands/refresh_xblock_skills.py Outdated
Comment thread taxonomy/management/commands/refresh_xblock_skills.py
Comment thread taxonomy/management/commands/refresh_xblock_skills.py Outdated
Comment thread taxonomy/management/commands/refresh_xblock_skills.py Outdated
Comment thread taxonomy/management/commands/refresh_xblock_skills.py Outdated
Comment thread tests/management/test_refresh_xblock_skills.py Outdated
Comment thread tests/management/test_refresh_xblock_skills.py Outdated
@navinkarkera
navinkarkera force-pushed the navin/refresh-xblock-skills-command branch from 7c06170 to 1ec5d9c Compare December 12, 2022 07:34
@navinkarkera

Copy link
Copy Markdown
Contributor Author

@sameenfatima78 This is ready for your review.

@sameenfatima78 sameenfatima78 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some minor feedback. Looks good otherwise. Can we add more test cases to improve coverage?

Comment thread taxonomy/management/commands/refresh_xblock_skills.py
@navinkarkera
navinkarkera force-pushed the navin/refresh-xblock-skills-command branch 3 times, most recently from 4b1dac0 to 2bdd5ff Compare December 14, 2022 07:03
@navinkarkera
navinkarkera force-pushed the navin/refresh-xblock-skills-command branch from 2bdd5ff to 92e2ec8 Compare December 20, 2022 14:13
@navinkarkera

navinkarkera commented Dec 20, 2022

Copy link
Copy Markdown
Contributor Author

@sameenfatima78 Rebased and ready to be merged.
Actually, we need to wait for openedx/openedx-events#143

@navinkarkera
navinkarkera force-pushed the navin/refresh-xblock-skills-command branch from 91ac383 to cfcbeca Compare December 27, 2022 06:56
@navinkarkera

navinkarkera commented Dec 27, 2022

Copy link
Copy Markdown
Contributor Author

@sameenfatima78 Actually, we already merged another MR: #127 pointing to dev version of openedx-events and also the upstream MR is taking too long to be merged. So we can probably merge this as well and I'll create a new MR as soon as openedx-events is updated.

Closed by mistake, re-opened

chore: update openedx-events dep to dev commit
@mphilbrick211

Copy link
Copy Markdown

Hi @navinkarkera! Is this ready to be reviewed/merged?

@navinkarkera

Copy link
Copy Markdown
Contributor Author

@mphilbrick211 Yes, thank you.

@sameenfatima78
sameenfatima78 merged commit 5e78c31 into openedx:master Dec 29, 2022
@openedx-webhooks

Copy link
Copy Markdown

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

@sameenfatima78

Copy link
Copy Markdown
Member

@navinkarkera

Copy link
Copy Markdown
Contributor Author

@sameenfatima78 Ohh, it seems we will have to wait until openedx/openedx-events#143 is merged and latest version is pushed to pypi. Apologies for this confusion as I was not aware of this restriction.
Do you think we need to revert the changes and create new MR once openedx/openedx-events#143 is merged?

@sameenfatima78

sameenfatima78 commented Dec 29, 2022

Copy link
Copy Markdown
Member

@sameenfatima78 Ohh, it seems we will have to wait until openedx/openedx-events#143 is merged and latest version is pushed to pypi. Apologies for this confusion as I was not aware of this restriction. Do you think we need to revert the changes and create new MR once openedx/openedx-events#143 is merged?

@navinkarkera Yeah reverting it makes sense as it could block others from publishing a release.

@navinkarkera

Copy link
Copy Markdown
Contributor Author

@sameenfatima78 Created #136 MR to revert changes depending on openedx/openedx-events#143. Please approve and merge.

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

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants