From ad603c7430cd538501fbfec191d921679c51a826 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Tue, 19 Feb 2019 11:35:40 +0100 Subject: [PATCH 1/3] [erp5_forge] Add create commit option by default for submodule changes --- .../erp5_vcs/BusinessTemplate_doVcsCommit.py | 5 + .../BusinessTemplate_viewVcsChangelog.xml | 1 + .../your_version_up.xml | 153 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsCommit.py b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsCommit.py index b3d8af37e4f..6315ddeb9d8 100644 --- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsCommit.py +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_doVcsCommit.py @@ -1,3 +1,4 @@ +from Products.ERP5Type.Log import log kw = {} request = container.REQUEST for k in 'added', 'modified', 'removed': @@ -17,7 +18,11 @@ if not changelog.strip(): '&portal_status_message=Commit%20cancelled.') return context.asContext(**kw).BusinessTemplate_viewVcsChangelog() +version_up_submodule = request.get('version_up', False) try: return context.getVcsTool().commit(changelog, **kw) + if version_up_submodule: + # Use interaction workflow in this case rather than trying imperative way + log("Check if we reach this point, it should be reachable by default") except Exception, error: return context.BusinessTemplate_handleException(error, script.id) diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog.xml index 7a91bc1aa79..510df72fed9 100644 --- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog.xml +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog.xml @@ -72,6 +72,7 @@ your_push + your_version_up your_changelog reminder added_files diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml new file mode 100644 index 00000000000..1aa74838c4f --- /dev/null +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml @@ -0,0 +1,153 @@ + + + + + + + + + + delegated_list + + + default + description + enabled + title + + + + + id + your_version_up + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + default + + AAAAAAAAAAI= + + + + enabled + + AAAAAAAAAAM= + + + + field_id + + + + form_id + + + + target + + + + title + + + + + + + values + + + + default + 1 + + + description + This will add an extra commit to the regarding the version up of the submodule in the parent ERP5 repository. + + + enabled + 1 + + + field_id + your_checkbox + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Version Up Submodule Commit + + + + + + + + + + + + + + + _text + python: preferences.getPreferredVcsPushMode() and not here.getVcsTool().getAheadCount() + + + + + + + + + + + + _text + python: here.getVcsTool().reference != \'svn\' + + + + + -- 2.30.9 From 357b39b6f91276a844150e13cf58ec872bae5734 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Wed, 20 Feb 2019 11:05:53 +0100 Subject: [PATCH 2/3] [erp5_forge] Add interaction workflow for creating commit for submodule version up --- ...s_template_commit_interaction_workflow.xml | 46 +++++++++++++++++++ .../interactions.xml | 28 +++++++++++ ...BusinessTemplate_createVersionUpCommit.xml | 16 +++++++ .../scripts.xml | 22 +++++++++ .../variables.xml | 22 +++++++++ .../worklists.xml | 22 +++++++++ bt5/erp5_forge/bt/template_workflow_id_list | 3 +- 7 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow.xml create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions.xml create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions/BusinessTemplate_createVersionUpCommit.xml create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/scripts.xml create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/variables.xml create mode 100644 bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/worklists.xml diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow.xml new file mode 100644 index 00000000000..13ba7eb13f3 --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow.xml @@ -0,0 +1,46 @@ + + + + + + + + + + _objects + + + + + + creation_guard + + + + + + description + + + + groups + + + + + + id + business_template_commit_interaction_workflow + + + manager_bypass + 0 + + + title + Business Template Commit Interaction Workflow + + + + + diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions.xml new file mode 100644 index 00000000000..e18bf8cbf77 --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _mapping + + + + + + _objects + + + + + + id + interactions + + + + + diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions/BusinessTemplate_createVersionUpCommit.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions/BusinessTemplate_createVersionUpCommit.xml new file mode 100644 index 00000000000..f3fdc40999a --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/interactions/BusinessTemplate_createVersionUpCommit.xml @@ -0,0 +1,16 @@ + + + + + + + + + + id + BusinessTemplate_createVersionUpCommit + + + + + diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/scripts.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/scripts.xml new file mode 100644 index 00000000000..a703b14c4ca --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/scripts.xml @@ -0,0 +1,22 @@ + + + + + + + + + + _mapping + + + + + + id + scripts + + + + + diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/variables.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/variables.xml new file mode 100644 index 00000000000..6ae03699d19 --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/variables.xml @@ -0,0 +1,22 @@ + + + + + + + + + + _mapping + + + + + + id + variables + + + + + diff --git a/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/worklists.xml b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/worklists.xml new file mode 100644 index 00000000000..c3432aa051e --- /dev/null +++ b/bt5/erp5_forge/WorkflowTemplateItem/portal_workflow/business_template_commit_interaction_workflow/worklists.xml @@ -0,0 +1,22 @@ + + + + + + + + + + _mapping + + + + + + id + worklists + + + + + diff --git a/bt5/erp5_forge/bt/template_workflow_id_list b/bt5/erp5_forge/bt/template_workflow_id_list index ac7f0b4ffd8..662d4093523 100644 --- a/bt5/erp5_forge/bt/template_workflow_id_list +++ b/bt5/erp5_forge/bt/template_workflow_id_list @@ -1,2 +1,3 @@ bug_event_workflow -bug_workflow \ No newline at end of file +bug_workflow +business_template_commit_interaction_workflow \ No newline at end of file -- 2.30.9 From 2d6ffcf43526825397b51517e5a2bf33afcafe06 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Wed, 20 Feb 2019 15:23:31 +0100 Subject: [PATCH 3/3] [erp5_forge] Add for preference check --- ...n_up.xml => your_version_up_submodule.xml} | 8 +- .../erp5_vcs/Preference_viewVcs.xml | 1 + .../my_preferred_version_up_submodule.xml | 96 +++++++++++++++++++ 3 files changed, 103 insertions(+), 2 deletions(-) rename bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/{your_version_up.xml => your_version_up_submodule.xml} (93%) create mode 100644 bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs/my_preferred_version_up_submodule.xml diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up_submodule.xml similarity index 93% rename from bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml rename to bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up_submodule.xml index 1aa74838c4f..c6538203165 100644 --- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up.xml +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/BusinessTemplate_viewVcsChangelog/your_version_up_submodule.xml @@ -19,7 +19,7 @@ id - your_version_up + your_version_up_submodule message_values @@ -61,6 +61,10 @@ AAAAAAAAAAI= + + description + + enabled @@ -132,7 +136,7 @@ _text - python: preferences.getPreferredVcsPushMode() and not here.getVcsTool().getAheadCount() + python: preferences.getPreferredVersionUpSubmodule() and not here.getVcsTool().getAheadCount() diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs.xml index bd9d9160bb5..0588986d7a5 100644 --- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs.xml +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs.xml @@ -76,6 +76,7 @@ my_preferred_subversion_user_name my_preferred_working_copy_list my_preferred_vcs_push_mode + my_preferred_version_up_submodule diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs/my_preferred_version_up_submodule.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs/my_preferred_version_up_submodule.xml new file mode 100644 index 00000000000..769c8ef5192 --- /dev/null +++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_vcs/Preference_viewVcs/my_preferred_version_up_submodule.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_preferred_version_up_submodule + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_checkbox + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Version Up Submodule Commit + + + + + + + + -- 2.30.9