From af2c2d4bb4ce0b9741ac9f21da1981c5901632b5 Mon Sep 17 00:00:00 2001 From: Sergey Klyuykov Date: Sat, 28 Sep 2019 19:23:44 +1000 Subject: [PATCH 01/17] Fix `.dep` to `.deb` in config.rst --- doc/config.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 65311a81..164043a0 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -367,9 +367,9 @@ Installation of additional packages to Polemarch ------------------------------------------------ .. warning:: - .rpm or .dep installation methods are depracated. + .rpm or .deb installation methods are depracated. -If you want to install some additional package to Polemarch from .rpm or .dep, +If you want to install some additional package to Polemarch from .rpm or .deb, you should run next command: .. sourcecode:: bash From 035917317f261124ff2d881b7ab06914838d9d83 Mon Sep 17 00:00:00 2001 From: Sergey Klyuykov Date: Thu, 3 Oct 2019 16:58:00 +1000 Subject: [PATCH 02/17] Update vstutils version and fix capability in settings. --- polemarch/main/settings.py | 113 ++++++++++++++++++++++--------------- requirements-doc.txt | 2 +- requirements.txt | 2 +- 3 files changed, 68 insertions(+), 49 deletions(-) diff --git a/polemarch/main/settings.py b/polemarch/main/settings.py index 7eebf4c7..33a83d97 100644 --- a/polemarch/main/settings.py +++ b/polemarch/main/settings.py @@ -146,52 +146,73 @@ # Polemarch handlers # Repos -class GitSectionConfig(SectionConfig): - section = 'git' - subsections = ['clone', 'fetch'] - section_defaults = { - 'fetch': { - "force": True, - } +class GitSection(BaseAppendSection): + pass + + +class GitFetchSection(GitSection): + types_map = { + 'all': cconfig.BoolType(), + 'append': cconfig.BoolType(), + 'multiple': cconfig.BoolType(), + 'unshallow': cconfig.BoolType(), + 'update-shallow': cconfig.BoolType(), + 'force': cconfig.BoolType(), + 'keep': cconfig.BoolType(), + 'prune': cconfig.BoolType(), + 'prune-tags': cconfig.BoolType(), + 'no-tags': cconfig.BoolType(), + 'tags': cconfig.BoolType(), + 'no-recurse-submodules': cconfig.BoolType(), + 'update-head-ok': cconfig.BoolType(), + 'quiet': cconfig.BoolType(), + 'verbose': cconfig.BoolType(), + 'ipv4': cconfig.BoolType(), + 'ipv6': cconfig.BoolType(), + 'depth': cconfig.IntType(), + 'deepen': cconfig.IntType(), + 'jobs': cconfig.IntType(), } + + def all(self): + data = super().all() + data['force'] = True + return data + + +class GitCloneSection(GitSection): types_map = { - 'fetch.all': SectionConfig.bool, - 'fetch.append': SectionConfig.bool, - 'fetch.multiple': SectionConfig.bool, - 'fetch.unshallow': SectionConfig.bool, - 'fetch.update-shallow': SectionConfig.bool, - 'fetch.force': SectionConfig.bool, - 'fetch.keep': SectionConfig.bool, - 'fetch.prune': SectionConfig.bool, - 'fetch.prune-tags': SectionConfig.bool, - 'fetch.no-tags': SectionConfig.bool, - 'fetch.tags': SectionConfig.bool, - 'fetch.no-recurse-submodules': SectionConfig.bool, - 'fetch.update-head-ok': SectionConfig.bool, - 'fetch.quiet': SectionConfig.bool, - 'fetch.verbose': SectionConfig.bool, - 'fetch.ipv4': SectionConfig.bool, - 'fetch.ipv6': SectionConfig.bool, - 'fetch.depth': SectionConfig.int, - 'fetch.deepen': SectionConfig.int, - 'fetch.jobs': SectionConfig.int, - 'clone.local': SectionConfig.bool, - 'clone.no-hardlinks': SectionConfig.bool, - 'clone.shared': SectionConfig.bool, - 'clone.dissociate': SectionConfig.bool, - 'clone.quiet': SectionConfig.bool, - 'clone.verbose': SectionConfig.bool, - 'clone.single-branch': SectionConfig.bool, - 'clone.no-single-branch': SectionConfig.bool, - 'clone.no-tags': SectionConfig.bool, - 'clone.shallow-submodules': SectionConfig.bool, - 'clone.no-shallow-submodules': SectionConfig.bool, - 'clone.depth': SectionConfig.int, - 'clone.jobs': SectionConfig.int, + 'local': cconfig.BoolType(), + 'no-hardlinks': cconfig.BoolType(), + 'shared': cconfig.BoolType(), + 'dissociate': cconfig.BoolType(), + 'quiet': cconfig.BoolType(), + 'verbose': cconfig.BoolType(), + 'single-branch': cconfig.BoolType(), + 'no-single-branch': cconfig.BoolType(), + 'no-tags': cconfig.BoolType(), + 'shallow-submodules': cconfig.BoolType(), + 'no-shallow-submodules': cconfig.BoolType(), + 'depth': cconfig.IntType(), + 'jobs': cconfig.IntType(), } -git = GitSectionConfig() +git_fetch = {} +git_clone = {} + +if TESTS_RUN: + config['git'] = dict(fetch=dict(), clone=dict()) + +if 'git' in config: + git = config['git'] + + if 'fetch' in git: + git_fetch = GitFetchSection('git.fetch', config, git['fetch']).all() + + if 'clone' in git: + git_clone = GitCloneSection('git.clone', config, git['clone']).all() + REPO_BACKENDS = { "MANUAL": { @@ -200,8 +221,8 @@ class GitSectionConfig(SectionConfig): "GIT": { "BACKEND": "{}.main.repo.Git".format(VST_PROJECT_LIB_NAME), "OPTIONS": { - "CLONE_KWARGS": git.get('CLONE', {}), - "FETCH_KWARGS": git.get('FETCH', {}), + "CLONE_KWARGS": git_clone, + "FETCH_KWARGS": git_fetch, "GIT_ENV": { "GLOBAL": { "GIT_SSL_NO_VERIFY": "true" @@ -259,10 +280,8 @@ class GitSectionConfig(SectionConfig): EXECUTOR = main.get("executor_path", fallback=__EXECUTOR_DEFAULT).strip().split(' ') SELFCARE = '/tmp/' -MANUAL_PROJECT_VARS = SectionConfig( - 'project_manual_vars', - dict(forks=4, timeout=30, fact_caching_timeout=3600, poll_interval=5) -).all() +MANUAL_PROJECT_VARS = config['project_manual_vars'].all() or \ + dict(forks=4, timeout=30, fact_caching_timeout=3600, poll_interval=5) PROJECT_REPOSYNC_WAIT_SECONDS = main.getseconds('repo_sync_on_run_timeout', fallback='1:00') PROJECT_CI_HANDLER_CLASS = "{}.main.ci.DefaultHandler".format(VST_PROJECT_LIB_NAME) diff --git a/requirements-doc.txt b/requirements-doc.txt index bdb227de..51d34a0c 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -1,2 +1,2 @@ # Docs -vstutils[doc]~=2.8.2 +vstutils[doc]~=2.9.1 diff --git a/requirements.txt b/requirements.txt index 0045d8d6..ec0c1067 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Main -vstutils[rpc,ldap,doc,prod]~=2.8.2 +vstutils[rpc,ldap,doc,prod]~=2.9.1 docutils==0.15.2 markdown2==2.3.8 From 29696868de9a02f6621bcc506a378630fae2ae7a Mon Sep 17 00:00:00 2001 From: Sergey Klyuykov Date: Thu, 3 Oct 2019 16:58:20 +1000 Subject: [PATCH 03/17] Update vstutils version and fix capability in settings. --- polemarch/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polemarch/__init__.py b/polemarch/__init__.py index 81ad951e..bfc792d5 100644 --- a/polemarch/__init__.py +++ b/polemarch/__init__.py @@ -31,6 +31,6 @@ "VST_ROOT_URLCONF": os.getenv("VST_ROOT_URLCONF", 'vstutils.urls'), } -__version__ = "1.4.4" +__version__ = "1.4.5" prepare_environment(**default_settings) From 67d380c9008a60adb6fb7f9f2e4a44690bb9dd78 Mon Sep 17 00:00:00 2001 From: Sergey Klyuykov Date: Thu, 3 Oct 2019 17:15:04 +1000 Subject: [PATCH 04/17] Fix pylint --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 665cb8aa..28e27305 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,deprecated-lambda,old-style-class,no-init,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,bad-continuation,bad-whitespace,redefined-builtin,missing-docstring,redefined-variable-type,no-self-use,line-too-long,suppressed-message,cmp-method,no-absolute-import,xrange-builtin,using-cmp-argument,basestring-builtin,backtick,unpacking-in-except,old-raise-syntax,getslice-method,long-builtin,print-statement,reduce-builtin,filter-builtin-not-iterating,import-star-module-level,unichr-builtin,dict-iter-method,range-builtin-not-iterating,file-builtin,old-division,standarderror-builtin,coerce-builtin,setslice-method,old-ne-operator,long-suffix,execfile-builtin,oct-method,metaclass-assignment,intern-builtin,apply-builtin,dict-view-method,raw_input-builtin,raising-string,coerce-method,unicode-builtin,next-method-called,hex-method,nonzero-method,round-builtin,cmp-builtin,reload-builtin,buffer-builtin,useless-suppression,zip-builtin-not-iterating,indexing-exception,map-builtin-not-iterating,delslice-method,old-octal-literal,input-builtin,parameter-unpacking,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance +disable=unexpected-keyword-arg,no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,deprecated-lambda,old-style-class,no-init,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,bad-continuation,bad-whitespace,redefined-builtin,missing-docstring,redefined-variable-type,no-self-use,line-too-long,suppressed-message,cmp-method,no-absolute-import,xrange-builtin,using-cmp-argument,basestring-builtin,backtick,unpacking-in-except,old-raise-syntax,getslice-method,long-builtin,print-statement,reduce-builtin,filter-builtin-not-iterating,import-star-module-level,unichr-builtin,dict-iter-method,range-builtin-not-iterating,file-builtin,old-division,standarderror-builtin,coerce-builtin,setslice-method,old-ne-operator,long-suffix,execfile-builtin,oct-method,metaclass-assignment,intern-builtin,apply-builtin,dict-view-method,raw_input-builtin,raising-string,coerce-method,unicode-builtin,next-method-called,hex-method,nonzero-method,round-builtin,cmp-builtin,reload-builtin,buffer-builtin,useless-suppression,zip-builtin-not-iterating,indexing-exception,map-builtin-not-iterating,delslice-method,old-octal-literal,input-builtin,parameter-unpacking,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance [REPORTS] From fb9e48365341c543a7aaf13b0eaaab905dfa5a79 Mon Sep 17 00:00:00 2001 From: Akhmadullin Roman Date: Fri, 18 Oct 2019 17:22:54 +1000 Subject: [PATCH 05/17] Update buttons representation. polemarch/ce#228 --- polemarch/__init__.py | 2 +- polemarch/static/css/polemarch-gui.css | 4 +++ polemarch/static/js/pmProjects.js | 2 +- polemarch/static/templates/pmHistory.html | 32 +++++++++------------- polemarch/static/templates/pmProjects.html | 16 +++++------ requirements-doc.txt | 2 +- requirements.txt | 2 +- 7 files changed, 28 insertions(+), 32 deletions(-) diff --git a/polemarch/__init__.py b/polemarch/__init__.py index bfc792d5..3ef8e409 100644 --- a/polemarch/__init__.py +++ b/polemarch/__init__.py @@ -31,6 +31,6 @@ "VST_ROOT_URLCONF": os.getenv("VST_ROOT_URLCONF", 'vstutils.urls'), } -__version__ = "1.4.5" +__version__ = "1.4.6" prepare_environment(**default_settings) diff --git a/polemarch/static/css/polemarch-gui.css b/polemarch/static/css/polemarch-gui.css index 8d24e156..4301c824 100644 --- a/polemarch/static/css/polemarch-gui.css +++ b/polemarch/static/css/polemarch-gui.css @@ -385,4 +385,8 @@ body { .clear-btn-title { display: none; +} + +.details .form-group { + margin-bottom: 0; } \ No newline at end of file diff --git a/polemarch/static/js/pmProjects.js b/polemarch/static/js/pmProjects.js index 46eec49a..f6fab01e 100644 --- a/polemarch/static/js/pmProjects.js +++ b/polemarch/static/js/pmProjects.js @@ -223,7 +223,7 @@ const gui_project_page_additional = Vue.component('gui_project_page_additional', let buttons = {}; for(let key in data.playbooks) { - if(data.playbook.hasOwnProperty(key)) { + if(data.playbooks.hasOwnProperty(key)) { let val = data.playbooks[key]; buttons[key] = { diff --git a/polemarch/static/templates/pmHistory.html b/polemarch/static/templates/pmHistory.html index d5af4247..489348ca 100644 --- a/polemarch/static/templates/pmHistory.html +++ b/polemarch/static/templates/pmHistory.html @@ -8,13 +8,13 @@ -
+

- + Error {{ error.status }} @@ -32,18 +32,12 @@

-
-
-
-
-
-
-
- {{ error_data }} -
+
+
+

{{ error_data }}

-
+
@@ -55,7 +49,7 @@

- + {{ title | capitalize | split }} @@ -80,7 +74,7 @@

-
+
-
+
-
+
Execution output @@ -126,7 +120,7 @@

-
+
@@ -145,7 +139,7 @@

-
+
Details
-
+
diff --git a/polemarch/static/templates/pmProjects.html b/polemarch/static/templates/pmProjects.html index 46b4b01d..88a950ae 100644 --- a/polemarch/static/templates/pmProjects.html +++ b/polemarch/static/templates/pmProjects.html @@ -1,18 +1,16 @@