qontract-reconcile 0.10.1rc665__py3-none-any.whl → 0.10.1rc666__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.1rc665
3
+ Version: 0.10.1rc666
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
@@ -45,7 +45,7 @@ reconcile/jenkins_roles.py,sha256=f8ELpZY36UjoaCpR_9LijQuIMuB6a7sVLFf_H1ct9Hc,44
45
45
  reconcile/jenkins_webhooks.py,sha256=j8vhJMWcRhOdc9XzRSm0CPj84jsF3e4Syjm7r1BIsDE,1978
46
46
  reconcile/jenkins_webhooks_cleaner.py,sha256=JsN_NVPfZJwv1JtSzZXDIHUqGiefL-DRffFnDGau9aY,1539
47
47
  reconcile/jenkins_worker_fleets.py,sha256=PMNGOX0krubFjInPiFT0za0KCiWBLEcVDuXdKRd1BrE,5378
48
- reconcile/jira_permissions_validator.py,sha256=tdzi1YX1BdwReY6tF9qhPEti_Ca8UB3Kn-0ACZuZny8,10827
48
+ reconcile/jira_permissions_validator.py,sha256=9aLSsKKRlilk4W_jwo5hqMMzdJIYJIgXt7E7WVX3Mp4,11410
49
49
  reconcile/jira_watcher.py,sha256=eyOQ92t8TFi6gogfNTO448h_h1CUyr24E0MPHc51R-o,3617
50
50
  reconcile/ldap_users.py,sha256=uEWQ0V41tN9KCZi4ZKPamjrJ6djSpdpvDBo7yJ0e7ZI,3008
51
51
  reconcile/mr_client_gateway.py,sha256=WhjMd-sIXDFCV8-rt8CEjurJ5OYB1pOD0K3o0tZRXQg,1885
@@ -268,7 +268,7 @@ reconcile/gql_definitions/integrations/integrations.py,sha256=R-COVEcr8OWiOjuYTv
268
268
  reconcile/gql_definitions/jenkins_configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
269
269
  reconcile/gql_definitions/jenkins_configs/jenkins_configs.py,sha256=0nMkH0G-AjQwu53fqHykth6X6jjbHdW2hBp5n7N-r24,2766
270
270
  reconcile/gql_definitions/jira_permissions_validator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
271
- reconcile/gql_definitions/jira_permissions_validator/jira_boards_for_permissions_validator.py,sha256=4_Uz4by1AOfLMicEkBHrUt6hyKYHnbQ9naTsrKbq0as,3365
271
+ reconcile/gql_definitions/jira_permissions_validator/jira_boards_for_permissions_validator.py,sha256=7p-GA-dGeuouUcAvOIMBbgGJJtIXPG5Jx4n024to97M,3856
272
272
  reconcile/gql_definitions/jumphosts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
273
273
  reconcile/gql_definitions/jumphosts/jumphosts.py,sha256=gN595lx7K1XsB2AfxDQ911TBVBbCoxibVeujnsGue_Q,2371
274
274
  reconcile/gql_definitions/ldap_groups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -578,7 +578,7 @@ reconcile/utils/helpers.py,sha256=k9svgFFZG7H5FvHYY0g5jJyvgvh2UDZxf0Ib221teag,11
578
578
  reconcile/utils/imap_client.py,sha256=byFAJATbITJPsGECSbvXBOcCnoeTUpDFiEjzOAxLm_U,1975
579
579
  reconcile/utils/instrumented_wrappers.py,sha256=eVwMoa6FCrYxLv3RML3WpZF9qKVfCTjMxphgVXG03OM,1073
580
580
  reconcile/utils/jenkins_api.py,sha256=MyJSB_S3uYf3sXnt9t03-gZNQ7tbdd7Wusv3MoF2fRc,7113
581
- reconcile/utils/jira_client.py,sha256=f7u3xvI4tk27LOnlZxxG1OjELC5vC6wzlyk3Fo7tDnY,7007
581
+ reconcile/utils/jira_client.py,sha256=geozBG45AM_z2Fisrhqw-fSkmvikyrKIb9XARn-Q-AE,7186
582
582
  reconcile/utils/jjb_client.py,sha256=Pdy0dLCFvD6GPCaC0tZydYgkVJPOxYXIiwWECZaFJBU,14551
583
583
  reconcile/utils/jsonpath.py,sha256=NRpAEijKN4cMDjo7qivNPqpm0__GQQ1TiE0PBEBO45s,5572
584
584
  reconcile/utils/jump_host.py,sha256=AdwmCZYNhRe53VwV2iAsUdVyUdVtSd4REmdThJDkM5w,4973
@@ -723,8 +723,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
723
723
  tools/test/test_qontract_cli.py,sha256=OvalpVRfY4pNmpMaWHHYqBjV68b1eGQjX8SCyTAXb1w,3501
724
724
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
725
725
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
726
- qontract_reconcile-0.10.1rc665.dist-info/METADATA,sha256=2c99gGi1at_xdW1wXlTr3Vdi-GFlu9XvXw2cjPrnF7k,2382
727
- qontract_reconcile-0.10.1rc665.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
728
- qontract_reconcile-0.10.1rc665.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
729
- qontract_reconcile-0.10.1rc665.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
730
- qontract_reconcile-0.10.1rc665.dist-info/RECORD,,
726
+ qontract_reconcile-0.10.1rc666.dist-info/METADATA,sha256=xfWwyht-vdJXVezR2OYmCo1MC5W5QAFvSXH5OrS3J-4,2382
727
+ qontract_reconcile-0.10.1rc666.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
728
+ qontract_reconcile-0.10.1rc666.dist-info/entry_points.txt,sha256=rIxI5zWtHNlfpDeq1a7pZXAPoqf7HG32KMTN3MeWK_8,429
729
+ qontract_reconcile-0.10.1rc666.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
730
+ qontract_reconcile-0.10.1rc666.dist-info/RECORD,,
@@ -48,6 +48,12 @@ query JiraBoardsForPermissionValidation {
48
48
  priority
49
49
  }
50
50
  }
51
+ escalationPolicies {
52
+ name
53
+ channels {
54
+ jiraComponent
55
+ }
56
+ }
51
57
  disable {
52
58
  integrations
53
59
  }
@@ -76,6 +82,15 @@ class JiraSeverityPriorityMappingsV1(ConfiguredBaseModel):
76
82
  mappings: list[SeverityPriorityMappingV1] = Field(..., alias="mappings")
77
83
 
78
84
 
85
+ class AppEscalationPolicyChannelsV1(ConfiguredBaseModel):
86
+ jira_component: Optional[str] = Field(..., alias="jiraComponent")
87
+
88
+
89
+ class AppEscalationPolicyV1(ConfiguredBaseModel):
90
+ name: str = Field(..., alias="name")
91
+ channels: AppEscalationPolicyChannelsV1 = Field(..., alias="channels")
92
+
93
+
79
94
  class DisableJiraBoardAutomationsV1(ConfiguredBaseModel):
80
95
  integrations: Optional[list[str]] = Field(..., alias="integrations")
81
96
 
@@ -89,6 +104,7 @@ class JiraBoardV1(ConfiguredBaseModel):
89
104
  issue_reopen_state: Optional[str] = Field(..., alias="issueReopenState")
90
105
  issue_security_id: Optional[str] = Field(..., alias="issueSecurityId")
91
106
  severity_priority_mappings: JiraSeverityPriorityMappingsV1 = Field(..., alias="severityPriorityMappings")
107
+ escalation_policies: Optional[list[AppEscalationPolicyV1]] = Field(..., alias="escalationPolicies")
92
108
  disable: Optional[DisableJiraBoardAutomationsV1] = Field(..., alias="disable")
93
109
 
94
110
 
@@ -56,6 +56,7 @@ class ValidationError(IntFlag):
56
56
  INVALID_PRIORITY = auto()
57
57
  PERMISSION_ERROR = auto()
58
58
  PUBLIC_PROJECT_NO_SECURITY_LEVEL = auto()
59
+ INVALID_COMPONENT = auto()
59
60
 
60
61
 
61
62
  def board_is_valid(
@@ -78,6 +79,16 @@ def board_is_valid(
78
79
  )
79
80
  error |= ValidationError.CANT_TRANSITION_ISSUES
80
81
 
82
+ components = jira.components()
83
+ for escalation_policy in board.escalation_policies or []:
84
+ jira_component = escalation_policy.channels.jira_component
85
+ if jira_component and jira_component not in components:
86
+ logging.error(
87
+ f"[{board.name}] escalation policy '{escalation_policy.name}' references a non existing Jira component "
88
+ f"'{jira_component}'. Valid components: {components}"
89
+ )
90
+ error |= ValidationError.INVALID_COMPONENT
91
+
81
92
  issue_type = board.issue_type if board.issue_type else default_issue_type
82
93
  project_issue_types = jira.project_issue_types(board.name)
83
94
  project_issue_types_str = [i.name for i in project_issue_types]
@@ -220,3 +220,7 @@ class JiraClient:
220
220
  # use anonymous access to get public projects
221
221
  jira_api_anon = JIRA(server=self.server)
222
222
  return [project.key for project in jira_api_anon.projects()]
223
+
224
+ def components(self) -> list[str]:
225
+ """Return a list of all components for the project."""
226
+ return [c.name for c in self.jira.project_components(self.project)]