Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5857

Provide a NodeVisitorTask and emphasize QueryTask as "unsafe"

XMLWordPrintable

      Background
      As part of work on migration diffs, it occurred that some upgrade tasks — those that have been implemented as QueryTasks, are very likely to cause incomplete upgrade issues.

      1. In particular, this is the case when a module has a first delta that creates/modifies a node structure, and then a second delta which executes a QueryTask. There is no guarantee at all that the query returns non-persisted changes in that workspace.

      2. We don't save sessions between deltas, only between modules.

      Lights, Camera, Action!
      1. We introduce a NodeVisitorTask, which in a similar fashion as the QueryTask enables to specify matching criteria and #operateOnNode().

      • We call for replacing QueryTask implementations with it.

      2. We make it way more explicit that the QueryTask can only operate safely on persisted content.

      • We log a warning whenever executing a QueryTask.
      • In 5.4 we deprecate current constructor, and add a new one with a boolean flag in the following spirit: "I read about the limitations and I know what I'm doing". If that boolean is false (default), we will fire a TaskExecutionException and interrupt the upgrade (see followup ticket MAGNOLIA-5859).

        Acceptance criteria

              mgeljic Mikaël Geljić
              mgeljic Mikaël Geljić
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD