Skip to content

Commit

Permalink
Universum 0.19.5
Browse files Browse the repository at this point in the history
  • Loading branch information
k-dovgan committed Apr 21, 2021
2 parents 4a1140b + 5b28707 commit 5a9f5a1
Show file tree
Hide file tree
Showing 18 changed files with 405 additions and 279 deletions.
11 changes: 4 additions & 7 deletions .universum.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def pip_install(module_name):
return "python -m pip --default-timeout=1200 install --progress-bar off -U " + module_name


configs = Variations([dict(name="Update Pylint", command=[python, "-m", "pip", "install",
"-U", "--user", "--progress-bar", "off", "pylint"]),
dict(name="Create virtual environment", command=[python, "-m", "venv", env_name]),
configs = Variations([dict(name="Create virtual environment", command=[python, "-m", "venv", env_name]),
dict(name="Update Docker images", command=run_virtual("make images")),

dict(name="Install Universum for tests", artifacts="junit_results.xml",
Expand All @@ -30,10 +28,9 @@ def pip_install(module_name):
command=run_virtual("export LANG=en_US.UTF-8; make test")),

dict(name="Run static pylint", code_report=True,
command=[python, "-m", "universum.analyzers.pylint",
f"--python-version={python_version}",
"--rcfile=pylintrc", "--result-file=${CODE_REPORT_FILE}",
"--files", "*.py", "universum/", "tests/"]),
command=run_virtual(f"{python} -m universum.analyzers.pylint "
f"--python-version={python_version} --rcfile=pylintrc "
"--result-file=\"${CODE_REPORT_FILE}\" --files *.py universum/ tests/")),
dict(name="Run static type checker", code_report=True,
command=run_virtual("make mypy")),

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change log
==========

0.19.5 (2021-04-20)
-------------------

Bug fixes
~~~~~~~~~

* **p4:** HOTFIX for newly introduced bug of Perforce server unexpectedly failing the ``p4 opened`` command


0.19.4 (2021-03-29)
-------------------

Expand Down
3 changes: 2 additions & 1 deletion doc/_ext/collapsible/collapsible.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CollapsibleNode(nodes.General, nodes.Element):

def visit_collapsible_node(self, node):
self.body.append(f"""
<div class="collapsible section">
<input type="checkbox" id="{node["id"]}" class="hide">
<label for="{node["id"]}"><span class="collapser">&#x276f;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{node["header"]}</label>
<div>
Expand All @@ -22,7 +23,7 @@ def visit_collapsible_node(self, node):

def depart_collapsible_node(self, node):
self.body.append("""
</div>
</div></div>
""")


Expand Down
6 changes: 4 additions & 2 deletions doc/_ext/collapsible/css/collapsible_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@
padding: 0.5em 0.5em;
background: #eaeaea;
user-select: none;
margin-bottom: 1em;
}
.hide:checked + label + div {
display: block;
}
.hide:checked + label {
margin-bottom: 0;
}

.hide + label .collapser {
position: absolute;
padding: 0.3em 0.3em 0.3em 0.3em;
font-size: 0.7em;
transform: rotate(90deg);
transition: transform 0.1s;
}
.hide:checked + label .collapser {
position: absolute;
padding: 0.3em 0.3em 0.3em 0.3em;
font-size: 0.7em;
transform: rotate(90deg) scaleX(-1);
transition: transform 0.1s;
}
}

4 changes: 4 additions & 0 deletions doc/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
.option {
width: 1px !important;
}

.class dt {
padding-left: 0.3em;
}
}

182 changes: 94 additions & 88 deletions doc/github_handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,107 +100,113 @@ The list of GitHub Handler parameters can be found :ref:`here <additional_comman
Jenkins jobs example
--------------------

Here's DSL script for GitHub Handler::

pipelineJob('GitHub Webhook handler') {
triggers {
genericTrigger {
genericVariables {
genericVariable {
key("GITHUB_PAYLOAD")
value("\$")
.. collapsible::
:header: Here's DSL script for GitHub Handler

.. code-block::
pipelineJob('GitHub Webhook handler') {
triggers {
genericTrigger {
genericVariables {
genericVariable {
key("GITHUB_PAYLOAD")
value("\$")
}
}
genericHeaderVariables {
genericHeaderVariable {
key("x-github-event")
regexpFilter("")
}
}
causeString('Event "\^${x_github_event}", action "\^${GITHUB_PAYLOAD_action}"')
token('UniversumGitHub')
printContributedVariables(false)
printPostContent(false)
silentResponse(false)
regexpFilterText("")
regexpFilterExpression("")
}
}
genericHeaderVariables {
genericHeaderVariable {
key("x-github-event")
regexpFilter("")
}
parameters {
stringParam("GITHUB_APP_ID", "1234", "")
stringParam("TRIGGER_URL", "https://my.jenkins-server.com/buildByToken/buildWithParameters?job=Check%20commit&token=GITHUB", "")
}
causeString('Event "\^${x_github_event}", action "\^${GITHUB_PAYLOAD_action}"')
token('UniversumGitHub')
printContributedVariables(false)
printPostContent(false)
silentResponse(false)
regexpFilterText("")
regexpFilterExpression("")
}
}
parameters {
stringParam("GITHUB_APP_ID", "1234", "")
stringParam("TRIGGER_URL", "https://my.jenkins-server.com/buildByToken/buildWithParameters?job=Check%20commit&token=GITHUB", "")
}
definition {
cps {
script("""\
pipeline {
agent any
environment {
KEY_FILE = credentials('github-private-key')
GITHUB_PRIVATE_KEY = "@\^${KEY_FILE}"
}
stages {
stage ('Run GitHub Handler') {
steps {
ansiColor('xterm') {
sh("{python} -m universum github-handler -e \^${x_github_event}")
definition {
cps {
script("""\
pipeline {
agent any
environment {
KEY_FILE = credentials('github-private-key')
GITHUB_PRIVATE_KEY = "@\^${KEY_FILE}"
}
stages {
stage ('Run GitHub Handler') {
steps {
ansiColor('xterm') {
sh("{python} -m universum github-handler -e \^${x_github_event}")
}
}
}
}
}
}
""".stripIndent())
sandbox()
}
""".stripIndent())
sandbox()
}
}
}
}

And here's DSL script for the job it triggers::

pipelineJob('Check commit') {
authenticationToken("GITHUB")
parameters {
stringParam("GIT_REPO", "", "")
stringParam("GITHUB_APP_ID", "1234", "")
stringParam("GIT_REFSPEC", "", "")
stringParam("GIT_CHECKOUT_ID", "", "")
stringParam("GITHUB_INSTALLATION_ID", "", "")
stringParam("GITHUB_CHECK_ID", "", "")
stringParam("CONFIG_PATH", ".universum.py", "")
}
definition {
cps {
script("""\
pipeline {
agent any
environment {
KEY_FILE = credentials('github-private-key')
GITHUB_PRIVATE_KEY = "@\^${KEY_FILE}"
}
stages {
stage ('test') {
steps {
cleanWs()
ansiColor('xterm') {
sh "{python} -m universum --no-diff -vt github --report-to-review -rst -rsu -rof"
.. collapsible::
:header: And here's DSL script for the job it triggers

.. code-block::
pipelineJob('Check commit') {
authenticationToken("GITHUB")
parameters {
stringParam("GIT_REPO", "", "")
stringParam("GITHUB_APP_ID", "1234", "")
stringParam("GIT_REFSPEC", "", "")
stringParam("GIT_CHECKOUT_ID", "", "")
stringParam("GITHUB_INSTALLATION_ID", "", "")
stringParam("GITHUB_CHECK_ID", "", "")
stringParam("CONFIG_PATH", ".universum.py", "")
}
definition {
cps {
script("""\
pipeline {
agent any
environment {
KEY_FILE = credentials('github-private-key')
GITHUB_PRIVATE_KEY = "@\^${KEY_FILE}"
}
stages {
stage ('test') {
steps {
cleanWs()
ansiColor('xterm') {
sh "{python} -m universum --no-diff -vt github --report-to-review -rst -rsu -rof"
}
junit '**/junit_results.xml'
junit '**/TEST*.xml'
}
}
junit '**/junit_results.xml'
junit '**/TEST*.xml'
}
post {
always {
archiveArtifacts 'artifacts/*'
cleanWs()
}
}
}
}
post {
always {
archiveArtifacts 'artifacts/*'
cleanWs()
}
}
""".stripIndent())
sandbox()
}
""".stripIndent())
sandbox()
}
}
}
}
.. note::

Expand Down
Loading

0 comments on commit 5a9f5a1

Please sign in to comment.