qontract-reconcile 0.10.1rc1071__py3-none-any.whl → 0.10.1rc1072__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.1rc1071
3
+ Version: 0.10.1rc1072
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
@@ -161,7 +161,7 @@ reconcile/aws_version_sync/merge_request_manager/merge_request_manager.py,sha256
161
161
  reconcile/change_owners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
162
162
  reconcile/change_owners/approver.py,sha256=Z3_11vnK2WNOxjEEXVDh0224-_-qbt9d6mBeVE-7fsc,2259
163
163
  reconcile/change_owners/bundle.py,sha256=ZIlXRo6Z2raeWSCUqYsexBdol-q-r9kWJs5O_YPaEYk,5273
164
- reconcile/change_owners/change_log_tracking.py,sha256=XE-DbH3ktABaeEVdP6EoVsI6s3Nk21l6WKbHd3zMouM,5555
164
+ reconcile/change_owners/change_log_tracking.py,sha256=dmjtD1zJ7tFC355fe82pmqChQdkIJjXAmcsqqwbLWuA,5834
165
165
  reconcile/change_owners/change_owners.py,sha256=0HRJhDm0oW3uYJFgzynqA1gA0lbhalhSkmWOiQmr-NM,17062
166
166
  reconcile/change_owners/change_types.py,sha256=TjVtvmkU0s8w2NA6qvWQccB6PwlCrChFySlsHLYZjpE,32027
167
167
  reconcile/change_owners/changes.py,sha256=pa3cNAL-Xawh700ARJJQjY0p09NA1J2329RcE0F0MHM,17224
@@ -839,7 +839,7 @@ tools/app_interface_metrics_exporter.py,sha256=zkwkxdAUAxjdc-pzx2_oJXG25fo0Fnyd5
839
839
  tools/app_interface_reporter.py,sha256=oZPib4HPq0aZ2Zui1QGJGk6qQdfpeihujGDBnSdKyGE,17627
840
840
  tools/glitchtip_access_reporter.py,sha256=oPBnk_YoDuljU3v0FaChzOwwnk4vap1xEE67QEjzdqs,2948
841
841
  tools/glitchtip_access_revalidation.py,sha256=8kbBJk04mkq28kWoRDDkfCGIF3GRg3pJrFAh1sW0dbk,2821
842
- tools/qontract_cli.py,sha256=02oYg1l8ADkfGIH1QxkUvBs72Itu_LXM4gMu39GI3E4,130479
842
+ tools/qontract_cli.py,sha256=b-CcgDr-o91gRCxiKka3MrbP9Pb9FjW5VcdyxuPzg3k,130544
843
843
  tools/sd_app_sre_alert_report.py,sha256=e9vAdyenUz2f5c8-z-5WY0wv-SJ9aePKDH2r4IwB6pc,5063
844
844
  tools/template_validation.py,sha256=qpKYaTgk0GOPGa2Ct5_5sKdwIHtCAKIBGzsMPuJU5fw,3371
845
845
  tools/cli_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -870,8 +870,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
870
870
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
871
871
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
872
872
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
873
- qontract_reconcile-0.10.1rc1071.dist-info/METADATA,sha256=lkxennEtXd4pdqXqbrgp94jY5GLsnJV84np3cwcm5zs,2213
874
- qontract_reconcile-0.10.1rc1071.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
875
- qontract_reconcile-0.10.1rc1071.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
876
- qontract_reconcile-0.10.1rc1071.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
877
- qontract_reconcile-0.10.1rc1071.dist-info/RECORD,,
873
+ qontract_reconcile-0.10.1rc1072.dist-info/METADATA,sha256=3DGV1p_ONSF7YyGVdoAzLKcLRzCKpxc2Ta2HufdLsJM,2213
874
+ qontract_reconcile-0.10.1rc1072.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
875
+ qontract_reconcile-0.10.1rc1072.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
876
+ qontract_reconcile-0.10.1rc1072.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
877
+ qontract_reconcile-0.10.1rc1072.dist-info/RECORD,,
@@ -15,6 +15,7 @@ from reconcile.change_owners.changes import aggregate_file_moves, parse_bundle_c
15
15
  from reconcile.typed_queries.apps import get_apps
16
16
  from reconcile.utils import gql
17
17
  from reconcile.utils.defer import defer
18
+ from reconcile.utils.gitlab_api import MRState
18
19
  from reconcile.utils.runtime.integration import (
19
20
  PydanticRunParams,
20
21
  QontractReconcileIntegration,
@@ -28,7 +29,7 @@ BUNDLE_DIFFS_OBJ = "bundle-diffs.json"
28
29
  @dataclass
29
30
  class ChangeLogItem:
30
31
  commit: str
31
- created_at: str
32
+ merged_at: str
32
33
  change_types: list[str] = field(default_factory=list)
33
34
  error: bool = False
34
35
  apps: list[str] = field(default_factory=list)
@@ -101,9 +102,15 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
101
102
 
102
103
  logging.info(f"Processing commit {commit}")
103
104
  gl_commit = gl.project.commits.get(commit)
105
+ merged_at = max(
106
+ mr["merged_at"]
107
+ for mr in gl_commit.merge_requests()
108
+ if mr["state"] == MRState.MERGED
109
+ and mr["target_branch"] == gl.project.default_branch
110
+ )
104
111
  change_log_item = ChangeLogItem(
105
112
  commit=commit,
106
- created_at=gl_commit.created_at,
113
+ merged_at=merged_at,
107
114
  )
108
115
  change_log.items.append(change_log_item)
109
116
  obj = diff_state.get(key, None)
@@ -146,7 +153,7 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
146
153
  change_log_item.change_types.append(ctp.name)
147
154
 
148
155
  change_log.items = sorted(
149
- change_log.items, key=lambda i: i.created_at, reverse=True
156
+ change_log.items, key=lambda i: i.merged_at, reverse=True
150
157
  )
151
158
  if not dry_run:
152
159
  integration_state.add(BUNDLE_DIFFS_OBJ, asdict(change_log), force=True)
tools/qontract_cli.py CHANGED
@@ -2903,13 +2903,14 @@ def change_log_tracking(ctx):
2903
2903
  ]
2904
2904
  item = {
2905
2905
  "commit": f"[{commit}]({repo_url}/commit/{commit})",
2906
+ "merged_at": change_log_item.merged_at,
2906
2907
  "apps": ", ".join(change_log_item.apps),
2907
2908
  "changes": ", ".join(covered_change_types_descriptions),
2908
2909
  "error": change_log_item.error,
2909
2910
  }
2910
2911
  data.append(item)
2911
2912
 
2912
- columns = ["commit", "apps", "changes", "error"]
2913
+ columns = ["commit", "merged_at", "apps", "changes", "error"]
2913
2914
  print_output(ctx.obj["options"], data, columns)
2914
2915
 
2915
2916