qontract-reconcile 0.10.1rc54__py3-none-any.whl → 0.10.1rc56__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc54
3
+ Version: 0.10.1rc56
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
@@ -120,7 +120,7 @@ reconcile/unleash_watcher.py,sha256=xNLUFpIr66XESEyXUkmHTTmHghVWHiMtnS_k0OC7gd8,
120
120
  reconcile/vault_replication.py,sha256=xobxnsOfUcwvdQ-RZ7JH_sZCDh8rpEY7MJ36nkvfFqE,17262
121
121
  reconcile/vpc_peerings_validator.py,sha256=10igLYTQpBMGXO9mTO7sJBzgr4jXQ2hf1OH5r5DKugE,3586
122
122
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
- reconcile/aus/advanced_upgrade_service.py,sha256=l9Zz4nOGo5YnZjXpBZX3yltgSiKaB-QYIJZJapCW2eg,11909
123
+ reconcile/aus/advanced_upgrade_service.py,sha256=xWu2oq1ouSkw0ZMoX40cmj_6W6MuWpc81S6PvxOupAA,11988
124
124
  reconcile/aus/base.py,sha256=9qovY5Q9-o6hNRyVI7TaCZAnbSI1PSj9gD1-Ph--IAg,29670
125
125
  reconcile/aus/metrics.py,sha256=QLzmIpXh3Pxddfz9KyaiupLJZQnxjwVz04YfhpVLhQk,1637
126
126
  reconcile/aus/models.py,sha256=kRrs276iJClnNnEeWnJma2Gvx8E9kes77I_XbgKoVzk,4722
@@ -267,14 +267,14 @@ reconcile/prometheus_rules_tester/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
267
267
  reconcile/prometheus_rules_tester/integration.py,sha256=Sn6mjzC2lJQVcETS1J2Z3tOwm8M3DDW-1GVT-5ccNuA,8860
268
268
  reconcile/saas_auto_promotions_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
269
269
  reconcile/saas_auto_promotions_manager/integration.py,sha256=hmRWva3_ZEO845wMkttEt4X6Izl5p8ZKs09NXWp8mkY,5609
270
- reconcile/saas_auto_promotions_manager/publisher.py,sha256=8uh7YnR2IPkzJHSxMwvt_iFOnEn6JAHFz2UqLZ86qb8,2338
270
+ reconcile/saas_auto_promotions_manager/publisher.py,sha256=Oi7QMlxY56NXO2W4NnB7kSeL-7Ef3oY75mIccoLWBwg,1980
271
271
  reconcile/saas_auto_promotions_manager/subscriber.py,sha256=8w9q1ceA2XnuTntThg8v6mE3K28aG2Y2DwQSuTudkns,6942
272
272
  reconcile/saas_auto_promotions_manager/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
273
273
  reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request.py,sha256=PNu7sE-tDUY61E03z5w0b93fdowZ8auCl0S4_vhYOKQ,1333
274
274
  reconcile/saas_auto_promotions_manager/merge_request_manager/merge_request_manager.py,sha256=SNJ9WLlaFnf_tblwC0xDBfrXi4SVadeFgV3llhTqbGM,10959
275
275
  reconcile/saas_auto_promotions_manager/merge_request_manager/renderer.py,sha256=Ye3lmfWTbuHjMoCEOpGnGRK3QU0LwB_LVfnPXFdNxf4,4702
276
276
  reconcile/saas_auto_promotions_manager/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
277
- reconcile/saas_auto_promotions_manager/utils/saas_files_inventory.py,sha256=iYiGLZUoR96h_Ruiac9o9o_iJSEKUNtGghSf_Yqrf64,6677
277
+ reconcile/saas_auto_promotions_manager/utils/saas_files_inventory.py,sha256=LEK_635Vt7VPWnhVonn54JxkfUKCehX3_6bJfD8zKbI,8597
278
278
  reconcile/saas_auto_promotions_manager/utils/vcs.py,sha256=wIB3DUazVpmysKuKmHZZ_yG9d04givRBulXrUuZyOgw,5240
279
279
  reconcile/skupper_network/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
280
280
  reconcile/skupper_network/integration.py,sha256=Xps2zaD80FY_e-2vl_skybhuzQmqaC8zQQOY7K1s78o,10746
@@ -296,7 +296,7 @@ reconcile/test/conftest.py,sha256=dBWwQMkcdONERlnBJg4J6Td5Fexpbvme5y-UuoI-c9M,31
296
296
  reconcile/test/fixtures.py,sha256=VhvLXH0AWXEyu3FgPp7bcSTPmDPfMEa2v-_9cd8dCmw,572
297
297
  reconcile/test/test_aggregated_list.py,sha256=iiWitQuNYC58aimWaiBoE4NROHjr1NCgQ91MnHEG_Ro,6412
298
298
  reconcile/test/test_amtool.py,sha256=vxRhGieeydMBOb9UI2ziMHjJa8puMeGNsUhGhy-yMnk,1032
299
- reconcile/test/test_auto_promoter.py,sha256=unvv6F7vwIB_V0FG-G9rGmVVxDLQ2m6bWSnypB5q7Ek,10864
299
+ reconcile/test/test_auto_promoter.py,sha256=4EtLLN0FAJGJnFoSCRsB5hHyY2-H3GMfnn5-p7kNCTg,10340
300
300
  reconcile/test/test_aws_ami_share.py,sha256=eSITdDoXs8mMY7P2lFxAX2DA0sJ9RW6D1tG8Rek0gLE,1981
301
301
  reconcile/test/test_aws_iam_keys.py,sha256=MfE9EvItyPNPAl5QaLlJFUvvrZFiar518TM2wWNjJn4,1829
302
302
  reconcile/test/test_aws_iam_password_reset.py,sha256=fnkqB90adR7W4L4saNdrtIiwnQB9bXgqJ9R1CKxjSnk,860
@@ -341,7 +341,7 @@ reconcile/test/test_quay_repos.py,sha256=TdkcRF_a8PLp01Kti9eZZN-vGup2yPBT4Iba3k0
341
341
  reconcile/test/test_queries.py,sha256=SpH3RmNpBjEr_ne3VjAMCgKK8RE1z1zo7bypkT5uoO4,1946
342
342
  reconcile/test/test_repo_owners.py,sha256=uRYMLbMmh-9usF0TerabZTZV-Z1CS4I6ybT-LQqCLe8,1423
343
343
  reconcile/test/test_requests_sender.py,sha256=7fd9C2kEFS0-CYtlsif66N1kO9c44pzuBPAJKR9igqU,5385
344
- reconcile/test/test_saasherder.py,sha256=LPRKvuu5hjIVSMQ7_u0BtY2gdGUNy4N-FHiqT08atLY,37484
344
+ reconcile/test/test_saasherder.py,sha256=45D8_5frYn3ax-Tw96s2eBKNxY5qmZ1KpHD_iv9Ea80,37402
345
345
  reconcile/test/test_saasherder_allowed_secret_paths.py,sha256=86ffYbbN0Xng8CTiXf3yR_3VD8qyqRpVTByJFycdXp0,4899
346
346
  reconcile/test/test_secret_reader.py,sha256=kz7nzcPjvA08cytnvcA_PMA98AEyqJWsESkYeRn5xCk,4994
347
347
  reconcile/test/test_slack_base.py,sha256=UqMjYt4hPmStJfog06qwJM_afbf-E9uzy-GX741KgTY,5058
@@ -402,8 +402,8 @@ reconcile/test/test_version_bump.py,sha256=q6-3Y1roriI6YWpFwaHOMN7emEP3yL33sh_0V
402
402
  reconcile/test/test_vpc_peerings_validator.py,sha256=j4MlmIoGptMJsYNfJAChHRkilSxtqBEUJBQhL6Uqfmo,3710
403
403
  reconcile/test/test_wrong_region.py,sha256=7KzL7OaICQ9Z3DW27zt_ykMN7_87owAFC-2CYjvGoyA,2138
404
404
  reconcile/test/saas_auto_promotions_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
- reconcile/test/saas_auto_promotions_manager/conftest.py,sha256=DodxMN_hjE3GU7G_k5RYjAoc4Iu1vp0WiE_ISQEG9YA,2382
406
- reconcile/test/saas_auto_promotions_manager/test_integration_test.py,sha256=8eW0kWCgwCs1gGEkzqKoG77z0Z9HMWpALYoK0iNl5DQ,5164
405
+ reconcile/test/saas_auto_promotions_manager/conftest.py,sha256=1QT_pdhgADtKB8VweMWMYxwXlc_aMJ0EZmA9qWC0olw,2103
406
+ reconcile/test/saas_auto_promotions_manager/test_integration_test.py,sha256=lBKDeN7j9i-JxNUyo0hlWU_WkEUUskm4xkcHfPMJm1Y,4562
407
407
  reconcile/test/saas_auto_promotions_manager/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
408
408
  reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
409
409
  reconcile/test/saas_auto_promotions_manager/merge_request_manager/merge_request_manager/conftest.py,sha256=LGEsqcjs4O4i29LJ0I7g8-uBog1QKFRGA5-8rSfrks0,3302
@@ -417,7 +417,7 @@ reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_
417
417
  reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_namespace.py,sha256=w8BT3Z_M7Jz0Xn1OINWypWjmSGMBDGgjt_zY_3iOJoM,2667
418
418
  reconcile/test/saas_auto_promotions_manager/merge_request_manager/renderer/test_content_single_target.py,sha256=cwAPrQ_v3DR_CHU7Nt2xBGutC-1XslyJ5mXM8FXW-3o,1111
419
419
  reconcile/test/saas_auto_promotions_manager/subscriber/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
420
- reconcile/test/saas_auto_promotions_manager/subscriber/conftest.py,sha256=05BZqP5tapjhlcLD0teasbNO1DzBo_xoGhZdxebbWK8,2559
420
+ reconcile/test/saas_auto_promotions_manager/subscriber/conftest.py,sha256=YmuCS9fIQ6CiAM8pjjtSPe12skQrrch6mD06HTbRdIE,2531
421
421
  reconcile/test/saas_auto_promotions_manager/subscriber/data_keys.py,sha256=xaGGbeWtq0aYlJxC-7wJvX3yWnqDSNYMeR0h5rsYAh0,410
422
422
  reconcile/test/saas_auto_promotions_manager/subscriber/test_content_hash.py,sha256=6Nkyix3Uyf7Zd9t2C6RnYlQG_y3NsZ6v6zu3G-qF4to,5186
423
423
  reconcile/test/saas_auto_promotions_manager/subscriber/test_diff.py,sha256=naArIa1AZj8iaDjzJoYwLX5PqrSNakqsBXonOHEQ0PA,4957
@@ -426,7 +426,7 @@ reconcile/test/saas_auto_promotions_manager/subscriber/test_multiple_channels_mo
426
426
  reconcile/test/saas_auto_promotions_manager/subscriber/test_single_channel_with_single_publisher.py,sha256=zIkUg-Vx-Em0-0JY_zC1N3Of_PaB-8GRSqsW5FXLkM8,10244
427
427
  reconcile/test/saas_auto_promotions_manager/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
428
428
  reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
429
- reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_multiple_publishers_for_single_channel.py,sha256=1O1F-BVWAgcrfPJ7QDpMeQcrZRB0eWa9jCzDZ_o7QS8,2309
429
+ reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_multiple_publishers_for_single_channel.py,sha256=A2bw4U2jcwpQpTd8nab2Pe7QeF-__2CEJp8kWocVHVc,2414
430
430
  reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_use_target_config_hash.py,sha256=qC_GapxJxfTEZ0o5xYuI4BA0cRcX4QLgtlW5MY691nw,2066
431
431
  reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_with_auto_promote.py,sha256=F3ZGLzNa821yUw68YH9bA1cQEV82_hQxfPjkuJ-ELWw,2707
432
432
  reconcile/test/saas_auto_promotions_manager/utils/saas_files_inventory/test_saas_files_without_auto_promote.py,sha256=6EYKmXDN9ckkMvdUBZlUiunCKuwQ9UmnPijKvXU8iZo,2170
@@ -446,7 +446,7 @@ reconcile/typed_queries/namespaces_minimal.py,sha256=rUtqNQ0ORXXUTQfnpsMURymAJ4g
446
446
  reconcile/typed_queries/ocp_release_mirror.py,sha256=jwX29Tcdvov8oEDNkE4t1j-2Hz8QJrjg9ITppP-panQ,313
447
447
  reconcile/typed_queries/pagerduty_instances.py,sha256=QCHqEAakiH6eSob0Pnnn3IBd8Ga0zpEp1Z6Qu3v2uH4,733
448
448
  reconcile/typed_queries/repos.py,sha256=RKBsf7IDS6NsXTtXxJ9Ol9G3bxG9sr3vW9QQ2bahEHo,512
449
- reconcile/typed_queries/saas_files.py,sha256=XFvM7DGL7piRuxk5xCmVA1Zc-CbTEGL0tRkHR0vu4Fc,11832
449
+ reconcile/typed_queries/saas_files.py,sha256=aAtAtUGP5yRWI5MxL3GmrhjKNUKOd8RhALECwRZvr3E,11443
450
450
  reconcile/typed_queries/smtp.py,sha256=aSLglYa5bHKmlGwKkxq2RZqyMWuAf0a4S_mOuhDa084,542
451
451
  reconcile/typed_queries/tekton_pipeline_providers.py,sha256=2mpHBdsNPQB94tw0H9aenGuqj8EEjYolQ03YEq1CpiY,546
452
452
  reconcile/typed_queries/terraform_namespaces.py,sha256=71ARJ-GzkU9tBM0IfJTL3NF4349SJy-Mgs_DwAgUz_g,444
@@ -505,7 +505,7 @@ reconcile/utils/output.py,sha256=htcMXMe0y2dNnwu8MW8x0JZ5YBaEJRy5w4tR8yLF0OU,173
505
505
  reconcile/utils/pagerduty_api.py,sha256=LgfiGSmg1iLfTsc1ZuHrFh_8qXLz52YWTXv5sF1BpN8,7468
506
506
  reconcile/utils/parse_dhms_duration.py,sha256=ZJGlB43MjhgckgO3OF_nacwTiKVRpxb5Yv7m-PnaQLk,1616
507
507
  reconcile/utils/password_validator.py,sha256=XwuWg-8CPlcuG7dl_oQ1G1h2gSVSnfMym_VkuprpWVg,2183
508
- reconcile/utils/promotion_state.py,sha256=n7OucbDDkK-8OAzAnTWtHXn14amqtZ7cr-h1MJ-I8hc,3176
508
+ reconcile/utils/promotion_state.py,sha256=xveM7-5hIVcTFpHkE9iYctXB9e-7FApUXIeWkoLFkrU,2172
509
509
  reconcile/utils/promtool.py,sha256=IYNCjj5xDAEdxv6Z0pLdrIcybDfHHtWE9Z6f4LSPcG4,2791
510
510
  reconcile/utils/quay_api.py,sha256=EuOegpb-7ntEjkKLFwM2Oo4Nw7SyFtmyl3sQ9aXMtrM,8152
511
511
  reconcile/utils/raw_github_api.py,sha256=ZHC-SZuAyRe1zaMoOU7Krt1-zecDxENd9c_NzQYqK9g,2968
@@ -558,9 +558,9 @@ reconcile/utils/runtime/meta.py,sha256=hQ_jHPY0zbyA08hzpfu4FzOw25NqMg_fgCr2r9gGX
558
558
  reconcile/utils/runtime/runner.py,sha256=72cc-I6yXyPov8UCLHpyERRy1eiMLpGite2roO0yUlo,7979
559
559
  reconcile/utils/runtime/sharding.py,sha256=S43RM_ycFUDVzJD69It91xHZNML_xaAlsbVPR-me5Bk,13638
560
560
  reconcile/utils/saasherder/__init__.py,sha256=J3MBZBFa5YmhqYm08QsjBXz8mFcVOCiOCkyIcw41t7E,343
561
- reconcile/utils/saasherder/interfaces.py,sha256=Hx6PlzGeZ6lJDk-vQcMwV0_LkCG0alta_1jtmvLD5gY,8876
562
- reconcile/utils/saasherder/models.py,sha256=R_6Gx71GnK_eWBG1onBbHfHwkektecKGmMTttbKe33E,4725
563
- reconcile/utils/saasherder/saasherder.py,sha256=v-zZXCIf9riEtXndCO1nlMvR0MrMvEpgiVzmSJs32dE,81152
561
+ reconcile/utils/saasherder/interfaces.py,sha256=gj0ACYSwp21hxTjoF3Ztd4EDLZ55QxBaXYJ3yhIgF94,8691
562
+ reconcile/utils/saasherder/models.py,sha256=pmHYafLyasZHeVz_HvHraIb_9ITj4j6S9K604LRtDHg,4700
563
+ reconcile/utils/saasherder/saasherder.py,sha256=oxUVVMIrORWplGghVRK-29tN-JYH4Boolk20EZtu8FA,80885
564
564
  reconcile/utils/terraform/__init__.py,sha256=zNbiyTWo35AT1sFTElL2j_AA0jJ_yWE_bfFn-nD2xik,250
565
565
  reconcile/utils/terraform/config.py,sha256=5UVrd563TMcvi4ooa5JvWVDW1I3bIWg484u79evfV_8,164
566
566
  reconcile/utils/terraform/config_client.py,sha256=t4novdX7GeYPMYms97C_BBtLmt0M8CJCmCT7QHENwxg,4687
@@ -584,8 +584,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
584
584
  tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
585
585
  tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
586
586
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
587
- qontract_reconcile-0.10.1rc54.dist-info/METADATA,sha256=IWQbTUNeM-DM0NtFQ1WWJ7VyXOJwCxG0ICZLg3bdl1o,2288
588
- qontract_reconcile-0.10.1rc54.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
589
- qontract_reconcile-0.10.1rc54.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
590
- qontract_reconcile-0.10.1rc54.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
591
- qontract_reconcile-0.10.1rc54.dist-info/RECORD,,
587
+ qontract_reconcile-0.10.1rc56.dist-info/METADATA,sha256=RuuTzt9HVECcLVBrn9IPJj-qhBYE2wkAVzy5trzH_QU,2288
588
+ qontract_reconcile-0.10.1rc56.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
589
+ qontract_reconcile-0.10.1rc56.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
590
+ qontract_reconcile-0.10.1rc56.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
591
+ qontract_reconcile-0.10.1rc56.dist-info/RECORD,,
@@ -30,7 +30,6 @@ from reconcile.gql_definitions.fragments.upgrade_policy import (
30
30
  from reconcile.utils.models import (
31
31
  CSV,
32
32
  cron_validator,
33
- data_default_none,
34
33
  )
35
34
  from reconcile.utils.ocm.clusters import (
36
35
  ClusterDetails,
@@ -239,17 +238,19 @@ def _build_org_upgrade_spec(
239
238
  org_labelset = build_labelset(org_labels, OrganizationLabelSet)
240
239
  org_upgrade_spec = OrganizationUpgradeSpec(
241
240
  org=AUSOCMOrganization(
242
- **data_default_none(
243
- AUSOCMOrganization,
244
- dict(
245
- name=org_id,
246
- orgId=org_id,
247
- blockedVersions=org_labelset.blocked_versions,
248
- environment=ocm_env,
249
- addonManagedUpgrades=False,
250
- sectors=org_labelset.sector_dependencies(),
251
- ),
252
- )
241
+ name=org_id,
242
+ orgId=org_id,
243
+ blockedVersions=org_labelset.blocked_versions,
244
+ environment=ocm_env,
245
+ addonManagedUpgrades=False,
246
+ sectors=org_labelset.sector_dependencies(),
247
+ accessTokenClientId=None,
248
+ accessTokenClientSecret=None,
249
+ accessTokenUrl=None,
250
+ addonUpgradeTests=None,
251
+ inheritVersionData=None,
252
+ upgradePolicyAllowedWorkloads=None,
253
+ upgradePolicyClusters=None,
253
254
  )
254
255
  )
255
256
 
@@ -28,19 +28,10 @@ class Publisher:
28
28
  def __init__(
29
29
  self,
30
30
  ref: str,
31
- uid: str,
32
31
  repo_url: str,
33
32
  auth_code: Optional[HasSecret],
34
33
  ):
35
- """Init.
36
-
37
- ref: The target git ref to fetch the commit sha from.
38
- uid: The uid of the saas publisher target.
39
- repo_url: The git repo url of the saas publisher target.
40
- auth_code: The auth code to use to fetch the commit sha.
41
- """
42
34
  self._ref = ref
43
- self._uid = uid
44
35
  self._repo_url = repo_url
45
36
  self._auth_code = auth_code
46
37
  self.channels: set[str] = set()
@@ -60,7 +51,6 @@ class Publisher:
60
51
  promotion_data = deployment_state.get_promotion_data(
61
52
  sha=self.commit_sha,
62
53
  channel=channel,
63
- saas_target_uid=self._uid,
64
54
  )
65
55
  if not (
66
56
  promotion_data
@@ -34,6 +34,25 @@ class SaasFilesInventory:
34
34
  self._assemble_publishers()
35
35
  self._remove_unsupported()
36
36
 
37
+ def _assemble_channels(self) -> None:
38
+ for saas_file in self._saas_files:
39
+ for resource_template in saas_file.resource_templates:
40
+ for target in resource_template.targets:
41
+ if not target.promotion:
42
+ continue
43
+ for publish_channel in target.promotion.publish or []:
44
+ if publish_channel not in self._channels_by_name:
45
+ self._channels_by_name[publish_channel] = Channel(
46
+ name=publish_channel,
47
+ publishers=[],
48
+ )
49
+ for subscribe_channel in target.promotion.subscribe or []:
50
+ if subscribe_channel not in self._channels_by_name:
51
+ self._channels_by_name[subscribe_channel] = Channel(
52
+ name=subscribe_channel,
53
+ publishers=[],
54
+ )
55
+
37
56
  def _assemble_publishers(self) -> None:
38
57
  for saas_file in self._saas_files:
39
58
  for resource_template in saas_file.resource_templates:
@@ -47,7 +66,6 @@ class SaasFilesInventory:
47
66
  )
48
67
  publisher = Publisher(
49
68
  ref=target.ref,
50
- uid=target.uid(saas_file.name, resource_template.name),
51
69
  repo_url=resource_template.url,
52
70
  auth_code=auth_code,
53
71
  )
@@ -131,6 +149,13 @@ class SaasFilesInventory:
131
149
  for subscriber in self.subscribers:
132
150
  is_supported = True
133
151
  for channel in subscriber.channels:
152
+ if len(channel.publishers) > 1:
153
+ logging.error(
154
+ "[%s] We do not support multiple publishers for a single channel - blocked by https://issues.redhat.com/browse/APPSRE-7414",
155
+ channel.name,
156
+ )
157
+ is_supported = False
158
+ break
134
159
  if not channel.publishers:
135
160
  logging.error(
136
161
  "[%s] There must be at least one publisher per channel.",
@@ -138,7 +163,18 @@ class SaasFilesInventory:
138
163
  )
139
164
  is_supported = False
140
165
  break
141
-
166
+ if (
167
+ len(subscriber.config_hashes_by_channel_name.get(channel.name, []))
168
+ > 1
169
+ ):
170
+ logging.error(
171
+ "[%s] We do not support multiple publishers for a single channel - blocked by https://issues.redhat.com/browse/APPSRE-7414",
172
+ channel.name,
173
+ )
174
+ is_supported = False
175
+ break
142
176
  if is_supported:
143
177
  supported_subscribers.append(subscriber)
144
178
  self.subscribers = supported_subscribers
179
+ # Ideally we also remove the publishers that are left w/o subscriber.
180
+ # But lets solve APPSRE-7414 - then it wont be necessary in the first place.
@@ -32,11 +32,6 @@ def saas_files_builder(
32
32
  d["imagePatterns"] = []
33
33
  for rt in d.get("resourceTemplates", []):
34
34
  for t in rt.get("targets", []):
35
- if "parent_saas_file_name" not in t:
36
- t["parent_saas_file_name"] = "saas-file-name"
37
- if "parent_resource_template_name" not in t:
38
- t["parent_resource_template_name"] = "resource-template-name"
39
-
40
35
  ns = t["namespace"]
41
36
  if "name" not in ns:
42
37
  ns["name"] = "some_name"
@@ -41,7 +41,6 @@ def subscriber_builder() -> Callable[[Mapping[str, Any]], Subscriber]:
41
41
  for publisher_name, publisher_data in channel_data.items():
42
42
  publisher = Publisher(
43
43
  ref="",
44
- uid="",
45
44
  repo_url="",
46
45
  auth_code=None,
47
46
  )
@@ -92,8 +92,6 @@ def test_integration_test(
92
92
  "ls": [
93
93
  "/promotions/channel-1/new_sha",
94
94
  "/promotions/channel-2/new_sha",
95
- "/deployments/channel-3/target-uid/new_sha",
96
- "/deployments/channel-4/target-uid/new_sha",
97
95
  ],
98
96
  "get": {
99
97
  "promotions/channel-1/new_sha": {
@@ -106,16 +104,6 @@ def test_integration_test(
106
104
  "target_config_hash": "new_hash",
107
105
  "saas_file": "saas_1",
108
106
  },
109
- "/deployments/channel-3/target-uid/new_sha": {
110
- "success": True,
111
- "target_config_hash": "new_hash",
112
- "saas_file": "saas_1",
113
- },
114
- "/deployments/channel-4/target-uid/new_sha": {
115
- "success": True,
116
- "target_config_hash": "new_hash",
117
- "saas_file": "saas_1",
118
- },
119
107
  },
120
108
  }
121
109
  )
@@ -65,4 +65,6 @@ def test_multiple_publishers_for_single_channel(
65
65
  )
66
66
  inventory = SaasFilesInventory(saas_files=saas_files)
67
67
  assert len(inventory.publishers) == 2
68
- assert len(inventory.subscribers) == 1
68
+ # As of now we do not support this, i.e., all
69
+ # subscribers should be removed from the inventory
70
+ assert len(inventory.subscribers) == 0
@@ -15,7 +15,6 @@ class TestPromotions(TestCase):
15
15
  commit_sha="ahash",
16
16
  saas_file="saas_file",
17
17
  target_config_hash="123123123",
18
- saas_target_uid="saas_target_uid",
19
18
  )
20
19
 
21
20
  expected = {
@@ -51,7 +50,6 @@ class TestPromotions(TestCase):
51
50
  publish=["test-channel"],
52
51
  commit_sha="ahash",
53
52
  target_config_hash="111111111",
54
- saas_target_uid="saas_target_uid",
55
53
  )
56
54
 
57
55
  target_promotion = {
@@ -76,7 +74,6 @@ class TestPromotions(TestCase):
76
74
  commit_sha="ahash",
77
75
  saas_file="saas_file",
78
76
  target_config_hash="111111111",
79
- saas_target_uid="saas_target_uid",
80
77
  )
81
78
 
82
79
  target_promotion = {
@@ -113,7 +110,6 @@ class TestPromotions(TestCase):
113
110
  commit_sha="ahash",
114
111
  saas_file="saas_file",
115
112
  target_config_hash="111111111",
116
- saas_target_uid="saas_target_uid",
117
113
  )
118
114
 
119
115
  target_promotion = {
@@ -146,12 +142,11 @@ class TestPromotions(TestCase):
146
142
  commit_sha="ahash",
147
143
  saas_file="saas_file",
148
144
  target_config_hash="111111111",
149
- saas_target_uid="saas_target_uid",
150
145
  )
151
146
 
152
147
  ap = AutoPromoter([promotion])
153
148
  self.assertEqual(
154
- ap.title, "[auto_promoter] openshift-saas-deploy automated promotion 0a3d57"
149
+ ap.title, "[auto_promoter] openshift-saas-deploy automated promotion 4af7b1"
155
150
  )
156
151
 
157
152
  def test_description_property(self) -> None:
@@ -162,7 +157,6 @@ class TestPromotions(TestCase):
162
157
  commit_sha="ahash",
163
158
  saas_file="saas_file",
164
159
  target_config_hash="111111111",
165
- saas_target_uid="saas_target_uid",
166
160
  )
167
161
 
168
162
  ap = AutoPromoter([promotion])
@@ -176,13 +170,15 @@ class TestPromotions(TestCase):
176
170
  commit_sha="ahash",
177
171
  saas_file="saas_file",
178
172
  target_config_hash="111111111",
179
- saas_target_uid="saas_target_uid",
180
173
  )
181
174
 
182
175
  ap = AutoPromoter([promotion])
183
176
  self.assertTrue(ap.gitlab_data["source_branch"].startswith("auto_promoter-"))
184
177
  self.assertEqual(ap.gitlab_data["target_branch"], "master")
185
- self.assertEqual(ap.gitlab_data["title"], ap.title)
178
+ self.assertEqual(
179
+ ap.gitlab_data["title"],
180
+ "[auto_promoter] openshift-saas-deploy automated promotion 4af7b1",
181
+ )
186
182
  self.assertEqual(
187
183
  ap.gitlab_data["description"], "openshift-saas-deploy automated promotion"
188
184
  )
@@ -197,7 +193,6 @@ class TestPromotions(TestCase):
197
193
  commit_sha="ahash",
198
194
  saas_file="saas_file",
199
195
  target_config_hash="111111111",
200
- saas_target_uid="saas_target_uid",
201
196
  )
202
197
 
203
198
  ap = AutoPromoter([promotion])
@@ -215,7 +210,6 @@ class TestPromotions(TestCase):
215
210
  "subscribe": None,
216
211
  "promotion_data": None,
217
212
  "saas_file_paths": ["destination-saas-file"],
218
- "saas_target_uid": "saas_target_uid",
219
213
  "target_paths": None,
220
214
  }
221
215
  ],
@@ -230,7 +224,6 @@ class TestPromotions(TestCase):
230
224
  commit_sha="ahash",
231
225
  saas_file="saas_file",
232
226
  target_config_hash="111111111",
233
- saas_target_uid="saas_target_uid",
234
227
  promotion_data=[
235
228
  {
236
229
  "channel": "test-channel",
@@ -246,7 +239,7 @@ class TestPromotions(TestCase):
246
239
  )
247
240
 
248
241
  ap = AutoPromoter([promotion])
249
- sqs_json = '{"pr_type": "auto_promoter", "promotions": [{"commit_sha": "ahash", "saas_file": "saas_file", "target_config_hash": "111111111", "saas_target_uid": "saas_target_uid", "auto": true, "publish": ["test-channel"], "subscribe": null, "promotion_data": [{"channel": "test-channel", "data": [{"type": "parent_saas_config", "parent_saas": "saas_file", "target_config_hash": "111111111"}]}], "saas_file_paths": ["destination-saas-file"], "target_paths": null}]}'
242
+ sqs_json = '{"pr_type": "auto_promoter", "promotions": [{"commit_sha": "ahash", "saas_file": "saas_file", "target_config_hash": "111111111", "auto": true, "publish": ["test-channel"], "subscribe": null, "promotion_data": [{"channel": "test-channel", "data": [{"type": "parent_saas_config", "parent_saas": "saas_file", "target_config_hash": "111111111"}]}], "saas_file_paths": ["destination-saas-file"], "target_paths": null}]}'
250
243
  self.assertEqual(json.dumps(ap.sqs_data), sqs_json)
251
244
 
252
245
  def test_init_with_promotion_object(self) -> None:
@@ -257,7 +250,6 @@ class TestPromotions(TestCase):
257
250
  commit_sha="ahash",
258
251
  saas_file="saas_file",
259
252
  target_config_hash="111111111",
260
- saas_target_uid="saas_target_uid",
261
253
  promotion_data=[
262
254
  {
263
255
  "channel": "test-channel",
@@ -284,7 +276,6 @@ class TestPromotions(TestCase):
284
276
  commit_sha="ahash",
285
277
  saas_file="saas_file",
286
278
  target_config_hash="111111111",
287
- saas_target_uid="saas_target_uid",
288
279
  promotion_data=[
289
280
  {
290
281
  "channel": "test-channel",
@@ -28,11 +28,10 @@ from reconcile.gql_definitions.common.saas_files import (
28
28
  SaasResourceTemplateTargetV2_SaasSecretParametersV1,
29
29
  SaasResourceTemplateV2,
30
30
  )
31
- from reconcile.typed_queries.saas_files import SaasFile
32
31
  from reconcile.utils.jjb_client import JJB
33
32
  from reconcile.utils.openshift_resource import ResourceInventory
34
33
  from reconcile.utils.saasherder import SaasHerder
35
- from reconcile.utils.saasherder.interfaces import SaasFile as SaasFileInterface
34
+ from reconcile.utils.saasherder.interfaces import SaasFile
36
35
  from reconcile.utils.saasherder.models import TriggerSpecMovingCommit
37
36
  from reconcile.utils.secret_reader import SecretReaderBase
38
37
 
@@ -608,7 +607,7 @@ class TestPopulateDesiredState(TestCase):
608
607
  self.saasherder.populate_desired_state(ri)
609
608
 
610
609
  cnt = 0
611
- for cluster, namespace, resource_type, data in ri:
610
+ for (cluster, namespace, resource_type, data) in ri:
612
611
  for _, d_item in data["desired"].items():
613
612
  expected = yaml.safe_load(
614
613
  self.fxts.get(
@@ -762,7 +761,7 @@ class TestConfigHashPromotionsValidation(TestCase):
762
761
 
763
762
  def setUp(self) -> None:
764
763
  self.saas_file = self.gql_class_factory( # type: ignore[attr-defined] # it's set in the fixture
765
- SaasFile, Fixtures("saasherder").get_anymarkup("saas.gql.yml")
764
+ SaasFileV2, Fixtures("saasherder").get_anymarkup("saas.gql.yml")
766
765
  )
767
766
  self.all_saas_files = [self.saas_file]
768
767
 
@@ -960,7 +959,7 @@ class TestRemoveNoneAttributes(TestCase):
960
959
 
961
960
 
962
961
  def test_render_templated_parameters(
963
- gql_class_factory: Callable[..., SaasFileInterface]
962
+ gql_class_factory: Callable[..., SaasFile]
964
963
  ) -> None:
965
964
  saas_file = gql_class_factory(
966
965
  SaasFileV2,
@@ -1,4 +1,3 @@
1
- import hashlib
2
1
  import json
3
2
  from collections.abc import Callable
4
3
  from typing import (
@@ -76,13 +75,6 @@ class SaasResourceTemplateTarget(ConfiguredBaseModel):
76
75
  # ignore `namespaceSelector` and 'provider' fields from the GQL schema
77
76
  extra = Extra.ignore
78
77
 
79
- def uid(self, saas_file_name: str, resource_template_name: str) -> str:
80
- """Returns a unique identifier for a target."""
81
- return hashlib.blake2s(
82
- f"{saas_file_name}:{resource_template_name}:{self.name if self.name else 'default'}:{self.namespace.cluster.name}:{self.namespace.name}".encode(),
83
- digest_size=20,
84
- ).hexdigest()
85
-
86
78
 
87
79
  class SaasResourceTemplate(ConfiguredBaseModel):
88
80
  name: str = Field(..., alias="name")
@@ -47,51 +47,28 @@ class PromotionState:
47
47
  """
48
48
  all_keys = self._state.ls()
49
49
  for commit in all_keys:
50
- # for backwards compatibility - remove this after a while
51
- if commit.startswith("/promotions/"):
52
- # Format: /promotions/{channel}/{commit-sha}
53
- _, _, channel_name, commit_sha = commit.split("/")
54
- self._commits_by_channel[channel_name].add(commit_sha)
55
- # / for backwards compatibility - remove this after a while
56
-
57
- # Format: /deployments/{channel}/{saas-target-uid}/{commit-sha}
58
- if not commit.startswith("/deployments/"):
50
+ # Format: /promotions/{channel}/{commit-sha}
51
+ if not commit.startswith("/promotions/"):
59
52
  continue
60
- _, _, channel_name, saas_target_uid, commit_sha = commit.split("/")
61
- self._commits_by_channel[f"{channel_name}/{saas_target_uid}"].add(
62
- commit_sha
63
- )
53
+ _, _, channel_name, commit_sha = commit.split("/")
54
+ self._commits_by_channel[channel_name].add(commit_sha)
64
55
 
65
56
  def get_promotion_data(
66
- self, sha: str, channel: str, saas_target_uid: str, local_lookup: bool = True
57
+ self, sha: str, channel: str, local_lookup: bool = True
67
58
  ) -> Optional[PromotionData]:
68
- if (
69
- local_lookup
70
- and sha not in self._commits_by_channel[channel]
71
- and sha not in self._commits_by_channel[f"{channel}/{saas_target_uid}"]
72
- ):
59
+ if local_lookup and sha not in self._commits_by_channel[channel]:
73
60
  # Lets reduce unecessary calls to S3
74
61
  return None
75
-
76
- # for backwards compatibility - remove this after a while
77
62
  key = f"promotions/{channel}/{sha}"
78
63
  try:
79
64
  data = self._state.get(key)
80
- return PromotionData(**data)
81
- except KeyError:
82
- pass
83
- # / for backwards compatibility - remove this after a while
84
-
85
- key = f"deployments/{channel}/{saas_target_uid}/{sha}"
86
- try:
87
- data = self._state.get(key)
88
- return PromotionData(**data)
89
65
  except KeyError:
90
66
  return None
67
+ return PromotionData(**data)
91
68
 
92
69
  def publish_promotion_data(
93
- self, sha: str, channel: str, saas_target_uid: str, data: PromotionData
70
+ self, sha: str, channel: str, data: PromotionData
94
71
  ) -> None:
95
- state_key = f"deployments/{channel}/{saas_target_uid}/{sha}"
72
+ state_key = f"promotions/{channel}/{sha}"
96
73
  self._state.add(state_key, data.dict(), force=True)
97
74
  logging.info("Uploaded %s to %s", data, state_key)
@@ -332,10 +332,7 @@ class SaasResourceTemplateTarget(HasParameters, HasSecretParameters, Protocol):
332
332
  ...
333
333
 
334
334
  def dict(self, *, by_alias: bool = False) -> dict[str, Any]:
335
- """Return a dictionary representation of the model."""
336
-
337
- def uid(self, saas_file_name: str, resource_template_name: str) -> str:
338
- """Return a unique identifier for the target."""
335
+ ...
339
336
 
340
337
 
341
338
  class SaasResourceTemplate(HasParameters, HasSecretParameters, Protocol):
@@ -167,7 +167,6 @@ class Promotion(BaseModel):
167
167
  commit_sha: str
168
168
  saas_file: str
169
169
  target_config_hash: str
170
- saas_target_uid: str
171
170
  auto: Optional[bool] = None
172
171
  publish: Optional[list[str]] = None
173
172
  subscribe: Optional[list[str]] = None
@@ -996,7 +996,6 @@ class SaasHerder: # pylint: disable=too-many-public-methods
996
996
  commit_sha=commit_sha,
997
997
  saas_file=saas_file_name,
998
998
  target_config_hash=target_config_hash,
999
- saas_target_uid=target.uid(saas_file_name, resource_template_name),
1000
999
  )
1001
1000
  return resources, html_url, target_promotion
1002
1001
 
@@ -1769,10 +1768,7 @@ class SaasHerder: # pylint: disable=too-many-public-methods
1769
1768
  if promotion.subscribe:
1770
1769
  for channel in promotion.subscribe:
1771
1770
  info = self._promotion_state.get_promotion_data(
1772
- sha=promotion.commit_sha,
1773
- channel=channel,
1774
- saas_target_uid=promotion.saas_target_uid,
1775
- local_lookup=False,
1771
+ sha=promotion.commit_sha, channel=channel, local_lookup=False
1776
1772
  )
1777
1773
  if not (info and info.success):
1778
1774
  logging.error(
@@ -1864,7 +1860,6 @@ class SaasHerder: # pylint: disable=too-many-public-methods
1864
1860
  self._promotion_state.publish_promotion_data(
1865
1861
  sha=promotion.commit_sha,
1866
1862
  channel=channel,
1867
- saas_target_uid=promotion.saas_target_uid,
1868
1863
  data=PromotionData(
1869
1864
  saas_file=promotion.saas_file,
1870
1865
  success=success,