qontract-reconcile 0.10.1rc1123__py3-none-any.whl → 0.10.1rc1124__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.1rc1123
3
+ Version: 0.10.1rc1124
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=h30fU-JmLH5a-rCAovpzTeTkkkgZztsZ5A2raee0YuU,5355
164
- reconcile/change_owners/change_log_tracking.py,sha256=3cIS-evZbU1SGkFzKDa7y9GL6uvSBZ0xbTl_qiqp4ss,7937
164
+ reconcile/change_owners/change_log_tracking.py,sha256=kmGRDHwXmhR8nkhbWBXLEim7psEiDbgaviaO7aGQ0Dc,8673
165
165
  reconcile/change_owners/change_owners.py,sha256=0HRJhDm0oW3uYJFgzynqA1gA0lbhalhSkmWOiQmr-NM,17062
166
166
  reconcile/change_owners/change_types.py,sha256=HEsoBduhcczAXZHwT26mr5sVPxtf8J6tsvjSDDI1ceI,32077
167
167
  reconcile/change_owners/changes.py,sha256=YblT-JPFagctTphzd38SjVmj3k1YsgMzN48zGpnLYKM,18222
@@ -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.1rc1123.dist-info/METADATA,sha256=QPnwh45NAXdasJR2bqLK6ApW8ouYVsdq-YCDd2EWCwY,2213
873
- qontract_reconcile-0.10.1rc1123.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
- qontract_reconcile-0.10.1rc1123.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
- qontract_reconcile-0.10.1rc1123.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
- qontract_reconcile-0.10.1rc1123.dist-info/RECORD,,
872
+ qontract_reconcile-0.10.1rc1124.dist-info/METADATA,sha256=U-g8D9p9PHLNvvdvnP8L0KXkA5inZmNFT8E-jEkRx-8,2213
873
+ qontract_reconcile-0.10.1rc1124.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
874
+ qontract_reconcile-0.10.1rc1124.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
875
+ qontract_reconcile-0.10.1rc1124.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
876
+ qontract_reconcile-0.10.1rc1124.dist-info/RECORD,,
@@ -46,6 +46,14 @@ class ChangeLogItem:
46
46
  class ChangeLog:
47
47
  items: list[ChangeLogItem] = field(default_factory=list)
48
48
 
49
+ @property
50
+ def apps(self) -> set[str]:
51
+ return {app for item in self.items for app in item.apps}
52
+
53
+ @property
54
+ def change_types(self) -> set[str]:
55
+ return {change_type for item in self.items for change_type in item.change_types}
56
+
49
57
 
50
58
  class ChangeLogIntegrationParams(PydanticRunParams):
51
59
  gitlab_project_id: str
@@ -160,14 +168,19 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
160
168
  | "/dependencies/status-page-component-1.yml"
161
169
  | "/app-sre/app-changelog-1.yml"
162
170
  ):
163
- changed_apps = {
164
- name
165
- for c in change_versions
166
- if (app := c["app"])
167
- and (app_path := app.get("$ref") or app.get("path"))
168
- and (name := app_name_by_path.get(app_path))
169
- }
170
- change_log_item.apps.extend(changed_apps)
171
+ for c in change_versions:
172
+ c_app: dict[str, str] = c["app"]
173
+ app_path = c_app.get("$ref") or c_app.get("path")
174
+ if not app_path:
175
+ raise KeyError(
176
+ f"app path is expected. missing in query? app information: {c_app}"
177
+ )
178
+ app_name = app_name_by_path.get(app_path)
179
+ if not app_name:
180
+ raise KeyError(
181
+ f"app name is expected. missing in query? app information: {c_app}"
182
+ )
183
+ change_log_item.apps.append(app_name)
171
184
  case "/openshift/cluster-1.yml":
172
185
  changed_apps = {
173
186
  name
@@ -203,6 +216,9 @@ class ChangeLogIntegration(QontractReconcileIntegration[ChangeLogIntegrationPara
203
216
  )
204
217
  )
205
218
 
219
+ logging.info(f"apps: {change_log.apps}")
220
+ logging.info(f"change_types: {change_log.change_types}")
221
+
206
222
  change_log.items = sorted(
207
223
  change_log.items, key=lambda i: i.merged_at, reverse=True
208
224
  )