Skip to content

Commit

Permalink
Add Fenix crash monitoring documentation link
Browse files Browse the repository at this point in the history
This adds the ability to add additional links to the product home page.
This is particularly useful for links to crash monitoring documentation
for that specific product.

This also adds a link to Fenix crash monitoring documentation.
  • Loading branch information
willkg committed Feb 17, 2022
1 parent 4cde993 commit e8de0dd
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 7 deletions.
6 changes: 6 additions & 0 deletions product_details/Fenix.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@
"Application-Services",
"https://github.com/mozilla/application-services/issues/new?title=%(title)s&body=%(description)s"
]
],
"product_home_links": [
[
"Fenix crash monitoring documentation",
"https://github.com/mozilla-mobile/fenix/wiki/Crash-Monitoring"
]
]
}
3 changes: 2 additions & 1 deletion product_details/Firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/FirefoxReality.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/Focus.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/MozillaVPN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"home_page_sort": 4,
"featured_versions": ["auto"],
"in_buildhub": false,
"bug_links": []
"bug_links": [],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/ReferenceBrowser.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/SeaMonkey.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
3 changes: 2 additions & 1 deletion product_details/Thunderbird.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"GeckoView",
"https://bugzilla.mozilla.org/enter_bug.cgi?bug_type=%(bug_type)s&keywords=crash&product=GeckoView&op_sys=%(op_sys)s&rep_platform=%(rep_platform)s&cf_crash_signature=%(signature)s&short_desc=%(title)s&comment=%(description)s&format=__default__"
]
]
],
"product_home_links": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ <h4>{{ product.name }} {{ version }}</h4>
</div>
<br class="clear" />
</div>

{% if product.product_home_links %}
<div class="title">
<h2>Other links</h2>
</div>
<div class="body">
<div id="release_channels">
<div class="release_channel">
<ul>
{% for text, link in product.product_home_links %}
<li><a href="{{ link }}">{{ text }}</a></li>
{% endfor %}
</ul>
</div>
</div>
<br class="clear" />
</div>
{% endif %}
</div>
<div class="tip">
Are the featured versions wrong?
Expand Down
3 changes: 3 additions & 0 deletions webapp-django/crashstats/crashstats/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def setUp(self):
featured_versions=["auto"],
in_buildhub=True,
bug_links=[["WaterWolf", "create-waterwolf-bug"]],
product_home_links=[["link", "http://example.com/"]],
),
productlib.Product(
name="NightTrain",
Expand All @@ -81,6 +82,7 @@ def setUp(self):
featured_versions=["auto"],
in_buildhub=False,
bug_links=[["NightTrain", "create-nighttrain-bug"]],
product_home_links=[],
),
productlib.Product(
name="SeaMonkey",
Expand All @@ -89,6 +91,7 @@ def setUp(self):
featured_versions=["auto"],
in_buildhub=False,
bug_links=[["SeaMonkey", "create-seamonkey-bug"]],
product_home_links=[],
),
]

Expand Down
15 changes: 15 additions & 0 deletions webapp-django/crashstats/productlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class Product:
# view of a crash report
bug_links: List[List[str]]

# List of [link name, link url] links to display on the product hom epage
product_home_links: List[List[str]]


# In-memory cache of products files so we're not parsing them over-and-over
_PRODUCTS = []
Expand Down Expand Up @@ -159,6 +162,18 @@ def validate_product_file(fn):
# NOTE(willkg): This doesn't verify templates are well formed. That's
# handled in a test in the code that uses the template.

for item in json_data["product_home_links"]:
if len(item) != 2:
raise ProductValidationError(
"product file %s has invalid product_home_links: %s"
% (fn, repr(item))
)
if not isinstance(item[0], str) or not isinstance(item[1], str):
raise ProductValidationError(
"product file %s has invalid product_home_links: %s"
% (fn, repr(item))
)

# Try to build a Product out of it
Product(**json_data)

Expand Down

0 comments on commit e8de0dd

Please sign in to comment.