qontract-reconcile 0.10.1rc1060__py3-none-any.whl → 0.10.1rc1061__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.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/RECORD +7 -7
- reconcile/slack_usergroups.py +35 -21
- reconcile/test/test_slack_usergroups.py +23 -0
- {qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.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.1rc1061
|
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.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/RECORD
RENAMED
@@ -104,7 +104,7 @@ reconcile/sendgrid_teammates.py,sha256=oO8QbLb4s1o8A6CGiCagN9CmS05BSS_WLztuY0Ym9
|
|
104
104
|
reconcile/service_dependencies.py,sha256=PMKP9vc6oL-78rzyF_RE8DzLSQMSqN8vCqt9sWpBLAM,4470
|
105
105
|
reconcile/signalfx_endpoint_monitoring.py,sha256=Nqgsg1cflSd2nNnm89y_e8c--7xLUqTrKOHkDs-qADE,2868
|
106
106
|
reconcile/slack_base.py,sha256=8FqwMJ5SkoRyDJ9iPfZogWkC9QRoTouMCnGUevV_GME,3447
|
107
|
-
reconcile/slack_usergroups.py,sha256=
|
107
|
+
reconcile/slack_usergroups.py,sha256=ebCMtgpap6i_IUFFTuXU52MdkAXxSRG1bAcDPj64OIg,30083
|
108
108
|
reconcile/sql_query.py,sha256=pH-EHkXiDknn8ZNXVqRZeqFc3sKhu2nhsaykgSytbS8,25895
|
109
109
|
reconcile/status.py,sha256=cY4IJFXemhxptRJqR4qaaOWqei9e4jgLXuVSGajMsjg,544
|
110
110
|
reconcile/status_board.py,sha256=YeoE7kLf1YKpOdN32u3vqhuSI46ep5N_qcVWC1CBCf8,8635
|
@@ -557,7 +557,7 @@ reconcile/test/test_saasherder.py,sha256=-WGgAsrTm_SJ0OQDLXd4JwEu1Mc6i4AePJqjZQT
|
|
557
557
|
reconcile/test/test_saasherder_allowed_secret_paths.py,sha256=5NHQwNJO66at6HiyMZ5sVRTQDwxdvlOQo0KmkBWCw5Q,4853
|
558
558
|
reconcile/test/test_secret_reader.py,sha256=kz7nzcPjvA08cytnvcA_PMA98AEyqJWsESkYeRn5xCk,4994
|
559
559
|
reconcile/test/test_slack_base.py,sha256=pTUGvJ2S2wF3PhJyGWmiNXG52QtXKy2cbu-G8Ymrv6I,5019
|
560
|
-
reconcile/test/test_slack_usergroups.py,sha256=
|
560
|
+
reconcile/test/test_slack_usergroups.py,sha256=OkD2sgTwUp6kahzL0oQM37Q7YNZHsS04hD2yV9skXhQ,25642
|
561
561
|
reconcile/test/test_sql_query.py,sha256=4EfcLH0y3B4d11IEoue5dgA-h6f9pP5xiMCIdILSJaE,11022
|
562
562
|
reconcile/test/test_status_board.py,sha256=o4jTZLtBFJN9FBmaHHkVGGPFSONLoB-P1xCX8giIBLw,7852
|
563
563
|
reconcile/test/test_terraform_aws_route53.py,sha256=xHggb8K1P76OyCfFcogbkmyKle-NlUylcbDnuv3IqvY,771
|
@@ -867,8 +867,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
|
|
867
867
|
tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
|
868
868
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
869
869
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
870
|
-
qontract_reconcile-0.10.
|
871
|
-
qontract_reconcile-0.10.
|
872
|
-
qontract_reconcile-0.10.
|
873
|
-
qontract_reconcile-0.10.
|
874
|
-
qontract_reconcile-0.10.
|
870
|
+
qontract_reconcile-0.10.1rc1061.dist-info/METADATA,sha256=h9WxXliU1mlCQK_rTCcdKt6xDFcUTN2z9AdiP-QeRzU,2213
|
871
|
+
qontract_reconcile-0.10.1rc1061.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
872
|
+
qontract_reconcile-0.10.1rc1061.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
|
873
|
+
qontract_reconcile-0.10.1rc1061.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
874
|
+
qontract_reconcile-0.10.1rc1061.dist-info/RECORD,,
|
reconcile/slack_usergroups.py
CHANGED
@@ -420,28 +420,13 @@ def get_desired_state(
|
|
420
420
|
not in managed usergroups {p.workspace.managed_usergroups}"
|
421
421
|
)
|
422
422
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
pagerduty_map=pagerduty_map,
|
429
|
-
)
|
430
|
-
all_user_names.extend(slack_usernames_pagerduty)
|
431
|
-
|
432
|
-
if p.owners_from_repos:
|
433
|
-
slack_usernames_repo = get_slack_usernames_from_owners(
|
434
|
-
p.owners_from_repos, users, usergroup
|
435
|
-
)
|
436
|
-
all_user_names.extend(slack_usernames_repo)
|
437
|
-
|
438
|
-
if p.schedule:
|
439
|
-
slack_usernames_schedule = get_slack_usernames_from_schedule(
|
440
|
-
p.schedule.schedule
|
423
|
+
try:
|
424
|
+
user_names = _get_user_names(p, pagerduty_map, usergroup, users)
|
425
|
+
except Exception:
|
426
|
+
logging.exception(
|
427
|
+
f"Error getting user names for {p.workspace.name} #{usergroup}, skipping"
|
441
428
|
)
|
442
|
-
|
443
|
-
|
444
|
-
user_names = set(all_user_names)
|
429
|
+
continue
|
445
430
|
|
446
431
|
try:
|
447
432
|
desired_state[p.workspace.name][usergroup].user_names.update(user_names)
|
@@ -456,6 +441,35 @@ def get_desired_state(
|
|
456
441
|
return desired_state
|
457
442
|
|
458
443
|
|
444
|
+
def _get_user_names(
|
445
|
+
permission: PermissionSlackUsergroupV1,
|
446
|
+
pagerduty_map: PagerDutyMap,
|
447
|
+
usergroup: str,
|
448
|
+
users: Iterable[User],
|
449
|
+
) -> set[str]:
|
450
|
+
user_names = {
|
451
|
+
get_slack_username(u) for r in permission.roles or [] for u in r.users
|
452
|
+
}
|
453
|
+
slack_usernames_pagerduty = get_usernames_from_pagerduty(
|
454
|
+
pagerduties=permission.pagerduty or [],
|
455
|
+
users=users,
|
456
|
+
usergroup=usergroup,
|
457
|
+
pagerduty_map=pagerduty_map,
|
458
|
+
)
|
459
|
+
user_names.update(slack_usernames_pagerduty)
|
460
|
+
if permission.owners_from_repos:
|
461
|
+
slack_usernames_repo = get_slack_usernames_from_owners(
|
462
|
+
permission.owners_from_repos, users, usergroup
|
463
|
+
)
|
464
|
+
user_names.update(slack_usernames_repo)
|
465
|
+
if permission.schedule:
|
466
|
+
slack_usernames_schedule = get_slack_usernames_from_schedule(
|
467
|
+
permission.schedule.schedule
|
468
|
+
)
|
469
|
+
user_names.update(slack_usernames_schedule)
|
470
|
+
return user_names
|
471
|
+
|
472
|
+
|
459
473
|
def get_desired_state_cluster_usergroups(
|
460
474
|
slack_map: SlackMap,
|
461
475
|
clusters: Iterable[ClusterV1],
|
@@ -435,6 +435,29 @@ def test_get_desired_state(
|
|
435
435
|
}
|
436
436
|
|
437
437
|
|
438
|
+
def test_get_desired_state_with_error(
|
439
|
+
mocker: MockerFixture,
|
440
|
+
permissions: Sequence[PermissionSlackUsergroupV1],
|
441
|
+
user: UserV1,
|
442
|
+
) -> None:
|
443
|
+
mocker.patch(
|
444
|
+
"reconcile.slack_usergroups.get_usernames_from_pagerduty"
|
445
|
+
).return_value = ["user1"]
|
446
|
+
mocker.patch(
|
447
|
+
"reconcile.slack_usergroups.get_slack_usernames_from_owners"
|
448
|
+
).side_effect = Exception("some error")
|
449
|
+
mock_pagerduty_map = create_autospec(PagerDutyMap)
|
450
|
+
result = integ.get_desired_state(
|
451
|
+
mock_pagerduty_map,
|
452
|
+
permissions[1:],
|
453
|
+
[user],
|
454
|
+
desired_workspace_name=None,
|
455
|
+
desired_usergroup_name=None,
|
456
|
+
)
|
457
|
+
|
458
|
+
assert result == {}
|
459
|
+
|
460
|
+
|
438
461
|
def test_get_desired_state_cluster_usergroups(
|
439
462
|
mocker: MockerFixture, slack_map: SlackMap, user: UserV1
|
440
463
|
) -> None:
|
{qontract_reconcile-0.10.1rc1060.dist-info → qontract_reconcile-0.10.1rc1061.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|