Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ functions:
env:
KUBECONFIG: ${workdir}/kube_config

black_formatting_test:
- command: subprocess.exec
type: test
params:
working_dir: mongodb-kubernetes-operator
binary: scripts/ci/run_black_formatting_check.sh


run_e2e_test:
- command: subprocess.exec
type: test
Expand All @@ -110,13 +102,6 @@ functions:
- clusterwide
binary: scripts/ci/run_test.sh

mypy_linting_test:
- command: subprocess.exec
type: test
params:
working_dir: mongodb-kubernetes-operator
binary: scripts/ci/run_mypy_check.sh


build_and_push_image:
- command: subprocess.exec
Expand Down Expand Up @@ -212,19 +197,6 @@ tasks:
image_type: versionhook
expire_after: 48h

- name: black_formatting
commands:
- func: clone
- func: setup_virtualenv
- func: black_formatting_test

- name: mypy_linting
commands:
- func: clone
- func: setup_virtualenv
- func: mypy_linting_test


- name: e2e_test_feature_compatibility_version
commands:
- func: run_e2e_test
Expand Down Expand Up @@ -364,14 +336,6 @@ buildvariants:
tasks:
- name: e2e_test_group

- name: code_health
display_name: code_health
run_on:
- ubuntu1604-build
tasks:
- name: mypy_linting
- name: black_formatting

- name: init_test_run
display_name: init_test_run
run_on:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/code_health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code Health

on:
pull_request:
branches: [ master ]
jobs:
Black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Black Check
uses: jpetrucciani/black-check@20.8b1

Mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Mypy linting
uses: jpetrucciani/mypy-check@master
with:
path: scripts/*/*.py
8 changes: 8 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Global options:

[mypy]
python_version = 3.7
ignore_missing_imports = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
6 changes: 0 additions & 6 deletions scripts/ci/run_black_formatting_check.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/ci/run_mypy_check.sh

This file was deleted.

26 changes: 3 additions & 23 deletions scripts/dev/dockerfile_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,10 @@ def e2e_params(files_to_add: List[str]) -> DockerParameters:
}


def python_formatting_params(files_to_add: List[str], script: str) -> DockerParameters:
return {
"base_image": "python:slim",
"files_to_add": files_to_add,
"script_location": script,
}


def render(image_name: str, files_to_add: List[str], script_location: str) -> str:
def render(image_name: str, files_to_add: List[str]) -> str:
param_dict = {
"e2e": e2e_params(files_to_add),
"operator": operator_params(files_to_add),
"python_formatting": python_formatting_params(files_to_add, script_location),
}

render_values = param_dict.get(image_name, dict())
Expand All @@ -56,24 +47,13 @@ def parse_args() -> argparse.Namespace:
type=str,
default=".",
)
parser.add_argument(
"--script_location",
help="Location of the python script to run. (Used only for python_formatting)",
type=str,
)
args = parser.parse_args()

if args.script_location is not None and args.image != "python_formatting":
parser.error(
'The --script_location argument can be used only when the image used is "python_formatting"'
)

return args
return parser.parse_args()


def main() -> int:
args = parse_args()
print(render(args.image, args.files_to_add.split(os.linesep), args.script_location))
print(render(args.image, args.files_to_add.split(os.linesep)))
return 0


Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/dockerutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def build_and_push_image(repo_url: str, tag: str, path: str, image_type: str) ->
build_and_push_operator creates the Dockerfile for the operator
and pushes it to the target repo
"""
dockerfile_text = render(image_type, ["."], "")
dockerfile_text = render(image_type, ["."])
with open(f"{path}/Dockerfile", "w") as f:
f.write(dockerfile_text)

Expand Down