1# -*- coding: utf-8 -*-
2
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7from .common_ping import CommonPing
8from .utils import prepend_properties
9
10
11class BhrPing(CommonPing):
12 schema_url = (
13 "https://raw.githubusercontent.com/mozilla-services/mozilla-pipeline-schemas"
14 "/{branch}/schemas/telemetry/bhr/bhr.4.schema.json"
15 )
16
17 def __init__(self, **kwargs):
18 super().__init__(self.schema_url, **kwargs)
19
20 def _update_env(self, schema):
21 # hangs is an array of objects
22 stack = prepend_properties(("payload", "hangs")) + (
23 "items",
24 "properties",
25 "stack",
26 )
27 schema.set_schema_elem(
28 stack,
29 {
30 "type": "string",
31 "description": (
32 "JSON representation of the stack field."
33 " Injected by mozilla-schema-generator."
34 ),
35 },
36 # this may otherwise overwrite the "items" fields
37 propagate=False,
38 )
39
40 return super()._update_env(schema)