Skip to content

Commit 44a7a9e

Browse files
authored
Merge pull request #99 from ephur/refactor_rebase
more or less complete rewrite of application
2 parents 1eed445 + f7c661c commit 44a7a9e

File tree

110 files changed

+8837
-7744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+8837
-7744
lines changed

.circleci/config.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ __pycache__
99
htmlcov
1010
.pytest_cache
1111
registry.terraform.io/
12+
.scannerwork/
13+
coverage.xml
14+
reports/*

.isort.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[settings]
2-
known_third_party = atlassian,boto3,botocore,click,deepdiff,google,hcl2,jinja2,lark,mergedeep,moto,pydantic,pytest,yaml
2+
known_third_party = atlassian,boto3,botocore,click,google,hcl2,jinja2,lark,moto,packaging,pydantic,pydantic_core,pydantic_settings,pytest,yaml
33
profile = black
4+
skip = ["*/__init__.py"]

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changes 0.12.0 -> 0.13.0 (2024-06...)
2+
3+
## Notes
4+
This version reconsiders many of the core elements of the worker application.
5+
6+
The application now relies on pydantic to define the models for what is consumed from the configuration file and the command line. Previously there was a heinous mix of classes which just had attributes and methods seemingly hung on
7+
them at random. This was a nightmare to maintain and understand.
8+
9+
- the CopierFactory was reorganized to be more modular
10+
- providers became a package, with a model used to validation all provider configurations
11+
- all of the configuration file logic was moved into the `commands` module, the logic to handle managing the cofig is all contained there instead of being spread out many places
12+
- added tfworker.util.log to handle interaction with the user, via the CLI or via a logger in the future
13+
- made significant strides towards consolidating all exceptions / error handling
14+
- made significant strides in only having the primary cli.py and commands/ actually cause the program to terminate
15+
- validation of options and inputs is now handled centrally in the pydantic models instead of being spread out *everywhere*
16+
17+
18+
- ... @TODO find time to update this :)

Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
init:
22
poetry install
33

4+
init-dev:
5+
poetry install --with dev
6+
47
default: lint test
58

6-
lint: init
9+
lint: init-dev
710
poetry run flake8 --ignore E501,W503 tfworker tests
811

9-
format: init
12+
format: init-dev
1013
poetry run black tfworker tests
11-
poetry run seed-isort-config || echo "known_third_party setting changed. Please commit pyproject.toml"
14+
@poetry run seed-isort-config || echo "known_third_party setting changed. Please commit pyproject.toml"
1215
poetry run isort tfworker tests
1316

14-
test: init
17+
test: init-dev
1518
poetry run pytest -p no:warnings --disable-socket
1619
poetry run coverage report --fail-under=60 -m --skip-empty
1720

18-
dep-test: init
21+
ci-test: init-dev
22+
poetry run pytest --disable-socket --junitxml=reports/junit.xml
23+
poetry run coverage xml -o reports/coverage.xml
24+
25+
dep-test: init-dev
1926
poetry run pytest --disable-socket
2027
poetry run coverage report --fail-under=60 -m --skip-empty
2128

poetry.lock

Lines changed: 269 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ classifiers = [
2828

2929
[tool.poetry.dependencies]
3030
python = "^3.11"
31+
atlassian-python-api = "^3.41"
3132
boto3 = "^1.34"
3233
click = "^8.1"
33-
jinja2 = "^3.1"
3434
google-cloud-storage = "^2.17"
35+
jinja2 = "^3.1"
36+
mergedeep = "^1.3"
37+
pydantic = "^2.7"
3538
python-hcl2 = "^4.3"
3639
pyyaml = "^6.0"
37-
mergedeep = "^1.3"
3840
setuptools = "^70.0"
39-
atlassian-python-api = "^3.41"
40-
pydantic = "^2.7"
41+
pydantic-settings = "^2.3.4"
42+
packaging = "^24.1"
4143

4244
[tool.poetry.scripts]
4345
worker = 'tfworker.cli:cli'
@@ -46,24 +48,29 @@ worker = 'tfworker.cli:cli'
4648
optional = true
4749

4850
[tool.poetry.group.dev.dependencies]
49-
pytest-timeout = "2.3.1"
50-
ipython = "^8.24"
51-
pytest = "^8.2"
5251
black = "^24.4"
53-
isort = "^5.13"
54-
seed-isort-config = "^2.2"
52+
coverage = "^7.5"
53+
deepdiff = "^7.0"
5554
flake8 = "^7.0"
56-
wheel = "^0.43"
55+
ipython = "^8.24"
56+
isort = "^5.13"
57+
pytest = "^8.2"
58+
pytest-cov = "^5.0"
5759
pytest-depends = "^1.0"
60+
pytest-mock = "^3.14"
5861
pytest-socket = "^0.7"
59-
coverage = "^7.5"
60-
pytest-cov = "^5.0"
61-
moto = {extras = ["sts","dynamodb", "s3"], version = "^5.0"}
62-
deepdiff = "^7.0"
62+
pytest-timeout = "2.3.1"
63+
seed-isort-config = "^2.2"
6364
Sphinx = "^7.3"
65+
wheel = "^0.43"
66+
moto = {version = "^5.0.10", extras = ["sts", "dynamodb", "s3"]}
67+
6468

6569
[tool.pytest.ini_options]
66-
addopts = "--capture=sys --cov=tfworker --cov-report="
70+
addopts = "--capture=sys --cov=tfworker --cov-report= -m 'not performance'"
71+
markers = [
72+
"performance: mark a test as a performance test"
73+
]
6774

6875
[build-system]
6976
requires = ["poetry>=0.12"]

tests/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
# Copyright 2020 Richard Maynard ([email protected])
21
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.

0 commit comments

Comments
 (0)