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

fix(APIv2): bulk deletion should delete link not the entity #2076

Merged
merged 1 commit into from May 13, 2024

Conversation

skateman
Copy link
Member

The bulk assignment was always deleting the right side from the database when unassigning. This means that when unassigning a system from a tailoring, we didn't delete the TailoringSystem record, but the System itself. Same happened for TailoringRule unassignment. Furthermore, due to the dynamic evaluation of the entities to be unassigned, the unassignment itself interfered with the assignment.

So I adjusted the unassignments to deal with the linking entities and reordered the deletion to happen before the assignment. This is something we aren't really able to test in our codebase though 😞

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

@skateman skateman requested a review from a team as a code owner May 12, 2024 11:18
Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.77%. Comparing base (37bc99b) to head (6b6f1e6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2076   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         224      224           
  Lines        4722     4728    +6     
=======================================
+ Hits         4664     4670    +6     
  Misses         58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@LightOfHeaven1994 LightOfHeaven1994 left a comment

Choose a reason for hiding this comment

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

Tested in ephemeral, works great!
Ignore CI failures as there is some issue on qe api client auth side

@skateman skateman merged commit 1f6ef2e into RedHatInsights:master May 13, 2024
7 of 8 checks passed
@skateman skateman deleted the bulk-assign-fix branch May 13, 2024 08:54
@skateman skateman added the APIv2 REST API v2 label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIv2 REST API v2
Projects
None yet
2 participants