Commit Graph

119 Commits

Author SHA1 Message Date
Bruno Bossola
7d56ac28ea Bugfix/ACS-1319 fix long running patch (#425)
* REPO-1319 - Migration to remove alf_server table

* Updated test schema reference

* Renamed test env. schema bootstrap configuration file

 This is done to avoid test failing due to special spring configuration overrides

* [skip ci] Better output from test errors, fixed table patterns for MSSQL support

* Now message patterns for migration are case insensitive

* Fixed NPE in SchemaDifferenceHelperUnitTest

* Fixed path to special test spring configuration

* Changes after review

* Changes after review

Co-authored-by: Nana Insaidoo <insaidoo.nana@yahoo.it>
2021-05-07 15:52:47 +01:00
Nana Insaidoo
45952e8e40 REPO-5624 Reimplement SchemaBootstrapTest (#435) 2021-05-06 16:26:10 +01:00
Sara
ab6c831447 Feature/acs 1425 long running tmdq (#417)
* ACS-1425 Add store info to result

* ACS-1425 Fix unit tests
2021-04-28 11:07:02 +01:00
Nana Insaidoo
5ce179f209 [ACS-1455] Schema validation report expansion with patch specific problems told apart (#386)
* Update schema validation report

- Introduced changes to tell apart problems due to optional unapplied
  patches within schema validation report

* Update SchemaDifferenceHelper

- Now populating optionalUpgradePatches list during the schema bootstrap
  registration to conform with patch registration mechanising already in use
- Added tests

* Make minor corrections

Co-authored-by: Nana Insaidoo <nana.insaidoo@meterian.com>
2021-04-27 09:57:47 +01:00
Cristian Turlica
f201f35ec1 MNT-22186: propTablesCleanupJobDetail v2 can cause Out of Memory erro… (#402)
-  MySQLDeleteNotExistsExecutor (by extending DeleteNotExistsExecutor) to cope with MySQLspecific fetch size limitation and restrictions
- updated tests
- moved tests to AllDBTestsTestSuite from AppContextExtraTestSuite
2021-04-23 11:20:48 +03:00
Cristian Turlica
a7d8789ff4 Revert "MNT-22186: propTablesCleanupJobDetail v2 can cause Out of Memory errors (CleanAlfPropTablesV2.sql ) (#390)" (#394)
This reverts commit 5e38be6f7d.
2021-04-21 10:22:16 +03:00
Davide
9d711213cc SEARCH-2782 commit time as event time (#377) 2021-04-20 16:32:41 +02:00
Cristian Turlica
5e38be6f7d MNT-22186: propTablesCleanupJobDetail v2 can cause Out of Memory errors (CleanAlfPropTablesV2.sql ) (#390)
- added dialect check to set MySQL specific fetch size limitation (Integer.MIN_VALUE). fetchSize activates result set streaming.
- updated tests
2021-04-19 18:02:19 +03:00
Tom Page
b9e4557973 Add unit test to look for unreferenced test classes. (#368)
* Add unit test to look for unreferenced test classes.

It's very unusual that we write a test class which should not also be added to a test suite.

* Utilise the hierarchy of NonBuildTests markers to help exclude false positives.

* Update all omitted tests.

Either add the test to AllUnitTestsSuite if it passes and runs quickly, mark the test with the appropriate NonBuildTests interface or mark the class as abstract (if appropriate).

Mark one test (RemoteTransformerClientTest) as a NeverRunTest even though it passes because it takes 12 seconds to run and is marked as deprecated.

* Mark two Camel tests as 'never run' because they failed on the CI.
2021-04-15 11:23:26 +01:00
Angel Borroy
20dd0efc6f Feature/search 2802 shared secret auth (#382)
* SEARCH-2802: Filter HTTP requests (now "none" and "secret" communication methods are available) from X509 Web Filter.

* SEARCH-2802: HttpClientFactory (for Repository and Search Services clients) support for Shared Secret communication.

* SEARCH-2802: Fix HttpClientFactory base unit tests.
2021-04-14 10:25:45 +02:00
Nana Insaidoo
046116ddf0 Bugfix/repo 5610 events are not actually sent to activemq (#360)
* Add events tests

* Polished put test: connects to JMS via TCP and validate that the event sent is also received back

* Now the tests provides a simple main() that listens on the topic, useful for quick debug sessions

* Now the user name is collected in the calling thread, so that the sendEvent does not silently fails

* Apply changes following review

* Now using queue system to guarantee events order

* Add license

* Updated logs and corrected comments

* Remove empty methods

* Now catering for spurious events at startup when database is bootstrapped

* Now preserving the txn-id in all events

* Moved up definitions in events2.xml after PR feedback

Co-authored-by: Bruno Bossola <bruno@meterian.com>
2021-04-09 13:34:05 +01:00
Davide
65675b9a1d Revert "SEARCH-2782 use current transaction timestamp instead of current time as event time (#371)" (#376)
This reverts commit 28f1429a
2021-04-08 15:02:06 +02:00
Davide
28f1429a13 SEARCH-2782 use current transaction timestamp instead of current time as event time (#371) 2021-04-07 15:59:24 +02:00
Tom Page
562479bde4 SEARCH-2768 Add callback feature for asynchronous ACL updates. (#357)
* SEARCH-2768 Add callback feature for asynchronous ACL updates.

Change default for user filter to empty, as changes from all users could affect metadata
or permissions which might need to be indexing by the enterprise Elasticsearch Connector.

* SEARCH-2768 Add unit test for new listeners.

* SEARCH-2768 Rename listener callback function.

* SEARCH-2768 Add unit test to test suite.
2021-03-29 11:31:36 +01:00
alandavis
b772205539 Switch master to support ACS 7.1.0
* incremented pom versions to 11.0 so that 9 may be used by 7.0.1 and 10 for 7.0.2
* version.schema not changed this time as it had already been incremented by 100 to 14100
2021-03-27 09:45:27 +00:00
Denis Ungureanu
d91a552925 ACS-1252 : Add tests for the JMS/ActiveMQ/Camel configuration in *alfresco-community-repo* (#356)
- fix messaging context for tests by adding missing mocked beans and properties
   - add tests for amqp, jms, activemq protocols
   - add travis job to run messaging tests
2021-03-24 14:13:37 +02:00
Bruno Bossola
8c91145b39 Revert "[ACS-1291] Asynchronous mechanism to send events (#351)" as no events are sent to AMQ with this change
This reverts commit f446031069.
2021-03-24 11:53:12 +00:00
Bruno Bossola
f446031069 [ACS-1291] Asynchronous mechanism to send events (#351)
* Performance optimisation spike

* Event2 is now sending event asynchronously

* Now forcing synchronous calls in tests for events2

* Now qualifying the event service used in tests

Co-authored-by: Nana Insaidoo <insaidoo.nana@yahoo.it>
2021-03-19 11:08:13 +00:00
evasques
ace87c9c3b MNT-21898 Unexpected ACLs when job runs Fix (#344)
* On move node, verify if parent has pending acl aspect applied and consider the pending shared ACL to update inheritance to avoid ending up with mixed permissions as children of pending acl nodes do not have the correct acls and when moved, keep their wrong acl.
* Add public method setInheritanceForChildren that receives an additional param: forceSharedACL. If an unexpected ACL occurs in a child, it can be overridden by setting it.
* Implement method setInheritanceForChildren that receives an additional parameter: forceSharedACL
* Add method setFixedAcls that receives an additional parameter: forceSharedACL - When a child node has an unexpected ACL, setting this parameter to true will force it to assume the new shared ACL instead of throwing a concurrency exception. When the shared ACL is forces, a warning is thrown in the log informing on what node exactly are we forcing the ACL. This is only possible when the child ACL is type SHARED and when it has an unexpected ACL
* All methods that called setFixedAcls without the new parameter will continue to operate as normal, as having forceSharedACL=false
* Added property forceSharedACL to the FixedACLUpdaterJob. If set to true it will force shared ACL to propagate through children even if there is an unexpected ACL
* When there is a exception detected when doing setInheritanceForChildren on the job, catch and log the error, but do not rollback the entire batch
* On copy/move unit tests I changed the ACL of the target folders on copy and move tests so that the old shared ACL accessed was never the same for origin and target folders as happens when performing these operations between sites
* Added unit test to verify fix for MNT-21898 - testAsyncWithNodeMoveChildToChildPendingFolder
* Added unit test to verify system property for the job: forceSharedACL - testAsyncWithErrorsForceSharedACL
2021-03-12 14:25:58 +00:00
Alan Davis
e88aab47f7 REPO-5376 Query Accelerator Remove all temporary code (#308)
* REPO-5376 Remove all temporary code

* Remove DBStats, SingleTaskRestartableWatch
* Remove propertiesCache and aspectsCache from DBQueryEngine as they were marked as temporary

* Remove further temporary code

Co-authored-by: Nana Insaidoo <insaidoo.nana@yahoo.it>
2021-02-23 16:54:58 +00:00
Andrea Gazzarini
1ff90242b0 [SEARCH-2677] Extract SearchEngineResultSet and SearchEngineResultMetadata interfaces (#286)
* [SEARCH-2677] Extract SearchEngineResultSet and SearchEngineResultMetadata interfaces

* [SEARCH-2677] Scan the ResultSet decorator chain for a maximum of 3 nested levels
2021-02-19 12:09:40 +01:00
Cristian Turlica
cee63b31f6 ACS-1264: Content Model changes dynamically updated to node caches across a cluster deadlock (#289)
Re enabling changes disabled in ACS-936 we can see deadlock in asynchronouslyRefreshedCacheThreadPool (AbstractAsynchronouslyRefreshedCache).

There should be no reason to be calling the dictionary destroy method before the doCall() finishes...and it is the use of the destroy method that carries the risk of deadlock.

Proposed fix: the liveLock is used for the doCall() method, this will stop deadlock from external calls to dictionary destroy() while doCall is in progress.

Removed invalidating cache fix (e.g. fix the issue where cluster nodes could have null values and other nodes had default value… so no properly invalidated on node startup). This fix was moved in ClusteringBootstrap as the initial one was causing issues.
2021-02-19 09:46:36 +02:00
Nana Insaidoo
e3dca6ecbd Apply changes to enable node ownership evaluation to happen on ent. as before (#279) 2021-02-08 15:21:44 +00:00
evasques
592dde531f MNT-22135 Filter policy to only run on admin auth - Unit test (#275)
Created unit test testIfGroupIsAdminAuthority to check if public method isAdminAuthority correctly validates groups:
* Verify it can identify GROUP_ALFRESCO_ADMINISTRATORS as an admin group
* Verify created groups (non administrators) and users are not considered administrators
* Add a subgroup to the parent group and verify if its still identified as non admin
* Add the group to the administrators group and verify if both group and subgroup are identified correctly as admins
* Add the user to the subgroup and verify if he's an admin
* Create a group with the same name as an admin user, group should not be identified as admin
2021-02-08 10:53:35 +00:00
Nana Insaidoo
a84a68cb9a Bugfix/APPS-766 classification children job not picking rm types (#272)
* Now handling System reading

* Address changes requested in PR #272
2021-02-04 13:00:18 +00:00
Alan Davis
a903d9ec44 REPO-5549 Fix: Local transformer names must exist and be unique docli… (#264)
* REPO-5549 Fix: Local transformer names must exist and be unique doclib Read from ... when overriding a Local transform.

* Problem was that there were two conflicting pieces of code in play in the LocalTransformRegistry.register method. One that checked for duplicate T-Engine names and the other that allowed transforms to be overridden if they had the same name.
* The code checking for duplicate names needed an extra clause to only look at T-Engines (they have a T-Engine url associated with them).
* The code that overrode transforms then worked, but still had issues as the supported source to target mimetypes, priorities and max sizes were not cleared.
* It turned out to be simpler to split the original LocalTransformRegistry.register method into two. Extracting a new method into CombinedConfig.removeOverriddenOrInvalidTransformers that discarded invalid or overridden config before the list of supported source to target mimetypes was created rather than try to fix them up later. This is why there appear to be quite a few changes.
* More extensive unit tests were also added.
2021-01-29 20:04:55 +00:00
Nana Insaidoo
358bd704df [ACS-1160] Handle null Authority (#249) 2021-01-20 14:57:17 +00:00
Denis Ungureanu
a9e54bd08c ACS-1043 : Camel upgrade to 3.7.0 (#235)
ACS-1043: Upgrade Camel version
2021-01-12 11:41:23 +02:00
Alan Davis
8fcaa7febb ACS-247 Query accelerator (#234)
Provides hook points for the query accelerator in alfresco-enterprise-repo.

In addition to these, it also includes temporary code to add timing headers to REST API calls. These will be removed as part of REPO-5376.

Commits mainly by Bruno and Nana. Merging from old projects and changes from master by Alan.
2021-01-11 11:31:36 +00:00
Nicolas Barithel
a6fce739b6 MNT-21968 : Cannot use some document names if Smart Folders feature is enabled
MNT-21968 : Cannot use some document names if Smart Folders feature is enabled
   - catch NumberFormatException on parseInt
   - test case "v00Draft.pdf"
2021-01-11 12:23:30 +02:00
Alan Davis
04d699cf86 REPO-5191 Bug: T-Engine should provide mapping rather than the repo. (#227)
Bug found while reviewing documents on how to create a custom metadata extractor. The original refactor had left the repo doing the mapping. It should have been passing the fully qualified repo properties to the T-Engine to do the mapping.

Linked to:
    Alfresco/acs-packaging#1826
    Alfresco/alfresco-transform-core#316
2021-01-07 11:56:42 +00:00
Alan Davis
5d2c83c14b REPO-5203 Remove legacy transformers (#181)
Now that the T-Engines provide parity with in process legacy transforms and metadata extract, the legacy transform code is now being removed. This will allow the documentation to be greatly simplified and a number of libraries to be removed.

Custom legacy transforms need to be moved to T-Engines. ACS 6 still provides a version where both may be run in parallel. New versions of the document transform engine (DTE) and media management (MM) are planned for ACS 7.
2021-01-03 13:20:22 +00:00
Denis Ungureanu
f786f4ffaf ACS-1033 : Spring upgrade to 5.3.2 (#213)
- Update test as per 5de549d7d4
- before spring 5.3.0, AbstractFallbackSQLExceptionTranslator was translating org.postgresql.util.PSQLException as UncategorizedSQLException - now it returns null (ref. e9cded560d (diff-c6aa1c6a4b11e8a722808e945c4c5b6ef471c42871c7ce830554dde81ad7f2c2L89))

Co-authored-by: CezarLeahu <35226487+CezarLeahu@users.noreply.github.com>
2020-12-23 12:21:03 +02:00
Adina Ababei
3891306459 ACS-1041 Fixed intermittent test failure - events2 (#208) 2020-12-16 15:23:55 +02:00
evasques
1b2c5d4c37 MNT-22040 Copying nodes that contain sys:pendingFixAcl aspect (#188)
* MNT-22040 - Copying nodes that contain sys:pendingFixAcl aspect
* Increased coverage of unit tests
* Added public method removePendingAclAspect
* Changed the job to use the removePendingAclAspect method instead of
repeating the same set of operations twice
* Changed method setFixedAcls to use sharedAclToReplace property of node
if it has the pendingFixAcl aspect applied instead of using the current
shared ACL to be replaced

* Added more tests and validations

* Fixed cuncurrency issues when updating parent and child at the same time, permissions triggered by a move on a node with a pending acl and permissions needeing to be reapplied on nodes that already have the pending acl aspect

* Increase the tree strcuture as sometimes we don't reach the timeout in tests

* code cleanup and formatting
2020-12-14 15:08:21 +00:00
Angel Borroy
8da40d0d57 SEARCH-2589: Additional check for the SOLR 6 Tracking Bean. 2020-12-04 13:57:07 +01:00
Angel Borroy
9f2c10e6be SEARCH-2589: Check Solr6 subsystem doesn't include the ShardRegistry reference for Community 2020-12-04 13:13:35 +01:00
Angel Borroy
e949437be8 Merge pull request #193 from Alfresco/fix/SEARCH-2602_MissedInformationSearchPage
Fix/search 2602 missed information search page
2020-12-04 12:58:08 +01:00
Angel Borroy
908157bc01 SEARCH-2602: Mock test for Solr Summary report unmarshalling 2020-12-03 14:32:46 +01:00
Alan Davis
bfffcd3f61 ACS-960 Disable very frequent intermittent test failures (#187)
Part of Epic: ACS-959 Fix or suppress the content repository's intermittent test failures
2020-12-03 11:46:06 +00:00
Alan Davis
2d2b4357f9 ACS-976 Metadata extraction NPE thrown in multi-node cluster using ATS (#190)
* ACS-976 Metadata extraction NPE thrown in multi-node cluster using ATS

In a multi repo node cluster, it is possible one node requests a metadata extract via the ATS and
that another responds to it. In this case the responder needs to recreate the TransformRequest. In
this case the target mimetype was wrong, resulting in the TransformRequest being sent to the wrong
code which then through a NPE because there was no replyQueue specified on the TransformRequest.

* ACS-963 Investigate testSharedLinkCreateGetDelete failures

Modified date changes. It can change now as metadata extract is async
2020-12-03 09:38:12 +00:00
Alan Davis
ea4e18d347 ACS-953 Unable to upgrade from ACS-7.0-M1 or ACS-7.0-M2 to ACS-7.0-A12 (#183)
* ACS-953 Unable to upgrade from ACS-7.0-M1 or ACS-7.0-M2 to ACS-7.0-A12

Now that we create internal releases of the form M.m.r-M9 (milestone), M.m.r-A9 (alpha) and M.m.r-RC9 (release candidate) during development and testing, we need to ensure we can upgrade from any of these to any other, as they may occur in any order and also to the final external release M.m.r. We also will allow a change from the final release back to an internal one for regression testing. The code within ModuleComponentHelper which calls this method, checks if it is the same version (0) and then if it is downgrading (> 0), so if they share the same M.m.r part matches AND is one of these formats, we return <0.
2020-11-30 19:54:21 +00:00
Alan Davis
ed4f353f9c ACS-938 metadata is not added when using Transform Service #176 2020-11-26 12:35:33 +00:00
Alan Davis
33f37731c7 REPO-5219 Allow AGS AMP to specify metadata extract mapping (REPO) (#169)
Added an optional extractMapping transform option to all metadata extractors to override the default one in the T-Engine.

In the case of the AGS AMP it extends the RFC822MetadataExtracter with its own class to specify a different set of document to system mappings. The class in the repo no longer does extractions, but is now used by the AsynchronousExtractor, which offloads extractions to T-Engines to obtain the mappings if it has been extended that are then passed to the T-Engine.
2020-11-19 17:04:52 +00:00
Jamal Kaabi-Mofrad
427777a048 ACS-778: Fixed IDS auth component by allowing other authentication components in the chain to have a go at authenticating the given user. 2020-11-17 21:31:30 +00:00
Cristian Turlica
f4f7698295 MNT-20250: Model updates not working for deployment in cluster (#37)
- added includeNewCheck to putAndCheckUpdate as a new optional parameter (default to false)
   - updated tests
2020-11-17 16:49:04 +02:00
Elia Porciani
7f3788225c [SEARCH-2533] (#158)
removed evenType class
2020-11-17 13:04:50 +01:00
Eugenio Romano
963c874247 Merge pull request #120 from Alfresco/dev-dhrn-ACS-777
[ACS-777] Email notification for digital workspace
2020-11-16 09:24:26 +00:00
Alan Davis
d70790f0c2 REPO-5190 Remove Metadata Extractors that are been offloaded in 7.0.0 (#148)
Removed all the Extractors that now exist in the T-Engines:

    JodConnverterMetadataExtracter
    TikaPoweredMetadataExtracter – the abstract base class used by other extractors
    -- MailMetadataExtracter
    -- PoiMetadataExtracter
    -- TikaAutoMetadataExtracter
    -- MP3MetadataExtracter
    -- TikaSpringConfiguredMetadataExtracter - removed as it required Spring config and would run in process
    -- PdfBoxMetadataExtracter
    -- OpenDocumentMetadataExtracter
    -- OfficeMetadataExtracter
    -- DWGMetadataExtracter
    HtmlMetadataExtracter
    RFC822MetadataExtracter

XmlMetadataExtracter and XPathMetadataExtracter still exist but don't provide any extraction out of the box. The reason they still exist is to support custom transforms (in AMPs) to extract from XML. There are no XML extractors in the T-Engines at the moment, but that is where the custom transformer code really should be moved.

    There are new tests to ensure the async transforms take place as expected.
    Additionally many of the existing tests still exist (those not related to a specific extractor). Some of these have been modified to reflect that the extract is now async and to no longer check the modified value has not changed (it is now expected to change).
    There are also a number of new metadata extract smoke tests that ensure that a selected subset of extracts are supported by the OOTB T-Engines.
2020-11-12 14:08:04 +00:00
dhrn
297d1242a5 Merge branch 'master' into dev-dhrn-ACS-777 2020-11-12 11:28:51 +05:30