atlas-init 0.3.5__py3-none-any.whl → 0.3.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atlas_init/__init__.py +1 -1
- atlas_init/cli_tf/debug_logs_test_data_package_config.py +7 -0
- atlas_init/cli_tf/mock_tf_log.py +15 -2
- {atlas_init-0.3.5.dist-info → atlas_init-0.3.6.dist-info}/METADATA +1 -1
- {atlas_init-0.3.5.dist-info → atlas_init-0.3.6.dist-info}/RECORD +7 -7
- {atlas_init-0.3.5.dist-info → atlas_init-0.3.6.dist-info}/WHEEL +0 -0
- {atlas_init-0.3.5.dist-info → atlas_init-0.3.6.dist-info}/entry_points.txt +0 -0
atlas_init/__init__.py
CHANGED
@@ -46,3 +46,10 @@ def package_skip_suffixes(pkg_name: str) -> list[str]:
|
|
46
46
|
if pkg_name == "resourcepolicy":
|
47
47
|
return [":validate"]
|
48
48
|
return []
|
49
|
+
|
50
|
+
|
51
|
+
def package_must_substrings(pkg_name: str) -> list[str]:
|
52
|
+
# sourcery skip: assign-if-exp, reintroduce-else
|
53
|
+
if pkg_name == "advancedcluster":
|
54
|
+
return ["/clusters"]
|
55
|
+
return []
|
atlas_init/cli_tf/mock_tf_log.py
CHANGED
@@ -23,7 +23,11 @@ from atlas_init.cli_tf.debug_logs_test_data import (
|
|
23
23
|
create_mock_data,
|
24
24
|
default_is_diff,
|
25
25
|
)
|
26
|
-
from atlas_init.cli_tf.debug_logs_test_data_package_config import
|
26
|
+
from atlas_init.cli_tf.debug_logs_test_data_package_config import (
|
27
|
+
package_modifiers,
|
28
|
+
package_must_substrings,
|
29
|
+
package_skip_suffixes,
|
30
|
+
)
|
27
31
|
from atlas_init.repos.go_sdk import (
|
28
32
|
api_spec_path_transformed,
|
29
33
|
download_admin_api,
|
@@ -39,6 +43,7 @@ class MockTFLog(Entity):
|
|
39
43
|
output_dir: Path
|
40
44
|
admin_api_path: Path
|
41
45
|
diff_skip_suffixes: list[str] = Field(default_factory=list)
|
46
|
+
diff_must_substrings: list[str] = Field(default_factory=list)
|
42
47
|
keep_duplicates: bool = False
|
43
48
|
modifiers: list[RTModifier] = Field(default_factory=list)
|
44
49
|
package_name: str = ""
|
@@ -57,10 +62,16 @@ class MockTFLog(Entity):
|
|
57
62
|
if (package_name := self.package_name) and not self.skip_default_package_config:
|
58
63
|
self.modifiers.extend(package_modifiers(package_name))
|
59
64
|
self.diff_skip_suffixes.extend(package_skip_suffixes(package_name))
|
65
|
+
self.diff_must_substrings.extend(package_must_substrings(package_name))
|
60
66
|
return self
|
61
67
|
|
62
68
|
def differ(self, rt: SDKRoundtrip) -> bool:
|
63
|
-
|
69
|
+
is_diff = default_is_diff(rt) and not any(
|
70
|
+
rt.request.path.endswith(suffix) for suffix in self.diff_skip_suffixes
|
71
|
+
)
|
72
|
+
if is_diff and self.diff_must_substrings:
|
73
|
+
return is_diff and all(substring in rt.request.path for substring in self.diff_must_substrings)
|
74
|
+
return is_diff
|
64
75
|
|
65
76
|
|
66
77
|
def mock_tf_log(req: MockTFLog) -> Path:
|
@@ -117,6 +128,7 @@ def mock_tf_log_cmd(
|
|
117
128
|
log_diff_roundtrips: bool = typer.Option(
|
118
129
|
False, "-l", "--log-diff-roundtrips", help="print out the roundtrips used in diffs"
|
119
130
|
),
|
131
|
+
package_name: str = typer.Option("", "-p", "--package-name", help="the package name to use for modifiers"),
|
120
132
|
):
|
121
133
|
cwd = Path.cwd()
|
122
134
|
default_testdir = cwd / "testdata"
|
@@ -128,6 +140,7 @@ def mock_tf_log_cmd(
|
|
128
140
|
diff_skip_suffixes=diff_skip_suffixes,
|
129
141
|
keep_duplicates=keep_duplicates,
|
130
142
|
log_diff_roundtrips=log_diff_roundtrips,
|
143
|
+
package_name=package_name,
|
131
144
|
)
|
132
145
|
mock_tf_log(event_in)
|
133
146
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: atlas-init
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.6
|
4
4
|
Project-URL: Documentation, https://github.com/EspenAlbert/atlas-init#readme
|
5
5
|
Project-URL: Issues, https://github.com/EspenAlbert/atlas-init/issues
|
6
6
|
Project-URL: Source, https://github.com/EspenAlbert/atlas-init
|
@@ -1,4 +1,4 @@
|
|
1
|
-
atlas_init/__init__.py,sha256=
|
1
|
+
atlas_init/__init__.py,sha256=013oNfbE-2O9o7wGJ0RfU_mp9JM2EfwATjKXG2D_v6I,372
|
2
2
|
atlas_init/__main__.py,sha256=dY1dWWvwxRZMmnOFla6RSfti-hMeLeKdoXP7SVYqMUc,52
|
3
3
|
atlas_init/atlas_init.yaml,sha256=OAosOZw4kjhTWcPeEv0jtztRFWRhsie8D9r5afySAxM,2065
|
4
4
|
atlas_init/cli.py,sha256=xOnAOUccHDLkivICdF0GsLhccr_IxvnTKTbe1KGW7kU,8971
|
@@ -26,12 +26,12 @@ atlas_init/cli_tf/app.py,sha256=0Y5c-Pc9ibOz6kXvFlL-yhH_fx1nHLgBgK9OAVqjX9s,1139
|
|
26
26
|
atlas_init/cli_tf/changelog.py,sha256=biWYKf1pZvXZ-jEgcZ5q9sY7nTGrL2PuI0h9mCILf_g,3181
|
27
27
|
atlas_init/cli_tf/debug_logs.py,sha256=q71ZNOnQOz1ikPCyqUz_6zyd4Bm1QVkCkTcixJBZ1xI,8988
|
28
28
|
atlas_init/cli_tf/debug_logs_test_data.py,sha256=G4pnuWJ7PAQd3NXRKAtwAPC6Ne-PgpzaTZHQ9waqxZI,9565
|
29
|
-
atlas_init/cli_tf/debug_logs_test_data_package_config.py,sha256=
|
29
|
+
atlas_init/cli_tf/debug_logs_test_data_package_config.py,sha256=BOAgln1pWne_ZhP6a0SM2ddn2csr0sgGkYf2kMS_V9o,1666
|
30
30
|
atlas_init/cli_tf/github_logs.py,sha256=VD7qhlXNuG21eTuJ5VI7rsflp5WHSodfngkRVgQlumw,8114
|
31
31
|
atlas_init/cli_tf/go_test_run.py,sha256=LQUQ-3zJ8EUCixwu33QTAzUns3um793osst8tE0UKjk,6792
|
32
32
|
atlas_init/cli_tf/go_test_run_format.py,sha256=OUd6QPHDeTzbwVuh6MhP-xXgjOOGP9W_sCLJ8KylBTs,1201
|
33
33
|
atlas_init/cli_tf/go_test_summary.py,sha256=agr4SITgxchjgOzRpScoTUk-iG38QDLkpnsMtTW9GTY,5382
|
34
|
-
atlas_init/cli_tf/mock_tf_log.py,sha256=
|
34
|
+
atlas_init/cli_tf/mock_tf_log.py,sha256=rYUpkN1oOWk1ncy99J-Jb9p7wL073XnO-PdfFRnYnR8,7533
|
35
35
|
atlas_init/cli_tf/schema.py,sha256=iwvb4wD2Wba0MMu7ooTNAIi1jHbpLiXGPOT51_o_YW8,12431
|
36
36
|
atlas_init/cli_tf/schema_go_parser.py,sha256=PiRfFFVnkhltxcGFfOCgH53wwzIEynw2BXmSfaINLL8,8294
|
37
37
|
atlas_init/cli_tf/schema_inspection.py,sha256=ujLvGfg3baByND4nRD0drZoI45STxo3VfYvim-PfVOc,1764
|
@@ -88,7 +88,7 @@ atlas_init/tf/modules/vpc_peering/vpc_peering.tf,sha256=hJ3KJdGbLpOQednUpVuiJ0Cq
|
|
88
88
|
atlas_init/tf/modules/vpc_privatelink/atlas-privatelink.tf,sha256=FloaaX1MNDvoMZxBnEopeLKyfIlq6kaX2dmx8WWlXNU,1298
|
89
89
|
atlas_init/tf/modules/vpc_privatelink/variables.tf,sha256=gktHCDYD4rz6CEpLg5aiXcFbugw4L5S2Fqc52QYdJyc,255
|
90
90
|
atlas_init/tf/modules/vpc_privatelink/versions.tf,sha256=G0u5V_Hvvrkux_tqfOY05pA-GzSp_qILpfx1dZaTGDc,237
|
91
|
-
atlas_init-0.3.
|
92
|
-
atlas_init-0.3.
|
93
|
-
atlas_init-0.3.
|
94
|
-
atlas_init-0.3.
|
91
|
+
atlas_init-0.3.6.dist-info/METADATA,sha256=OZjhfNhuqps6Lj0ula1qtEaeEqToxHMvkisBrWezRcM,5650
|
92
|
+
atlas_init-0.3.6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
93
|
+
atlas_init-0.3.6.dist-info/entry_points.txt,sha256=oSNFIEAS9nUZyyZ8Fc-0F0U5j-NErygy01LpJVSHapQ,57
|
94
|
+
atlas_init-0.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|