qontract-reconcile 0.10.1rc882__py3-none-any.whl → 0.10.1rc883__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.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/RECORD +7 -7
- reconcile/glitchtip_project_alerts/integration.py +50 -23
- reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py +25 -5
- {qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.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.1rc883
|
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.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/RECORD
RENAMED
@@ -197,7 +197,7 @@ reconcile/glitchtip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
197
197
|
reconcile/glitchtip/integration.py,sha256=SCfdllg0cywCyLKCA66yUm9Z_Sb8t5E0jDEKdwRk6HI,8372
|
198
198
|
reconcile/glitchtip/reconciler.py,sha256=nUvDv7qG1ly0cA16MmlL6NV71yl1mJYLT2mui7lmi0Y,12402
|
199
199
|
reconcile/glitchtip_project_alerts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
200
|
-
reconcile/glitchtip_project_alerts/integration.py,sha256=
|
200
|
+
reconcile/glitchtip_project_alerts/integration.py,sha256=VFvKHso8CgsvRT8Bv5ASSehOtE39w8Cvy9SaNSgPIM0,13846
|
201
201
|
reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
202
202
|
reconcile/glitchtip_project_dsn/integration.py,sha256=5c8RVIO3Wjz2kBfB52EmxZ6VP2JQ1rLGMM9lybNhdAE,8109
|
203
203
|
reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -311,7 +311,7 @@ reconcile/gql_definitions/glitchtip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
311
311
|
reconcile/gql_definitions/glitchtip/glitchtip_instance.py,sha256=QUfLhRkdE_-SorWgLBB8LHFD6kihbFwEoVByCLax3yM,2781
|
312
312
|
reconcile/gql_definitions/glitchtip/glitchtip_project.py,sha256=AojrkCDGbVjY0TOkfookz-9tqLA9txY7_xNdsWe174c,6004
|
313
313
|
reconcile/gql_definitions/glitchtip_project_alerts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
314
|
-
reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py,sha256=
|
314
|
+
reconcile/gql_definitions/glitchtip_project_alerts/glitchtip_project.py,sha256=Pv6RcuIzpNmGc43eEq64nnKG0Dr7H0wjy5Xg1_oRltM,5197
|
315
315
|
reconcile/gql_definitions/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
316
|
reconcile/gql_definitions/integrations/integrations.py,sha256=LfpgVbCCCk20ohwP5pDea5fwxMFGrcgE6J_WHBuGqek,11595
|
317
317
|
reconcile/gql_definitions/jenkins_configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -838,8 +838,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
|
|
838
838
|
tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jrss,4941
|
839
839
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
840
840
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
841
|
-
qontract_reconcile-0.10.
|
842
|
-
qontract_reconcile-0.10.
|
843
|
-
qontract_reconcile-0.10.
|
844
|
-
qontract_reconcile-0.10.
|
845
|
-
qontract_reconcile-0.10.
|
841
|
+
qontract_reconcile-0.10.1rc883.dist-info/METADATA,sha256=AKEYLPW_CulRDgZJEvwVpBQkIh4k2QvbPHq-QYXjQv4,2273
|
842
|
+
qontract_reconcile-0.10.1rc883.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
843
|
+
qontract_reconcile-0.10.1rc883.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
|
844
|
+
qontract_reconcile-0.10.1rc883.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
845
|
+
qontract_reconcile-0.10.1rc883.dist-info/RECORD,,
|
@@ -123,30 +123,16 @@ class GlitchtipProjectAlertsIntegration(
|
|
123
123
|
)
|
124
124
|
)
|
125
125
|
if glitchtip_project.jira and gjb_alert_url:
|
126
|
-
|
127
|
-
if
|
128
|
-
|
129
|
-
elif (
|
130
|
-
glitchtip_project.jira.board
|
131
|
-
and integration_is_enabled(
|
132
|
-
QONTRACT_INTEGRATION, glitchtip_project.jira.board
|
133
|
-
)
|
134
|
-
and integration_is_enabled(
|
135
|
-
jira_permissions_validator.QONTRACT_INTEGRATION,
|
136
|
-
glitchtip_project.jira.board,
|
137
|
-
)
|
138
|
-
):
|
139
|
-
jira_project_key = glitchtip_project.jira.board.name
|
126
|
+
params: dict[str, str | list[str]] = {}
|
127
|
+
token_params = {"token": gjb_token} if gjb_token else {}
|
128
|
+
alert_labels = glitchtip_project.jira.labels or []
|
140
129
|
|
141
|
-
if
|
142
|
-
params
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
url = (
|
148
|
-
f"{gjb_alert_url}/{jira_project_key}?{urlencode(params, True)}"
|
149
|
-
)
|
130
|
+
if glitchtip_project.jira.project:
|
131
|
+
params = {
|
132
|
+
"labels": alert_labels,
|
133
|
+
"components": glitchtip_project.jira.components or [],
|
134
|
+
} | token_params
|
135
|
+
url = f"{gjb_alert_url}/{glitchtip_project.jira.project}?{urlencode(params, True)}"
|
150
136
|
alerts.append(
|
151
137
|
ProjectAlert(
|
152
138
|
name=GJB_ALERT_NAME,
|
@@ -160,6 +146,47 @@ class GlitchtipProjectAlertsIntegration(
|
|
160
146
|
],
|
161
147
|
)
|
162
148
|
)
|
149
|
+
|
150
|
+
elif (
|
151
|
+
glitchtip_project.jira.escalation_policy
|
152
|
+
and glitchtip_project.jira.escalation_policy.channels.jira_board
|
153
|
+
):
|
154
|
+
# definition via escalation policy
|
155
|
+
channels = glitchtip_project.jira.escalation_policy.channels
|
156
|
+
for board in channels.jira_board:
|
157
|
+
if not integration_is_enabled(
|
158
|
+
QONTRACT_INTEGRATION, board
|
159
|
+
) or not integration_is_enabled(
|
160
|
+
jira_permissions_validator.QONTRACT_INTEGRATION, board
|
161
|
+
):
|
162
|
+
continue
|
163
|
+
params = {
|
164
|
+
"labels": alert_labels + (channels.jira_labels or []),
|
165
|
+
"components": [channels.jira_component]
|
166
|
+
if channels.jira_component
|
167
|
+
else [],
|
168
|
+
} | token_params
|
169
|
+
if board.issue_type:
|
170
|
+
params["issue_type"] = board.issue_type
|
171
|
+
url = f"{gjb_alert_url}/{board.name}?{urlencode(params, True)}"
|
172
|
+
alerts.append(
|
173
|
+
ProjectAlert(
|
174
|
+
name=GJB_ALERT_NAME,
|
175
|
+
timespan_minutes=1,
|
176
|
+
quantity=1,
|
177
|
+
recipients=[
|
178
|
+
ProjectAlertRecipient(
|
179
|
+
recipient_type=RecipientType.WEBHOOK,
|
180
|
+
url=url,
|
181
|
+
)
|
182
|
+
],
|
183
|
+
)
|
184
|
+
)
|
185
|
+
else:
|
186
|
+
raise ValueError(
|
187
|
+
"Jira integration requires either project or escalation policy to be set"
|
188
|
+
)
|
189
|
+
|
163
190
|
# check for duplicates
|
164
191
|
if not webhook_urls_are_unique(alerts):
|
165
192
|
raise ValueError(
|
@@ -58,10 +58,18 @@ query GlitchtipProjectsWithAlerts {
|
|
58
58
|
}
|
59
59
|
jira {
|
60
60
|
project
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
components
|
62
|
+
escalationPolicy {
|
63
|
+
channels {
|
64
|
+
jiraBoard {
|
65
|
+
name
|
66
|
+
issueType
|
67
|
+
disable {
|
68
|
+
integrations
|
69
|
+
}
|
70
|
+
}
|
71
|
+
jiraComponent
|
72
|
+
jiraLabels
|
65
73
|
}
|
66
74
|
}
|
67
75
|
labels
|
@@ -113,12 +121,24 @@ class DisableJiraBoardAutomationsV1(ConfiguredBaseModel):
|
|
113
121
|
|
114
122
|
class JiraBoardV1(ConfiguredBaseModel):
|
115
123
|
name: str = Field(..., alias="name")
|
124
|
+
issue_type: Optional[str] = Field(..., alias="issueType")
|
116
125
|
disable: Optional[DisableJiraBoardAutomationsV1] = Field(..., alias="disable")
|
117
126
|
|
118
127
|
|
128
|
+
class AppEscalationPolicyChannelsV1(ConfiguredBaseModel):
|
129
|
+
jira_board: list[JiraBoardV1] = Field(..., alias="jiraBoard")
|
130
|
+
jira_component: Optional[str] = Field(..., alias="jiraComponent")
|
131
|
+
jira_labels: Optional[list[str]] = Field(..., alias="jiraLabels")
|
132
|
+
|
133
|
+
|
134
|
+
class AppEscalationPolicyV1(ConfiguredBaseModel):
|
135
|
+
channels: AppEscalationPolicyChannelsV1 = Field(..., alias="channels")
|
136
|
+
|
137
|
+
|
119
138
|
class GlitchtipProjectJiraV1(ConfiguredBaseModel):
|
120
139
|
project: Optional[str] = Field(..., alias="project")
|
121
|
-
|
140
|
+
components: Optional[list[str]] = Field(..., alias="components")
|
141
|
+
escalation_policy: Optional[AppEscalationPolicyV1] = Field(..., alias="escalationPolicy")
|
122
142
|
labels: Optional[list[str]] = Field(..., alias="labels")
|
123
143
|
|
124
144
|
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc882.dist-info → qontract_reconcile-0.10.1rc883.dist-info}/top_level.txt
RENAMED
File without changes
|