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

Handle the Cleanup of Resource Sharing Policies and Attributes During Resource, Attribute, and Organization Deletion. #422

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BimsaraBodaragama
Copy link
Contributor

This PR introduces mechanisms to clean up resource-sharing policies and shared attributes in the database when resources, attributes, or organizations are deleted. It ensures proper data integrity and consistency by removing orphaned entries.

Purpose

This feature resolves the need for proper cleanup mechanisms to remove resource-sharing policies and shared attributes when resources, attributes, or organizations are deleted. It resolves the following issues:

Goals

  • Introduce SQL queries and methods for deleting resource-sharing policies and shared attributes by resource type, attribute type, or organization ID.
  • Ensure data integrity by removing orphaned entries during deletion processes.
  • Maintain a consistent and clean database state.

Approach

  • Added SQL queries for deleting:
    • Resource-sharing policies by resource type and ID.
    • Shared attributes by attribute type and ID.
    • Resource-sharing policies by organization ID.
  • Implemented DAO and service methods to execute these queries.
  • Added unit tests to validate the correctness of the implemented methods.

Release note

Introduced mechanisms to clean up resource-sharing policies and shared attributes during the deletion of related resources, attributes, and organizations.

Documentation

N/A (Documentation updates will be tracked separately.)

Test environment

  • JDK 11
  • macOS 15.1.1 (24B91)
  • H2 Database

Related Issue

Handle the Cleanup of Resource Sharing Policies and Attributes During Resource, Attribute, and Organization Deletion #22199

…he deletions of resources, attributes and organizations.
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Project coverage is 47.09%. Comparing base (e343161) to head (e973dbd).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...anagement/dao/ResourceSharingPolicyHandlerDAO.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #422      +/-   ##
============================================
- Coverage     47.92%   47.09%   -0.84%     
- Complexity     1170     1197      +27     
============================================
  Files           140      141       +1     
  Lines          7484     7810     +326     
  Branches        868      965      +97     
============================================
+ Hits           3587     3678      +91     
- Misses         3592     3818     +226     
- Partials        305      314       +9     
Flag Coverage Δ
unit 36.83% <92.10%> (+1.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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.

2 participants