Skip to content

Conversation

@rpenido
Copy link
Contributor

@rpenido rpenido commented Nov 30, 2023

Description

This PR prevents creating an UpdateParent action associated with a Tag that will be deleted.

Example:

- Tag 1
  - Tag 1.1
    - Tag 1.1.1

Actions before PR:

#1 Delete Tag 1
#2 Delete Tag 1.1
#3 Delete Tag 1.1.1
#4 Update parent tag of Tag 1.1 from Tag 1 to None (** THIS FAILS BECAUSE Tag 1.1 WAS DELETED **)
#5 Update parent tag of Tag 1.1.1 from Tag 1.1 to None  (** THIS FAILS BECAUSE Tag 1.1.1 WAS DELETED **)

Actions after PR:

#1 Delete Tag 1
#2 Delete Tag 1.1
#3 Delete Tag 1.1.1

It also checks if the Tag actually exists in the database before executing the Delete action. In the example above, because we didn't update the parent of tags 1.1 and 1.1.1, actions #2 and #3 should be skipped because both tags were cascade deleted on action #1.

Testing instructions

  • Please ensure that the tests cover the expected behavior and that the new test that reproduces the bug passes

Private-ref:

@openedx-webhooks
Copy link

openedx-webhooks commented Nov 30, 2023

Thanks for the pull request, @rpenido! 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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 30, 2023
@rpenido rpenido force-pushed the rpenido/fal-3568-fix-import-plan-bug branch 2 times, most recently from 956958d to 140fb6c Compare December 1, 2023 13:18
@rpenido rpenido changed the title fix: skip update parent to deleted tags fix: skip parent update from deleted tags Dec 1, 2023
@rpenido rpenido force-pushed the rpenido/fal-3568-fix-import-plan-bug branch from 140fb6c to dace8b8 Compare December 1, 2023 13:41
@rpenido rpenido force-pushed the rpenido/fal-3568-fix-import-plan-bug branch 5 times, most recently from 2ad5ec4 to 537c6a0 Compare December 1, 2023 14:24
@rpenido rpenido force-pushed the rpenido/fal-3568-fix-import-plan-bug branch from 537c6a0 to 5eef869 Compare December 1, 2023 14:25
@rpenido rpenido marked this pull request as ready for review December 1, 2023 14:26
Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

@rpenido 👍

  • I tested this: I verified the code and tests
  • I read through the code and considered the security, stability and performance implications of the changes.
  • Includes tests for bugfixes and/or features added.

pomegranited added a commit to open-craft/edx-platform that referenced this pull request Dec 4, 2023
@bradenmacdonald
Copy link
Contributor

Merging now. I see there's no version bump - let me know if we need to add one at some point, or just wait to combine this with other changes.

@bradenmacdonald bradenmacdonald merged commit dc3060e into openedx:main Dec 4, 2023
@openedx-webhooks
Copy link

@rpenido 🎉 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 bradenmacdonald deleted the rpenido/fal-3568-fix-import-plan-bug branch December 4, 2023 20:46
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.

4 participants