Commit 4bc18d20 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents 4bd2f58b 4df412c9
Pipeline #24280 failed with stage
in 0 seconds
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<list>
<string>onAssignmentChange</string>
</list>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>assignment</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_set.*</string>
<string>open</string>
<string>update</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Assignment</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>refreshOAuth2Session</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>React to selected properties changing on the session itself to trigger a token refresh.</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>session</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_setPolicyExpirationDate</string>
<string>_setNetwork.*</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>OAuth2 Session</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Proxy role: Manager, because the originator for the event which triggered
# this interaction may have been using a proxy role itself, and we should
# not limit what can be done on Assignments, but just follow what is being
# done.
context.getPortalObject().ERP5Site_refreshUserRelatedOAuth2SessionSet(
user_value_list=(state_change['object'].getParentValue(), ),
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>onAssignmentChange</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Proxy role: Manager, because the originator for the event which triggered
# this interaction may have been using a proxy role itself, and we should
# not limit what can be done on Assignments, but just follow what is being
# done.
state_change['object'].refreshAccessToken()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>refreshOAuth2Session</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -674,10 +674,9 @@ CREATE TABLE %s (
def distribute(self, activity_tool, node_count):
db = activity_tool.getSQLConnection()
now_date = getNow(db)
where_kw = {
'processing_node': -1,
'to_date': now_date,
'to_date': getNow(db),
'count': READ_MESSAGE_LIMIT,
}
validated_count = 0
......
......@@ -138,6 +138,10 @@ class CodingStyleTestCase(ERP5TypeTestCase):
template_tool = self.portal.portal_templates
for bt_title in self.getTestedBusinessTemplateList():
bt = template_tool.getInstalledBusinessTemplate(bt_title, strict=True)
# run migrations on the business template, except for the BT used to
# test workflow migration.
if bt_title != 'erp5_workflow_test':
bt.BusinessTemplate_convertAllDCWorkflowToERP5Workflow()
# make sure we can rebuild
bt.build()
......@@ -155,27 +159,57 @@ class CodingStyleTestCase(ERP5TypeTestCase):
if p and not p.strip().startswith("#")}
diff_line_list = []
def get_difference(path, has_old=True, has_new=True):
old = (
os.path.join(bt_base_path, path)
if has_old else
os.devnull
)
new = (
os.path.join(export_base_path, path)
if has_new else
os.devnull
)
old_is_dir = os.path.isdir(old)
new_is_dir = os.path.isdir(new)
# Raise if we are going from a directory to a file or vice-versa.
assert not has_old or not has_new or old_is_dir == new_is_dir, (path, old_is_dir, new_is_dir)
if old_is_dir or new_is_dir:
return
with open(old) as ff, open(new) as tf:
diff_line_list.extend(
difflib.unified_diff(
ff.readlines(),
tf.readlines(),
(
os.path.join('git', path)
if has_old else
os.devnull
),
(
os.path.join('bt5', path)
if has_new else
os.devnull
),
),
)
def get_differences(dcmp, base):
for name in dcmp.left_only:
yield 'removed: ' + os.path.join(base, name)
path = os.path.join(base, name)
yield 'removed: ' + path
get_difference(path, has_new=False)
for name in dcmp.right_only:
yield 'added: ' + os.path.join(base, name)
path = os.path.join(base, name)
yield 'added: ' + path
get_difference(path, has_old=False)
for name in dcmp.funny_files:
yield 'funny: ' + os.path.join(base, name)
for name in dcmp.diff_files:
path = os.path.join(base, name)
get_difference(path)
if not any(fnmatch.fnmatch(path, ignored_path) for ignored_path in ignored_paths):
yield 'modified: ' + path
with open(os.path.join(bt_base_path, path)) as ff, \
open(os.path.join(export_base_path, path)) as tf:
diff_line_list.extend(
difflib.unified_diff(
ff.readlines(),
tf.readlines(),
os.path.join('git', path),
os.path.join('bt5', path),
))
diff_line_list.append('\n')
for sub_path, sub_dcmp in six.iteritems(dcmp.subdirs):
for diff in get_differences(sub_dcmp, os.path.join(base, sub_path)):
yield diff
......
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