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

[MODCON-130] - Adjust process to add ECS tenant with soft deleted functionality #140

Merged
merged 22 commits into from
Dec 27, 2023

Conversation

azizbekxm
Copy link
Contributor

@azizbekxm azizbekxm commented Dec 21, 2023

Purpose

https://issues.folio.org/browse/MODCON-127

Approach

TODOS and Open Questions

Learning

Pre-Merge Checklist:

Before merging this PR, please go through the following list and take appropriate actions.

  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • Were any API paths or methods changed, added or removed?
    • Were there any schema changes?
    • Did any of the interface versions change?
    • Were permissions changed, added or removed?
    • Are there new interface dependencies?
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all the appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?
  • Did you modify code to call some additional endpoints?
    • If so, do you check that necessary module permission added in ModuleDescriptor-template.yaml file?

Ideally, all the PRs involved in breaking changes would be merged on the same day
to avoid breaking the folio-testing environment.
Communication is paramount if that is to be achieved,
especially as the number of inter-module and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems,
ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@azizbekxm azizbekxm changed the title Modcon 130 1 [MODCON-130/127] - Soft Delete Functionality Dec 22, 2023
@azizbekxm azizbekxm marked this pull request as ready for review December 22, 2023 12:49
@azizbekxm azizbekxm changed the title [MODCON-130/127] - Soft Delete Functionality [MODCON-130] - Adjust process to add ECS tenant with soft deleted functionality Dec 22, 2023
@azizbekxm azizbekxm requested a review from a team December 22, 2023 12:54
}

private void validateExistTenant(TenantEntity tenant) {
if (Boolean.FALSE.equals(tenant.getIsDeleted()) || tenant.getIsDeleted() == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

basically lets write migration script to update all existing tenants with isDeleted=false, it will simplify our java code to avoid additional null checks

Copy link
Contributor Author

@azizbekxm azizbekxm Dec 26, 2023

Choose a reason for hiding this comment

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

I checked that, there is no any migration script need because default value will be set . Also, we didn't write migration script for is_central field

image

I have checked that defaultValue is being set after updating module

Screenshot_4 Screenshot_5

@@ -59,7 +59,7 @@
<changeSet id="MOCON-127@add-is-deleted-flag" author="azizbekxm">
<addColumn tableName="tenant">
<column name="is_deleted" type="boolean" defaultValueBoolean="false">
<constraints unique="false" />
<constraints unique="false" nullable="false"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this added because there shouldn't be null


validateTenantForUpdateOperation(consortiumId, tenantId, tenantDto, existedTenant);
// isDeleted flag cannot be changed by put request
tenantDto.setIsDeleted(existedTenant.getIsDeleted());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After found issue relate to ablitiy of updating isCentral and isDeleted field, introduced improvement in order to prevent future unwanted changes

Copy link

sonarcloud bot commented Dec 26, 2023

@azizbekxm azizbekxm merged commit 59d5a66 into master Dec 27, 2023
4 checks passed
@azizbekxm azizbekxm deleted the MODCON-130-1 branch December 27, 2023 11:28
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