qontract-reconcile 0.10.1rc109__py3-none-any.whl → 0.10.1rc111__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.
- {qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/RECORD +10 -10
- reconcile/jenkins_job_builder.py +0 -5
- reconcile/queries.py +0 -1
- reconcile/terraform_repo.py +1 -1
- reconcile/test/test_terraform_repo.py +20 -26
- tools/app_interface_reporter.py +8 -100
- {qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc111
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Home-page: https://github.com/app-sre/qontract-reconcile
|
6
6
|
Author: Red Hat App-SRE Team
|
{qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/RECORD
RENAMED
@@ -33,7 +33,7 @@ reconcile/gitlab_permissions.py,sha256=ciEKj_wnRbS_vs_ZwcUeD6HkWVe3osAuotFqJSmvd
|
|
33
33
|
reconcile/gitlab_projects.py,sha256=K3tFf_aD1W4Ijp5q-9Qek3kwFGEWPcZ1kd7tzFJ4GyQ,1781
|
34
34
|
reconcile/integrations_manager.py,sha256=ed1kFdGG6Z2agbN_agSp-pIyCQMyegF-OzH2EpUTkv8,8878
|
35
35
|
reconcile/jenkins_base.py,sha256=0Gocu3fU2YTltaxBlbDQOUvP-7CP2OSQV1ZRwtWeVXw,875
|
36
|
-
reconcile/jenkins_job_builder.py,sha256=
|
36
|
+
reconcile/jenkins_job_builder.py,sha256=tfar8m5dyYlOZxgoMBvs1Woa698PftZCrCsvTzL3tLg,3930
|
37
37
|
reconcile/jenkins_job_builds_cleaner.py,sha256=zK8gQgXY5Ab5aDk8yPiXg0ogUEBOGmbyo8wEEtK342k,3190
|
38
38
|
reconcile/jenkins_job_cleaner.py,sha256=8DetVJsUFf68ZtUwaO9Vg9ohAsua2uA0Q6ykI4j3K0w,1794
|
39
39
|
reconcile/jenkins_roles.py,sha256=hOLPiPs2Juv7l8mGBj5-e88DqgvLbLldf0Xk0ylUzHE,4577
|
@@ -87,7 +87,7 @@ reconcile/quay_mirror.py,sha256=9pwl1gLzRpsVXF5yPULM4ET_C5F8_xPmH8Mv8AS2AfI,1340
|
|
87
87
|
reconcile/quay_mirror_org.py,sha256=E1OdRe-ppxTkNCwu20iVRhEdG1fPDBroLY02NgiMN7c,10381
|
88
88
|
reconcile/quay_permissions.py,sha256=_3PCWjNWoU7VHlYgHzUevvL_jJmEMsWfXV_nzjeiyhU,4099
|
89
89
|
reconcile/quay_repos.py,sha256=7609RBVQihis96FNOOe-i9tCTYwcTVy4WpKAL6HpnkU,7031
|
90
|
-
reconcile/queries.py,sha256=
|
90
|
+
reconcile/queries.py,sha256=lQpqysAzm2649BkJxhaue107LT-mOpmITTyKoLnTPls,48422
|
91
91
|
reconcile/query_validator.py,sha256=oLEZIAsQCzxmmZ7b9dSw-OKuEjpI1dbVu4XfCfjpmi8,1503
|
92
92
|
reconcile/requests_sender.py,sha256=914iluuF4UVgG3VyxxtnHOu4yf6YKS2fIy6PViSsFTQ,3875
|
93
93
|
reconcile/resource_scraper.py,sha256=vo1N9vLJCYWvXlTwFRIpEuWjx_39ZV9zxJlpoPq4g3U,2330
|
@@ -104,7 +104,7 @@ reconcile/terraform_aws_route53.py,sha256=06VIlIb95BzVkxV_1TPiaY9sQO-TkvQXL4V_qz
|
|
104
104
|
reconcile/terraform_cloudflare_dns.py,sha256=auU4bzeLwd4S8D8oqpqJbrCUoEdELXrgi7vHOedjYFk,13332
|
105
105
|
reconcile/terraform_cloudflare_resources.py,sha256=BQg12mHm1iaxf086FFPZutPbWKUMaddqu-nREPR8ptA,14887
|
106
106
|
reconcile/terraform_cloudflare_users.py,sha256=Bv0f9lOO_wTM7st8iltb8FR8gu4KpKu3qavMzAYcoMc,13965
|
107
|
-
reconcile/terraform_repo.py,sha256=
|
107
|
+
reconcile/terraform_repo.py,sha256=g4CdusKWWb43SndlXg3K-jB2T1oSFJ_cWj1hjeWVU7s,11509
|
108
108
|
reconcile/terraform_resources.py,sha256=gQ-LT0TGwf9OR4RF5EWDmNHUnKWnbhrIMtyIdUgP4D4,16782
|
109
109
|
reconcile/terraform_tgw_attachments.py,sha256=ootT8zPxcm3-VHy9OiG0zBP0X7wzrvTCh53eYbxJvfI,13725
|
110
110
|
reconcile/terraform_users.py,sha256=AzDvEQCdLpsXoS3nLbIQRraQvJHa8JmL40lZFv8YXMk,9321
|
@@ -354,7 +354,7 @@ reconcile/test/test_sql_query.py,sha256=l0QyIflcErIrAwSP8kOIub0jO6oi0Ncuns5IJtnu
|
|
354
354
|
reconcile/test/test_terraform_cloudflare_dns.py,sha256=aQTXX8Vr4h9aWvJZTnpZEhMGYoBpT2d45ZxU_ECIQ6o,3425
|
355
355
|
reconcile/test/test_terraform_cloudflare_resources.py,sha256=cWNE2UIhz19rLSWdpJG8xRwuEEYoIZWEkDZY7e2QN_g,3426
|
356
356
|
reconcile/test/test_terraform_cloudflare_users.py,sha256=8iAFjz-zbUW4xLS10Lk1XvYSk4B_W__YT9rgrBuigcQ,27482
|
357
|
-
reconcile/test/test_terraform_repo.py,sha256=
|
357
|
+
reconcile/test/test_terraform_repo.py,sha256=u1Xb3eglJ3vJUOFD9wjnWG3XypX2nClBLhqB2Y_lcK8,6533
|
358
358
|
reconcile/test/test_terraform_resources.py,sha256=dEpJwaTzE_FzkRjCozDtGzE4egBrb-VrwSoWr2Benv4,7955
|
359
359
|
reconcile/test/test_terraform_tgw_attachments.py,sha256=ddf04h_uKYroJOWKOFGZxuJNL-1PSjW5EyddQB3CLSw,33744
|
360
360
|
reconcile/test/test_terraform_users.py,sha256=Yt4iN5FMtn7cfVlVqBJ1MMH94Z0DGchyByhpfNUJFxM,1570
|
@@ -581,7 +581,7 @@ release/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
581
581
|
release/test_version.py,sha256=4DKxDZkT0aoS6ibZFsH2fd_wNETij1qfn2pCgQtVCGo,2093
|
582
582
|
release/version.py,sha256=Ud36t9FxGHLubMrE2o5aaaZRGB9_9hU_z0RN9go0TQM,3876
|
583
583
|
tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
584
|
-
tools/app_interface_reporter.py,sha256=
|
584
|
+
tools/app_interface_reporter.py,sha256=mLFxy-hmkrv_B_MdfNfM7CzYPgnTHxPAW7s_Vj5Zlt8,18271
|
585
585
|
tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
|
586
586
|
tools/glitchtip_access_revalidation.py,sha256=PXN5wxl6OX8sxddPaakDF3X79nFLvpm-lz0mWLVelw0,2806
|
587
587
|
tools/qontract_cli.py,sha256=uH3Ouo5ce_ic36AL3-DAML0XEy447bHYER1EwmnrsVs,86963
|
@@ -592,8 +592,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
|
|
592
592
|
tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
593
593
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
594
594
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
595
|
-
qontract_reconcile-0.10.
|
596
|
-
qontract_reconcile-0.10.
|
597
|
-
qontract_reconcile-0.10.
|
598
|
-
qontract_reconcile-0.10.
|
599
|
-
qontract_reconcile-0.10.
|
595
|
+
qontract_reconcile-0.10.1rc111.dist-info/METADATA,sha256=hUSHlw5n1svKbjQbz_vdzbuN4BZR5ikP2VYpYQR1pYY,2291
|
596
|
+
qontract_reconcile-0.10.1rc111.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
597
|
+
qontract_reconcile-0.10.1rc111.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
|
598
|
+
qontract_reconcile-0.10.1rc111.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
599
|
+
qontract_reconcile-0.10.1rc111.dist-info/RECORD,,
|
reconcile/jenkins_job_builder.py
CHANGED
@@ -44,11 +44,6 @@ QONTRACT_INTEGRATION = "jenkins-job-builder"
|
|
44
44
|
GENERATE_TYPE = ["jobs", "views"]
|
45
45
|
|
46
46
|
|
47
|
-
def get_openshift_saas_deploy_job_name(saas_file_name, env_name, settings):
|
48
|
-
job_template_name = settings["saasDeployJobTemplate"]
|
49
|
-
return f"{job_template_name}-{saas_file_name}-{env_name}"
|
50
|
-
|
51
|
-
|
52
47
|
def get_jenkins_configs():
|
53
48
|
gqlapi = gql.get_api()
|
54
49
|
return gqlapi.query(QUERY)["jenkins_configs"]
|
reconcile/queries.py
CHANGED
reconcile/terraform_repo.py
CHANGED
@@ -149,7 +149,7 @@ class TerraformRepoIntegration(
|
|
149
149
|
for key in keys:
|
150
150
|
if value := state.get(key.lstrip("/"), None):
|
151
151
|
try:
|
152
|
-
repo = TerraformRepoV1.
|
152
|
+
repo = TerraformRepoV1.parse_obj(value)
|
153
153
|
repo_list.append(repo)
|
154
154
|
except ValidationError as err:
|
155
155
|
logging.error(
|
@@ -65,30 +65,6 @@ def int_params() -> TerraformRepoIntegrationParams:
|
|
65
65
|
return TerraformRepoIntegrationParams(print_to_file=None, validate_git=False)
|
66
66
|
|
67
67
|
|
68
|
-
@pytest.fixture()
|
69
|
-
def a_repo_json() -> str:
|
70
|
-
# terraform repo expects a JSON string not a dict so we have to encode a multi-line JSON string
|
71
|
-
return f"""
|
72
|
-
{{
|
73
|
-
"name": "a_repo",
|
74
|
-
"repository": "{A_REPO}",
|
75
|
-
"ref": "{A_REPO_SHA}",
|
76
|
-
"projectPath": "tf",
|
77
|
-
"delete": false,
|
78
|
-
"account": {{
|
79
|
-
"name": "foo",
|
80
|
-
"uid": "{AWS_UID}",
|
81
|
-
"automationToken": {{
|
82
|
-
"path": "{AUTOMATION_TOKEN_PATH}",
|
83
|
-
"field": "all",
|
84
|
-
"version": 1,
|
85
|
-
"format": null
|
86
|
-
}}
|
87
|
-
}}
|
88
|
-
}}
|
89
|
-
"""
|
90
|
-
|
91
|
-
|
92
68
|
@pytest.fixture()
|
93
69
|
def state_mock() -> MagicMock:
|
94
70
|
return MagicMock(spec=State)
|
@@ -181,13 +157,31 @@ def test_delete_repo_without_flag(existing_repo, int_params):
|
|
181
157
|
)
|
182
158
|
|
183
159
|
|
184
|
-
def test_get_repo_state(s3_state_builder, int_params, existing_repo
|
160
|
+
def test_get_repo_state(s3_state_builder, int_params, existing_repo):
|
185
161
|
state = s3_state_builder(
|
186
162
|
{
|
187
163
|
"ls": [
|
188
164
|
"/a_repo",
|
189
165
|
],
|
190
|
-
"get": {
|
166
|
+
"get": {
|
167
|
+
"a_repo": {
|
168
|
+
"name": "a_repo",
|
169
|
+
"repository": A_REPO,
|
170
|
+
"ref": A_REPO_SHA,
|
171
|
+
"projectPath": "tf",
|
172
|
+
"delete": False,
|
173
|
+
"account": {
|
174
|
+
"name": "foo",
|
175
|
+
"uid": AWS_UID,
|
176
|
+
"automationToken": {
|
177
|
+
"path": AUTOMATION_TOKEN_PATH,
|
178
|
+
"field": "all",
|
179
|
+
"version": 1,
|
180
|
+
"format": None,
|
181
|
+
},
|
182
|
+
},
|
183
|
+
}
|
184
|
+
},
|
191
185
|
}
|
192
186
|
)
|
193
187
|
|
tools/app_interface_reporter.py
CHANGED
@@ -25,14 +25,7 @@ from reconcile.cli import (
|
|
25
25
|
log_level,
|
26
26
|
threaded,
|
27
27
|
)
|
28
|
-
from reconcile.jenkins_job_builder import
|
29
|
-
get_openshift_saas_deploy_job_name,
|
30
|
-
init_jjb,
|
31
|
-
)
|
32
|
-
from reconcile.typed_queries.saas_files import (
|
33
|
-
export_model,
|
34
|
-
get_saas_files,
|
35
|
-
)
|
28
|
+
from reconcile.jenkins_job_builder import init_jjb
|
36
29
|
from reconcile.utils.jjb_client import JJB
|
37
30
|
from reconcile.utils.mr import CreateAppInterfaceReporter
|
38
31
|
from reconcile.utils.runtime.environment import init_env
|
@@ -231,7 +224,6 @@ def get_apps_data(date, month_delta=1, thread_pool_size=10):
|
|
231
224
|
secret_reader = SecretReader(settings)
|
232
225
|
|
233
226
|
apps = queries.get_apps()
|
234
|
-
saas_files = [export_model(saas_file) for saas_file in get_saas_files()]
|
235
227
|
jjb: JJB = init_jjb(secret_reader)
|
236
228
|
jenkins_map = jenkins_base.get_jenkins_map()
|
237
229
|
time_limit = date - relativedelta(months=month_delta)
|
@@ -256,22 +248,6 @@ def get_apps_data(date, month_delta=1, thread_pool_size=10):
|
|
256
248
|
build_jobs = jjb.get_all_jobs(job_types=["build"])
|
257
249
|
jobs_to_get = build_jobs.copy()
|
258
250
|
|
259
|
-
saas_deploy_jobs = []
|
260
|
-
for saas_file in saas_files:
|
261
|
-
saas_file_name = saas_file["name"]
|
262
|
-
for template in saas_file["resourceTemplates"]:
|
263
|
-
for target in template["targets"]:
|
264
|
-
job = {}
|
265
|
-
job["env"] = target["namespace"]["environment"]["name"]
|
266
|
-
job["app"] = target["namespace"]["app"]["name"]
|
267
|
-
job["cluster"] = target["namespace"]["cluster"]["name"]
|
268
|
-
job["namespace"] = target["namespace"]["name"]
|
269
|
-
job["name"] = get_openshift_saas_deploy_job_name(
|
270
|
-
saas_file_name, job["env"], settings
|
271
|
-
)
|
272
|
-
job["saas_file_name"] = saas_file_name
|
273
|
-
saas_deploy_jobs.append(job)
|
274
|
-
|
275
251
|
job_history = get_build_history_pool(
|
276
252
|
jenkins_map, jobs_to_get, timestamp_limit, thread_pool_size
|
277
253
|
)
|
@@ -283,84 +259,16 @@ def get_apps_data(date, month_delta=1, thread_pool_size=10):
|
|
283
259
|
app_name = app["name"]
|
284
260
|
|
285
261
|
logging.info(f"collecting post-deploy jobs " f"information for {app_name}")
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
resource_types = saas_file["managedResourceTypes"]
|
291
|
-
|
292
|
-
# Only jobs of these types are expected to have a
|
293
|
-
# further post-deploy job
|
294
|
-
if not any(
|
295
|
-
[
|
296
|
-
"Deployment" in resource_types,
|
297
|
-
"DeploymentConfig" not in resource_types,
|
298
|
-
]
|
299
|
-
):
|
300
|
-
continue
|
301
|
-
|
302
|
-
for resource_template in saas_file["resourceTemplates"]:
|
303
|
-
for target in resource_template["targets"]:
|
304
|
-
cluster = target["namespace"]["cluster"]["name"]
|
305
|
-
namespace = target["namespace"]["name"]
|
306
|
-
post_deploy_jobs[cluster] = {}
|
307
|
-
post_deploy_jobs[cluster][namespace] = False
|
308
|
-
|
309
|
-
for saas_file in saas_files:
|
310
|
-
if saas_file["app"]["name"] != app_name:
|
311
|
-
continue
|
312
|
-
resource_types = saas_file["managedResourceTypes"]
|
313
|
-
if "Job" not in resource_types:
|
314
|
-
continue
|
315
|
-
for resource_template in saas_file["resourceTemplates"]:
|
316
|
-
for target in resource_template["targets"]:
|
317
|
-
|
318
|
-
cluster = target["namespace"]["cluster"]["name"]
|
319
|
-
namespace = target["namespace"]["name"]
|
320
|
-
|
321
|
-
# This block skips the check if the cluster/namespace
|
322
|
-
# has no Deployment/DeploymentConfig job associated.
|
323
|
-
if cluster not in post_deploy_jobs:
|
324
|
-
continue
|
325
|
-
if namespace not in post_deploy_jobs[cluster]:
|
326
|
-
continue
|
327
|
-
|
328
|
-
# Post-deploy job must depend on a openshift-saas-deploy
|
329
|
-
# job
|
330
|
-
if target["upstream"] is None or target["upstream"]["name"] is None:
|
331
|
-
continue
|
332
|
-
if target["upstream"]["name"].startswith("openshift-saas-deploy-"):
|
333
|
-
post_deploy_jobs[cluster][namespace] = True
|
334
|
-
|
335
|
-
app["post_deploy_jobs"] = post_deploy_jobs
|
262
|
+
# this is now empty as it referred to post_deploy jobs via Jenkins. This section
|
263
|
+
# should be removed when we publish a new content format or if we get promotion data
|
264
|
+
# differently.
|
265
|
+
app["post_deploy_jobs"] = {}
|
336
266
|
|
337
267
|
logging.info(f"collecting promotion history for {app_name}")
|
338
268
|
app["promotions"] = {}
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
if job["name"] not in job_history:
|
343
|
-
continue
|
344
|
-
history = job_history[job["name"]]
|
345
|
-
saas_file_name = job["saas_file_name"]
|
346
|
-
if saas_file_name not in app["promotions"]:
|
347
|
-
app["promotions"][saas_file_name] = [
|
348
|
-
{
|
349
|
-
"env": job["env"],
|
350
|
-
"cluster": job["cluster"],
|
351
|
-
"namespace": job["namespace"],
|
352
|
-
**history,
|
353
|
-
}
|
354
|
-
]
|
355
|
-
else:
|
356
|
-
app["promotions"][saas_file_name].append(
|
357
|
-
{
|
358
|
-
"env": job["env"],
|
359
|
-
"cluster": job["cluster"],
|
360
|
-
"namespace": job["namespace"],
|
361
|
-
**history,
|
362
|
-
}
|
363
|
-
)
|
269
|
+
# this is now empty as it referred to saas files promotions via Jenkins. This section
|
270
|
+
# should be removed when we publish a new content format or if we get promotion data
|
271
|
+
# differently.
|
364
272
|
|
365
273
|
logging.info(f"collecting merge activity for {app_name}")
|
366
274
|
app["merge_activity"] = {}
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc109.dist-info → qontract_reconcile-0.10.1rc111.dist-info}/top_level.txt
RENAMED
File without changes
|