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

#22872 Avoid creation of duplicate persona tags #23848

Merged
merged 8 commits into from
Jan 23, 2023

Conversation

dsilvam
Copy link
Contributor

@dsilvam dsilvam commented Jan 18, 2023

For specific reasons sometimes tags names are altered with a ":persona" suffix. This should not change the way some API methods behave.

This fix avoids creating a duplicate tag just because the persona suffix is added when calling the API method that creates the tag.

IT included.

@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Unit Tests Report

1 397 tests  ±0   1 387 ✔️ ±0   3m 49s ⏱️ -2s
   136 suites ±0        10 💤 ±0 
   136 files   ±0          0 ±0 

Results for commit 8f1f482. ± Comparison against base commit a0734f8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Postman Tests Report

     54 files  ±0     729 suites  ±0   1h 31m 4s ⏱️ - 2m 10s
   358 tests ±0     357 ✔️ ±0  0 💤 ±0  1 ±0 
1 110 runs  ±0  1 106 ✔️ ±0  0 💤 ±0  4 ±0 

For more details on these failures, see this check.

Results for commit 8f1f482. ± Comparison against base commit a0734f8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Integration Tests [postgres] Report

   425 files  ±0     425 suites  ±0   1h 3m 32s ⏱️ - 7m 2s
4 570 tests +1  4 546 ✔️ +3  23 💤 ±0  1  - 2 
4 609 runs  +1  4 585 ✔️ +3  23 💤 ±0  1  - 2 

For more details on these failures, see this check.

Results for commit 8f1f482. ± Comparison against base commit a0734f8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Integration Tests [mssql] Report

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 8f1f482. ± Comparison against base commit a0734f8.

♻️ This comment has been updated with latest results.

}

@Override
public String getMSSQLScript() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this SQL work in MSSQL?

Copy link
Contributor

Choose a reason for hiding this comment

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

same

@@ -75,7 +75,7 @@ public Tag getTagAndCreate ( String name, String hostId, boolean persona ) throw
}

@Override
public Tag getTagAndCreate(final String name, final String userId, final String siteId, final boolean persona, final boolean searchInSystemHost) throws DotDataException, DotSecurityException {
public Tag getTagAndCreate(final String tagName, final String userId, final String siteId, final boolean persona, final boolean searchInSystemHost) throws DotDataException, DotSecurityException {

boolean localTransaction = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the local transaction logic here and add the @WrapInTransaction annotation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@dotcms-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.0% 0.0% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@dsilvam dsilvam merged commit 6e3673e into master Jan 23, 2023
@dsilvam dsilvam deleted the issue-22872-dup-persona-tags branch January 23, 2023 22:03
@dsilvam dsilvam linked an issue Jan 23, 2023 that may be closed by this pull request
public Tag getTagAndCreate(final String name, final String userId, final String siteId, final boolean persona, final boolean searchInSystemHost) throws DotDataException, DotSecurityException {

boolean localTransaction = false;
@WrapInTransaction
Copy link
Contributor

Choose a reason for hiding this comment

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

good

rjvelazco pushed a commit that referenced this pull request Jan 27, 2023
* #22872 Avoid creation of duplicate persona tags

* #22872 remove dup line

* #22872 Upgrade task to get rid of rels to dup tags, and dup tags per se

* #22872 compile errors fix

* #22872 IT for the UT

* #22872 new method in TestDataUtil

* #22872 delete with join for MSSQL. Add task to tasklocator. Add wrapIntransacton annotation
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.

Lucene queries for personas returning unexpected results
5 participants