[MGNLSYNC-43] Finalize support for invoking synchronization asynchronously Created: 27/May/20  Updated: 29/Mar/22  Resolved: 26/Jun/20

Status: Closed
Project: Magnolia Synchronization Module
Component/s: None
Affects Version/s: None
Fix Version/s: 1.9

Type: Improvement Priority: Neutral
Reporter: Simon Lutz Assignee: Roman Kovařík
Resolution: Done Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: 1d 3h 10m
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLSYNC-42 Synchronization manager does not comp... Closed
causality
caused by MGNLSYNC-40 Add support for invoking synchronizat... Closed
documentation
to be documented by MGNLSYNC-49 DOC: Synchronization module changes f... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Sprint: Maintenance 11, Maintenance 12, Maintenance 13
Story Points: 8
Team: Nucleus

 Description   

See the review items on the original ticket:
https://jira.magnolia-cms.com/browse/MGNLSYNC-40?focusedCommentId=208822&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-208822

Successfully merged basic functionality and released a 1.9-beta1; Here are additional review items for 2nd-stage review:

  • REST API review - not a problem to change provided we produce a change log / release notes
  • Rename 'repository' params back to 'workspace'
  • Date resolution for the endpoint (help define expected ISO date string format?)
  • Unbox booleans where applicable
  • VH for module config and command bootstraps? non-applicable for new module
  • Move manager to synchronization-core
  • Builder for SynchronizationRequest + pass as param to #synchronize(SyncRequest), #canSynchronize...
  • Remove XML output from endpoint (non-goal)
  • Consider ITs for endpoint?
  • Test method signatures: throw general Exception & no test prefix (BDD-style naming)
  • Failing existing synchronization command tests – failing on JDK12, passing on JDK8
  • Validate module config vs. manager, drop module lifecycle?
  • Reconsider deduplicating `SynchronizationCommand` (preferably evolving or partially deprecating the old one)
  • Global policy? //remove setter on manager, move the configuration under module config


 Comments   
Comment by Roman Kovařík [ 16/Jun/20 ]

Example request (copy/pasteable)

curl -u superuser:superuser http://localhost:8080/magnoliaAuthor/.rest/synchronization/v1/trigger --data '
{"url" : "http://localhost:8080/magnoliaPublic", "workspace": "website", "fromPath" : "/", "fromDate" : "2012-03-29T10:05:45-06:00"}
' --header "Content-Type: application/json"
Comment by Roman Kovařík [ 19/Jun/20 ]

For documentation:

  • GET .rest/synchronization/v1/reset //Resets and flushes all synchronizations
  • GET .rest/synchronization/v1/status/ {syncId}//Returns the status of a synchronization request
  • POST .rest/synchronization/v1/trigger //Starts a synchronization of content on a Magnolia public instance

JSON body of the request (in the current documentation these are request params, now part of the request body instead):

{
   "workspace": "website" //target workspace
   "path" : "/", //target path
   "template" : "reiceiverName" //receiver template configured under synchronization module config (can be added via module config decoration). This parameter is mutually exclusive with url
    "url" : "http://localhost:8080/magnoliaPublic" //target URL. This parameter is mutually exclusive with template 
   "fromPath" : "/", 
   "fromDate" : "2012-03-29T10:05:45-06:00"}
   ... (all params in the current doumentation)
}
Comment by Federico Grilli [ 25/Jun/20 ]

For the release notes:

version 1.9 depends on publishing-transactional 1.0.6+

Notable changes in REST api, see Roman's comment above in particular
 /.rest/synchronization/v1/synchronize has been replaced by /.rest/synchronization/v1/trigger.

There is a known issue upon updating in case a 1.9 beta version is installed

2020-06-25 15:10:19,851 WARN  agnolia.transformer.ClassPropertyBasedTypeResolver: Encountered the 'class' property but failed to resolved the type from its value: [info.magnolia.synchronization.commands.RestSynchronizationCommand]

This is harmless and the following node will have to be removed manually from the JCR configuration

/modules/synchronization-rest/commands

Also, in case 1.9-beta3 is installed, the following node will have to be removed from JCR configuration

/modules/synchronization-core/commands/synchronization/synchronize/synchronizationSenderClass

 

Generated at Mon Feb 12 07:39:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.