-
Notifications
You must be signed in to change notification settings - Fork 1
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
SONIC-848: Management Command to Migrate Program Offers to Commercetools #16
base: 2u/main
Are you sure you want to change the base?
Conversation
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Outdated
Show resolved
Hide resolved
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Outdated
Show resolved
Hide resolved
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Show resolved
Hide resolved
if existing_uuids_set == new_uuids_set: | ||
return False, None | ||
|
||
combined_uuids = list(existing_uuids_set | new_uuids_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach will manage new and updated records from legacy systems but won't address deletions. For instance, if an offer initially had an 8% discount, it would be migrated into group 8. If that offer is later changed to 5%, it will then migrate to group 5 in the next run, but the offer would still exist in group 8 on CT. How do we plan to handle this discrepancy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will be informing the teams responsible to not edit any program offer after the migration
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Outdated
Show resolved
Hide resolved
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Outdated
Show resolved
Hide resolved
ecommerce/programs/management/commands/migrate_program_offers_to_commercetools.py
Show resolved
Hide resolved
|
||
if not response: | ||
logger.error( | ||
"Failed to create cart discount with type %s and value %s.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we re-run command from this one as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is also a failure in command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we note somewhere about when to re-run command and when to consider it successful? Maybe a small runbook ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can create one. Can you share an example of this?
"sortOrder": f"{sort_order:.20f}".rstrip('0').rstrip('.'), | ||
"isActive": True, | ||
"requiresDiscountCode": False, | ||
"stackingMode": "Stacking", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we disable stacking 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stacking will be enabled for Program offers otherwise we cannot apply program-related coupons
⛔️ MAIN BRANCH WARNING! 2U EMPLOYEES must make branches against the 2u/main BRANCH
⛔️ 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 [email protected]
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
(^ 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:
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.