Review TODOs
This commit is contained in:
parent
381baa2eb2
commit
223ba498d3
4 changed files with 9 additions and 7 deletions
|
@ -14,7 +14,7 @@ flake8:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
script:
|
script:
|
||||||
- pip install -r dev_requirements.txt
|
- pip install -r dev_requirements.txt
|
||||||
- flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics src/main/python/ddadevops/*.py
|
- flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics src/main/python/ddadevops/*.py # TODO: change target
|
||||||
- flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics src/main/python/ddadevops/*.py
|
- flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics src/main/python/ddadevops/*.py
|
||||||
|
|
||||||
mypy:
|
mypy:
|
||||||
|
@ -27,7 +27,7 @@ pylint:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
script:
|
script:
|
||||||
- pip install -r dev_requirements.txt
|
- pip install -r dev_requirements.txt
|
||||||
- pylint -d C0301,W0614,C0114,C0115,C0116,similarities,W0702,W0702,R0913,R0902,R0914,R1732 src/
|
- pylint -d C0301,W0614,C0114,C0115,C0116,similarities,W0702,W0702,R0913,R0902,R0914,R1732 src/ # TODO: narrower focus on target
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
stage: lint&test
|
stage: lint&test
|
||||||
|
|
|
@ -6,7 +6,7 @@ class PrepareReleaseService():
|
||||||
|
|
||||||
def __init__(self, release_repo: ReleaseRepository):
|
def __init__(self, release_repo: ReleaseRepository):
|
||||||
self.release_repo = release_repo
|
self.release_repo = release_repo
|
||||||
self.release = release_repo.get_release()
|
self.release = release_repo.get_release() # TODO: make stateless: argument to receiving func
|
||||||
self.git_api = GitApi()
|
self.git_api = GitApi()
|
||||||
|
|
||||||
def __write_and_commit_version(self, version: Version, commit_message: str):
|
def __write_and_commit_version(self, version: Version, commit_message: str):
|
||||||
|
@ -27,7 +27,7 @@ class TagAndPushReleaseService():
|
||||||
def __init__(self, git_api: GitApi, release_repo: ReleaseRepository):
|
def __init__(self, git_api: GitApi, release_repo: ReleaseRepository):
|
||||||
self.git_api = git_api
|
self.git_api = git_api
|
||||||
self.release_repo = release_repo
|
self.release_repo = release_repo
|
||||||
self.release = release_repo.get_release()
|
self.release = release_repo.get_release() # TODO: make stateless: argument to receiving func
|
||||||
|
|
||||||
def tag_release(self):
|
def tag_release(self):
|
||||||
annotation = 'v' + self.release.version.get_version_string()
|
annotation = 'v' + self.release.version.get_version_string()
|
||||||
|
|
|
@ -97,4 +97,4 @@ class Release():
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def is_valid(self, main_branch):
|
def is_valid(self, main_branch):
|
||||||
return len(self.validate(main_branch)) < 1
|
return len(self.validate(main_branch)) < 1 # TODO: Use abstract is_valid in Validatable
|
||||||
|
|
|
@ -5,6 +5,7 @@ from src.main.python.ddadevops.infrastructure.release_mixin import ReleaseReposi
|
||||||
from src.main.python.ddadevops.application import PrepareReleaseService, TagAndPushReleaseService
|
from src.main.python.ddadevops.application import PrepareReleaseService, TagAndPushReleaseService
|
||||||
from src.main.python.ddadevops.domain import ReleaseConfig, EnvironmentKeys
|
from src.main.python.ddadevops.domain import ReleaseConfig, EnvironmentKeys
|
||||||
|
|
||||||
|
# TODO: remove the config creation
|
||||||
def create_release_mixin_config(config_file, main_branch) -> dict:
|
def create_release_mixin_config(config_file, main_branch) -> dict:
|
||||||
config = {}
|
config = {}
|
||||||
config.update(
|
config.update(
|
||||||
|
@ -12,13 +13,14 @@ def create_release_mixin_config(config_file, main_branch) -> dict:
|
||||||
{'main_branch': main_branch,
|
{'main_branch': main_branch,
|
||||||
'config_file': config_file}})
|
'config_file': config_file}})
|
||||||
return config
|
return config
|
||||||
|
# TODO: remove the config creation
|
||||||
def add_versions(config, release_version, bump_version) -> dict:
|
def add_versions(config, release_version, bump_version) -> dict:
|
||||||
config['ReleaseMixin'].update(
|
config['ReleaseMixin'].update(
|
||||||
{'release_version': release_version,
|
{'release_version': release_version,
|
||||||
'bump_version': bump_version})
|
'bump_version': bump_version})
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
# TODO: remove the config argument
|
||||||
class ReleaseMixin(DevopsBuild):
|
class ReleaseMixin(DevopsBuild):
|
||||||
def __init__(self, project: Project, config: Optional[dict] = None, release_config: Optional[ReleaseConfig] = None):
|
def __init__(self, project: Project, config: Optional[dict] = None, release_config: Optional[ReleaseConfig] = None):
|
||||||
if not release_config:
|
if not release_config:
|
||||||
|
|
Loading…
Reference in a new issue