From 40be81e47c281c1b59b27cde1593635a147f1a6a Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 18 Oct 2020 16:31:54 +0200 Subject: [PATCH 1/6] Create analyze_port_trigger.py --- workflow-files/analyze_port_trigger.py | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 workflow-files/analyze_port_trigger.py diff --git a/workflow-files/analyze_port_trigger.py b/workflow-files/analyze_port_trigger.py new file mode 100644 index 0000000..96f7080 --- /dev/null +++ b/workflow-files/analyze_port_trigger.py @@ -0,0 +1,37 @@ +# Copyright 2020 IT Projects Labs +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os + +# TODO: rename analyze-modules.py file +import importlib +analyze_modules = importlib.import_module("analyze-modules") +set_github_var = analyze_modules.set_github_var + +# TODO: make a python package, say dinarlib, to use local imports +from oca_dependencies2configs import ODOO_VERSIONS, branch2version + +def get_prev_version(version): + return ODOO_VERSIONS[ODOO_VERSIONS.index(version) + 1] + +if __name__ == "__main__": + print(sys.argv) + title = sys.argv[1] + parts = title.split(" ") + branch = parts[1] + module = parts[2] + version = branch2version(branch) + from_version = get_prev_version(branch) + set_github_var("PORT_FROM_BRANCH", from_version) + set_github_var("PORT_TO_BRANCH", branch) + set_github_var("PORT_MODULE", module) From 1e91a3378c920131e488a80b988a2feb9b07e2c7 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 18 Oct 2020 17:05:03 +0200 Subject: [PATCH 2/6] Update analyze_port_trigger.py --- workflow-files/analyze_port_trigger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-files/analyze_port_trigger.py b/workflow-files/analyze_port_trigger.py index 96f7080..6a27308 100644 --- a/workflow-files/analyze_port_trigger.py +++ b/workflow-files/analyze_port_trigger.py @@ -19,7 +19,7 @@ set_github_var = analyze_modules.set_github_var # TODO: make a python package, say dinarlib, to use local imports -from oca_dependencies2configs import ODOO_VERSIONS, branch2version +from branch2odoo_version import ODOO_VERSIONS, branch2version def get_prev_version(version): return ODOO_VERSIONS[ODOO_VERSIONS.index(version) + 1] From 4d3295865e6a8a7b3d4dc00c4d055b0549269405 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 18 Oct 2020 17:06:01 +0200 Subject: [PATCH 3/6] Update analyze_port_trigger.py --- workflow-files/analyze_port_trigger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow-files/analyze_port_trigger.py b/workflow-files/analyze_port_trigger.py index 6a27308..f03a162 100644 --- a/workflow-files/analyze_port_trigger.py +++ b/workflow-files/analyze_port_trigger.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +import sys # TODO: rename analyze-modules.py file import importlib From 71597a03891f9abb836f90169c80a612a358e3ec Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 18 Oct 2020 17:50:31 +0200 Subject: [PATCH 4/6] Update analyze_port_trigger.py --- workflow-files/analyze_port_trigger.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/workflow-files/analyze_port_trigger.py b/workflow-files/analyze_port_trigger.py index f03a162..0046e1f 100644 --- a/workflow-files/analyze_port_trigger.py +++ b/workflow-files/analyze_port_trigger.py @@ -22,6 +22,19 @@ # TODO: make a python package, say dinarlib, to use local imports from branch2odoo_version import ODOO_VERSIONS, branch2version +TAGS = { + "1": "one", + "2": "two", + "3": "three", + "4": "four", + "5": "five", + "6": "six", + "7": "seven", + "8": "eight", + "9": "nine", + "0": "zero", +} + def get_prev_version(version): return ODOO_VERSIONS[ODOO_VERSIONS.index(version) + 1] @@ -33,6 +46,8 @@ def get_prev_version(version): module = parts[2] version = branch2version(branch) from_version = get_prev_version(branch) + branch_tags = ":{}::{}:".format(TAGS[version[0]], TAGS[version[1]]) set_github_var("PORT_FROM_BRANCH", from_version) set_github_var("PORT_TO_BRANCH", branch) + set_github_var("PORT_TO_BRANCH_TAGS", branch_tags) set_github_var("PORT_MODULE", module) From 4200244654be7866f92df8faec9f58024b49384e Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 18 Oct 2020 18:47:53 +0200 Subject: [PATCH 5/6] Update analyze_port_trigger.py --- workflow-files/analyze_port_trigger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflow-files/analyze_port_trigger.py b/workflow-files/analyze_port_trigger.py index 0046e1f..cdd7c0b 100644 --- a/workflow-files/analyze_port_trigger.py +++ b/workflow-files/analyze_port_trigger.py @@ -47,7 +47,9 @@ def get_prev_version(version): version = branch2version(branch) from_version = get_prev_version(branch) branch_tags = ":{}::{}:".format(TAGS[version[0]], TAGS[version[1]]) + from_branch_tags = ":{}::{}:".format(TAGS[from_version[0]], TAGS[from_version[1]]) set_github_var("PORT_FROM_BRANCH", from_version) set_github_var("PORT_TO_BRANCH", branch) set_github_var("PORT_TO_BRANCH_TAGS", branch_tags) + set_github_var("PORT_FROM_BRANCH_TAGS", from_branch_tags) set_github_var("PORT_MODULE", module) From ef2909b18b6915874e0768089352b75d16565a60 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 17 Nov 2020 14:23:32 +0500 Subject: [PATCH 6/6] handling disabled command --- static-files/all/.github/workflows/DINAR-pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static-files/all/.github/workflows/DINAR-pr.yml b/static-files/all/.github/workflows/DINAR-pr.yml index 019cf5d..21d6e7c 100644 --- a/static-files/all/.github/workflows/DINAR-pr.yml +++ b/static-files/all/.github/workflows/DINAR-pr.yml @@ -68,7 +68,7 @@ jobs: - name: Configure docker run: | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} - echo "::set-env name=PR_FILES::../../REPO" + echo "PR_FILES=../../REPO" >> $GITHUB_ENV - name: HOW TO RUN ODOO LOCALLY if: always() run: | @@ -113,7 +113,7 @@ jobs: - name: Configure docker run: | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} - echo "::set-env name=PR_FILES::../../REPO" + echo "PR_FILES=../../REPO" >> $GITHUB_ENV - name: Install python tools run: | pip install plumbum PyGithub pyyaml @@ -222,7 +222,7 @@ jobs: - name: Configure Docker run: | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} - echo "::set-env name=PR_FILES::../../REPO" + echo "PR_FILES=../../REPO" >> $GITHUB_ENV - name: Analyze PR run: | # sets environment variables that available in next steps via $ {{ env.PR_... }} notation