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

Management command to update voucher names and make them unique #4134

Merged
merged 17 commits into from
Feb 23, 2024

Conversation

zubair-ce07
Copy link
Contributor

@zubair-ce07 zubair-ce07 commented Feb 16, 2024

⛔️ MAIN BRANCH WARNING! 2U EMPLOYEES must make branches against the 2u/main BRANCH

  • I have checked the branch to which I would like to merge.

⛔️ DEPRECATION WARNING

This repository is deprecated and in maintainence-only operation while we work on a replacement, please see this announcement for more information.

Although we have stopped integrating new contributions, we always appreciate security disclosures and patches sent to security@edx.org

Anyone internally merging to this repository is expected to release and monitor their changes; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.

Required Testing

  • Before deploying this change, complete a purchase in the stage environment.
    (^ We can remove that manual check once REV-2624 is done and the corresponding e2e test runs again)

Description

Describe what this pull request changes, and why these changes were made. How will these changes affect other people, installations of edx, etc.?
Please include links to any relevant ADRs, design artifacts, and decision documents. Make sure to document the rationale behind significant changes in the repo, per OEP-19, and can be
linked here.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Learner", "Course Author", "Developer", and "Operator".
  • Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).
  • Provide links to the description of corresponding configuration changes. Remember to correctly annotate these changes.

Supporting information

Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.

Testing instructions

Please provide detailed step-by-step instructions for testing this change; how did YOU test this change?

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, OpenEdx vs. edx.org differences, development vs. production environment differences, security, or accessibility.

@zubair-ce07 zubair-ce07 changed the base branch from master to 2u/main February 16, 2024 11:37
@zubair-ce07 zubair-ce07 marked this pull request as ready for review February 16, 2024 16:04
@zubair-ce07 zubair-ce07 requested a review from a team as a code owner February 16, 2024 16:04
Copy link
Contributor

@christopappas christopappas left a comment

Choose a reason for hiding this comment

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

Please add a test that runs the management command twice to prove it is idempotent.

Additionally, should this be aware of the name length much like your database migration is? I think that needs to be reflected in this code, and a test should be added for that as well.

fix: sorted imports

Fix: Support create-mobile-skus to run again if failed (#4129)

* fix: Support create-mobile-skus to run again if we found an error previously

fix: Enable enrollment code purchase with mobile seats (#4130)

* fix: Enable enrollment code purchase with mobile seats

* test: Add unit test

---------

Co-authored-by: Abdul  Moeez Zahid <abdul.moeez@A006-01420.local>

fix: PEP8 conventions

fix: import issue

chore: added more test cases

fix: added new line at the end of file

fix: blank line issue

fix: long line issue

fix: pylint issues

fix: import issues

fix: removed extra blank line

fix: updated test

fix: issues in command

fix:: isort issue
Copy link
Contributor

@christopappas christopappas left a comment

Choose a reason for hiding this comment

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

thank you for adding the additional tests

Copy link
Contributor

@julianajlk julianajlk left a comment

Choose a reason for hiding this comment

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

LGTM

for voucher in vouchers:
assert voucher.name == f'{voucher.id} - {self.voucher_name}'

def test_update_voucher_names_long_name(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice addition!

@christopappas christopappas merged commit 8a0c67a into 2u/main Feb 23, 2024
10 checks passed
@christopappas christopappas deleted the zubair-voucher-update-command branch February 23, 2024 16:49
zubair-ce07 added a commit that referenced this pull request Mar 1, 2024
* chore: Added management command to update voucher names to be unique

---------

Co-authored-by: Chris Pappas <christopappas@users.noreply.github.com>
Co-authored-by: Chris Pappas <cpappas@edx.org>
zubair-ce07 added a commit that referenced this pull request Mar 1, 2024
* chore: Added management command to update voucher names to be unique

---------

Co-authored-by: Chris Pappas <christopappas@users.noreply.github.com>
Co-authored-by: Chris Pappas <cpappas@edx.org>
zubair-ce07 added a commit that referenced this pull request Mar 1, 2024
* chore: Added management command to update voucher names to be unique

---------

Co-authored-by: Chris Pappas <christopappas@users.noreply.github.com>
Co-authored-by: Chris Pappas <cpappas@edx.org>
zubair-ce07 added a commit that referenced this pull request Mar 1, 2024
* chore: Added management command to update voucher names to be unique

---------

Co-authored-by: Chris Pappas <christopappas@users.noreply.github.com>
Co-authored-by: Chris Pappas <cpappas@edx.org>
abdullahwaheed pushed a commit to abdullahwaheed/ecommerce that referenced this pull request Mar 1, 2024
…edx#4134)

* chore: Added management command to update voucher names to be unique

---------

Co-authored-by: Chris Pappas <christopappas@users.noreply.github.com>
Co-authored-by: Chris Pappas <cpappas@edx.org>
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.

3 participants