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

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 85.36585% with 6 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (f873d96) to head (a5e1d43).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...anagement/dao/ResourceSharingPolicyHandlerDAO.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #422      +/-   ##
============================================
+ Coverage     48.91%   49.13%   +0.22%     
- Complexity     1237     1244       +7     
============================================
  Files           141      142       +1     
  Lines          7824     7847      +23     
  Branches        969      979      +10     
============================================
+ Hits           3827     3856      +29     
+ Misses         3673     3667       -6     
  Partials        324      324              
Flag Coverage Δ
unit 37.49% <85.36%> (+0.37%) ⬆️

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.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12822930334

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12822930334
Status: failure

@BimsaraBodaragama BimsaraBodaragama force-pushed the improvement/handle-resource-and-org-deletion branch from 64d1843 to ed223e3 Compare January 24, 2025 18:03
AnuradhaSK
AnuradhaSK previously approved these changes Jan 24, 2025
@AnuradhaSK
Copy link
Contributor

Since the integration test runner is continuously failing due to a different issue, and this PR only has new service additions which are not in use by other components,directly merging.

@AnuradhaSK AnuradhaSK merged commit 955c405 into wso2-extensions:main Jan 24, 2025
4 checks passed
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.

4 participants