qontract-reconcile 0.10.1rc1115__py3-none-any.whl → 0.10.1rc1116__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.1rc1115
3
+ Version: 0.10.1rc1116
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
@@ -30,7 +30,7 @@ reconcile/github_repo_permissions_validator.py,sha256=dcbXdUx6imjNchjp3pg9-z1i7l
30
30
  reconcile/github_users.py,sha256=nfTq78QRONIfDVj-5O3bD6psllJjzWFnog-EJ1WqFPU,3672
31
31
  reconcile/github_validator.py,sha256=cVTVxJIGR4a1Jz8wrdXEAb_CMpXUzvykVmUURX4cook,917
32
32
  reconcile/gitlab_fork_compliance.py,sha256=5joAIGOOLhHme1ipa7ZQeQkUOVe3dKbRO1wJtTwyNR4,4178
33
- reconcile/gitlab_housekeeping.py,sha256=fgmR_Q-RHchGhYky-Q78f0Wzx4xQ_mk8-0mpDgfFsMI,22193
33
+ reconcile/gitlab_housekeeping.py,sha256=YAzwk7tZDlw918PjokQksqYJQBUkjouhMpDxIwDdTY0,22208
34
34
  reconcile/gitlab_labeler.py,sha256=4xJHmVX155fclrHqkR926sL1GH6RTN5XfZ8PnqNXbRA,4534
35
35
  reconcile/gitlab_members.py,sha256=PrJE9OhDRdGG_gHM_77nQojLb4B18jtUu8DxgLsRS88,8417
36
36
  reconcile/gitlab_mr_sqs_consumer.py,sha256=O46mdziPgGOndbU-0_UJKJVUaiEoVzJPEgKm4_UvYoI,2571
@@ -869,8 +869,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
869
869
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
870
870
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
871
871
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
872
- qontract_reconcile-0.10.1rc1115.dist-info/METADATA,sha256=7Qo-iWGfVILkQKNBZ3KcqKtqjd8P6UXZDtKW1FzjKfw,2213
873
- qontract_reconcile-0.10.1rc1115.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
- qontract_reconcile-0.10.1rc1115.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
- qontract_reconcile-0.10.1rc1115.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
- qontract_reconcile-0.10.1rc1115.dist-info/RECORD,,
872
+ qontract_reconcile-0.10.1rc1116.dist-info/METADATA,sha256=FuJrNLTiKxo9O9hatAzIX5lB3r7V_KZNiDDpnB1OuCw,2213
873
+ qontract_reconcile-0.10.1rc1116.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
+ qontract_reconcile-0.10.1rc1116.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
+ qontract_reconcile-0.10.1rc1116.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
+ qontract_reconcile-0.10.1rc1116.dist-info/RECORD,,
@@ -99,7 +99,7 @@ merge_requests_waiting = Gauge(
99
99
  gitlab_token_expiration = Gauge(
100
100
  name="qontract_reconcile_gitlab_token_expiration_days",
101
101
  documentation="Time until personal access tokens expire",
102
- labelnames=["name", "active"],
102
+ labelnames=["name"],
103
103
  )
104
104
 
105
105
 
@@ -557,12 +557,14 @@ def get_app_sre_usernames(gl: GitLabApi) -> set[str]:
557
557
 
558
558
  def publish_access_token_expiration_metrics(gl: GitLabApi) -> None:
559
559
  pats = gl.get_personal_access_tokens()
560
+
560
561
  for pat in pats:
561
- expiration_date = datetime.strptime(pat.expires_at, EXPIRATION_DATE_FORMAT)
562
- days_until_expiration = expiration_date.date() - datetime.now(UTC).date()
563
- gitlab_token_expiration.labels(name=pat.name, active=pat.active).set(
564
- days_until_expiration.days
565
- )
562
+ if pat.active:
563
+ expiration_date = datetime.strptime(pat.expires_at, EXPIRATION_DATE_FORMAT)
564
+ days_until_expiration = expiration_date.date() - datetime.now(UTC).date()
565
+ gitlab_token_expiration.labels(name=pat.name).set(
566
+ days_until_expiration.days
567
+ )
566
568
 
567
569
 
568
570
  def run(dry_run, wait_for_pipeline):