Commit a22232ef authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_upgrader: pass activate_kw to ActiveProcess's constructor

FullUpgrade Alarm relies on getLastActiveProcess to return results, which makes
use of the catalog to return a result. If the Active Processes spawned by the
3 Alarms composing the upgrader (pre, upgrade, post) are not indexed before
the FullUpgrade Alarm collects the results, then the wrong active result is
returned, which then give the wrong feedback to the user.

It seems that the "defaultActivateParameterDict" method cannot overwrite
the "tag" parameter of indexation activities (even if it was working for
after_tag). This is why this commit is needed.
parent 1bc87627
......@@ -4,7 +4,7 @@
activate_kw = params or {}
with context.defaultActivateParameterDict(activate_kw, placeless=True):
active_process = context.newActiveProcess()
active_process = context.newActiveProcess(activate_kw=activate_kw)
context.ERP5Site_checkUpgraderConsistency(fixit=fixit,
activate_kw=activate_kw,
......
......@@ -4,7 +4,7 @@
activate_kw = params or {}
with context.defaultActivateParameterDict(activate_kw, placeless=True):
active_process = context.newActiveProcess()
active_process = context.newActiveProcess(activate_kw=activate_kw)
context.ERP5Site_checkUpgraderConsistency(fixit=fixit,
activate_kw=activate_kw,
......
......@@ -17,7 +17,7 @@ if tool_portal_type in portal_type_list:
activate_kw = params or {}
with context.defaultActivateParameterDict(activate_kw, placeless=True):
active_process = context.newActiveProcess()
active_process = context.newActiveProcess(activate_kw=activate_kw)
method_kw = {'fixit': fixit,
'filter': {"constraint_type": 'upgrader'},
......
  • I think it would be better to understand why tag is not affected by default parameters. Maybe it is provided as explicit parameter when creating the activity, which would then override default value ?

  • Alarm.newActiveProcess sets a default tag if no dictionary activate_kw containing a tag key is given as parameter.

    @vpelletier : do you think we should call getDefaultActivateParameterDict in Alarm.newActiveProcess and update it with the potential activate_kw given in parameters ?

  • This makes sense indeed. FWIW, I traced it back to 6c88e86a and the intent is correct. I think your commit is good as is.

    What itches me now is to see newActiveSense modifying activate_kw when caller provides it and does not pass a "tag" key in it... But that's a separate issue.

    So if tests are still happy and you did not discover other scheduling issues since this one, this can be merged.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment