Skip to content

Commit

Permalink
Fix botched merge.
Browse files Browse the repository at this point in the history
This reverts commit fb9fdd4, reversing
changes made to 1049922.
  • Loading branch information
brainbot-devops committed Aug 22, 2019
1 parent ee421cd commit 6defa1a
Show file tree
Hide file tree
Showing 16 changed files with 476 additions and 86 deletions.
63 changes: 38 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ PR_branches_only: &PR_branches_only
ignore:
- /^\d+\.\d+.*/


################################################################################
# #
# Custom Executor definitions. #
Expand Down Expand Up @@ -68,6 +67,17 @@ commands:
# CI Setup Commands #
# ================= #

setup-job:
description: |
Attach the workspace and load ENV variables.
Additionally skips the job this is used in, if the commit message is invalid
(unless the workflow executing the job is running on "master" or "dev").
steps:
- attach_workspace:
at: "/home/circleci"
- export_env_vars
- skip_bad_commit_format

export_env_vars:
description: Export ENV variables used by our script.
steps:
Expand Down Expand Up @@ -114,12 +124,12 @@ commands:
make install-dev
validate_commit_format:
skip_bad_commit_format:
description: Validate the first line of the commit message against a REGEX.
steps:
- run:
name: Validate the commit's title description.
command: python3 ${CI_SCRIPTS_DIR}/validate-commit-message.py
command: python3 ${CI_SCRIPTS_DIR}/skip-on-bad-commit-message.py

# ================================== #
# Linter and test execution commands #
Expand Down Expand Up @@ -171,14 +181,6 @@ commands:

jobs:

validate-commit-message:
executor: default-executor
steps:
- attach_workspace:
at: "/home/circleci"
- export_env_vars
- validate_commit_format

prep-system:
executor: default-executor
steps:
Expand All @@ -192,11 +194,22 @@ jobs:

# Run all test suites (aka the test harness) of the repository and lint-check
# our code base.
test-harness:
executor: default-executor
steps:
- setup-job
- run_test_harness

style-check-and-lint:
executor: default-executor
steps:
- setup-job
- lint_codebase

lint-and-test:
executor: default-executor
steps:
- attach_workspace:
at: "/home/circleci"
- setup-job
- lint_codebase
- run_test_harness

Expand All @@ -205,9 +218,7 @@ jobs:
bump-versions:
executor: default-executor
steps:
- attach_workspace:
at: "/home/circleci"
- export_env_vars
- setup-job
- run:
name: Add Github to known hosts.
command: |
Expand All @@ -227,6 +238,8 @@ jobs:
executor: default-executor
steps:
- checkout
- export_env_vars
- skip_bad_commit_format
- run:
name: Publish to pypi using flit.
command: |
Expand Down Expand Up @@ -258,31 +271,32 @@ workflows:
- prep-system:
<<: *PR_branches_only

- lint-and-test:
- test-harness:
context: Raiden-SP-Context
requires:
- prep-system

- style-check-and-lint:
context: Raiden-SP-Context
requires:
- prep-system

- finalize:
requires:
- prep-system
- lint-and-test
- style-check-and-lint
- test-harness

Merge-Commit-Workflow:
jobs:
- prep-system:
<<: *master_dev_only

- validate-commit-message:
context: Raiden-SP-Context
requires:
- prep-system

# Run linters and test harnesses against PR branches.
- lint-and-test:
context: Raiden-SP-Context
requires:
- validate-commit-message
- prep-system

# Bump the minor or patch for `master` on each merge commit.
- bump-versions:
Expand All @@ -302,7 +316,6 @@ workflows:
- finalize:
requires:
- prep-system
- validate-commit-message
- lint-and-test
- bump-versions
- tear-down
Expand Down
7 changes: 7 additions & 0 deletions .circleci/scripts/skip-on-bad-commit-message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import subprocess
import os
try:
subprocess.run(f"python {os.environ['CI_SCRIPTS_DIR']}/validate-commit-message.py".split(), check=True)
except subprocess.SubprocessError:
# The commit message is bogus, so we skip the current step.
subprocess.run("circleci step halt".split())
4 changes: 4 additions & 0 deletions .circleci/scripts/validate-commit-message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
print(f"Validating commit message {COMMIT_MSG!r}")
print(f"Parsed commit type: {COMMIT_TYPE}")

if CURRENT_BRANCH not in ("master", "dev"):
# This workflow is executed on a PR - we skip validation for these.
exit(0)

if not COMMIT_TYPE:
# The commit message title does not comply with any of our regexes.
print("No commit type parsed - the commit message does not comply with the required pattern!")
Expand Down
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,13 @@
ARG PY_VERSION=3.7
FROM python:$PY_VERSION AS cache

# Clone raiden repo and switch to its `develop` branch
RUN git clone https://github.com/raiden-network/raiden /raiden
RUN git --git-dir /raiden/.git checkout develop

# Install raiden's development dependencies.
RUN pip install -r /raiden/requirements/requirements-dev.txt

# Install the raiden package
RUN pip install ./raiden
RUN pip install raiden

FROM python:${PY_VERSION}

ARG PY_VERSION

# Copy raiden repository and site-packages from build cache
COPY --from=cache /raiden /raiden
COPY --from=cache /usr/local/lib/python${PY_VERSION}/dist-packages /usr/local/lib/python${PY_VERSION}/dist-packages

# Copy SP folder and install.
Expand Down
19 changes: 13 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
.. image:: https://codecov.io/gh/raiden-network/scenario-player/branch/master/graph/badge.svg
:alt: Code Coverage
:target: https://codecov.io/gh/raiden-network/scenario-player

.. image:: https://circleci.com/gh/raiden-network/scenario-player.svg?style=shield
:alt: CI Status
:target: https://circleci.com/gh/raiden-network/scenario-player

.. image:: https://img.shields.io/docker/cloud/build/raidennetwork/scenario-player
:alt: Docker Cloud
:target: https://cloud.docker.com/u/raidennetwork/repository/docker/raidennetwork/scenario-player/general

.. image:: https://img.shields.io/github/tag-date/raiden-network/scenario-player?label=STABLE
:alt: Releases
:target: https://github.com/raiden-network/scenario-player/releases

.. image:: https://img.shields.io/github/license/raiden-network/scenario-player
:alt: License
:target: https>//github.com/raiden-network/scenario-player

.. image:: https://img.shields.io/github/issues-raw/raiden-network/scenario-player/bug?color=red&label=Open%20Bugs
:alt: Open Bugs
:target: https://github.com/raiden-network/scenario-player/issues?q=is%3Aissue+is%3Aopen+label%3Abug

.. image:: https://img.shields.io/github/issues-raw/raiden-network/scenario-player/Feature request?color=orange&label=Open%20Feature%20Requests
:target: https://github.com/raiden-network/scenario-player/issues?q=is%3Aissue+is%3Aopen+label%3A%22Feature+request%22

.. image:: https://img.shields.io/github/tag-date/raiden-network/scenario-player?label=STABLE

.. image:: https://img.shields.io/github/tag/raiden-network/scenario-player?label=LATEST

######################
Raiden Scenario Player
######################

Expand Down
4 changes: 3 additions & 1 deletion examples/scenario-example-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ nodes:
## Options to apply to all nodes
## Option names correspond to Raiden cli options without the leading double dash (`--`)
default_options:
## Sets Raiden config parameters.
gas-price: fast
# environment-type: development
#environment-type: development
#flat-fee: 10
#registry-contract-address: "0xbfa863Ac58a3E0A82B58a8e958F2752Bfb573388"
#discovery-contract-address: "0xb2646EB8270a4de7451f6F7b259FdE17DBCeedc9"
#secret-registry-contract-address: "0xA5c882f09c3DE551d76dcDE08890fAa0dD1F29E3"
Expand Down
8 changes: 8 additions & 0 deletions scenario_player/exceptions/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from scenario_player.exceptions import ScenarioError


class WrongPassword(ScenarioError):
"""
Generic Error that gets raised if eth_keystore raises ValueError("MAC mismatch")
Usually that's caused by an invalid password
"""
Loading

0 comments on commit 6defa1a

Please sign in to comment.