Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .netlify/glam_metrics_blocklist.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"regex": "/search_counts|browser_search|event_counts|browser_engagement_navigation|manager_message_size|dropped_frames_proportion/",
"regex": "search_counts|browser_search|event_counts|browser_engagement_navigation|manager_message_size|dropped_frames_proportion",
"confidentialMetricsFenix": [
"characteristics.color_depth",
"characteristics.color_gamut",
Expand Down
1 change: 1 addition & 0 deletions etl/glean_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ def write_glean_metadata(output_dir, functions_dir, app_names=None):
in ["client_info", "ping_info"],
bugs=metric.definition["bugs"],
monitor=metric.definition.get("metadata", {}).get("monitor", {}),
notification_emails=metric.definition["notification_emails"],
),
metric_annotation,
)
Expand Down
4 changes: 4 additions & 0 deletions src/state/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const filterItemsByLabels = (items, labels) => {
(label === "bugs" &&
labelsToFilter.bugs.every((el) =>
item.bugs.some((bug) => bug.endsWith(el))
)) ||
(label === "notification_emails" &&
labelsToFilter.notification_emails.every((el) =>
item.notification_emails.some((email) => email.startsWith(el))
)))
);

Expand Down
20 changes: 17 additions & 3 deletions src/state/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { filterItemsByLabels, filterItemsByExpiration } from "./filter";
export const generateSearchIndex = (items) => {
const searchIndex = new Document({
tokenize: "forward",
index: ["id", "type", "tags", "origin", "description", "bugs"],
index: [
"id",
"type",
"tags",
"origin",
"description",
"bugs",
"notification_emails",
],
});

items.forEach((item) => {
Expand All @@ -17,6 +25,7 @@ export const generateSearchIndex = (items) => {
description: item.description,
expires: item.expires,
bugs: item.bugs,
notification_emails: item.notification_emails,
});
});

Expand All @@ -35,6 +44,7 @@ export const fullTextSearch = (searchIndex, query, searchItems) => {
expires: [],
name: [],
bugs: [],
notification_emails: [],
};

searchTerms.forEach((term) => {
Expand All @@ -44,10 +54,14 @@ export const fullTextSearch = (searchIndex, query, searchItems) => {
term.startsWith("type:") ||
term.startsWith("expires:") ||
term.startsWith("name:") ||
term.startsWith("bugs:")
term.startsWith("bugs:") ||
term.startsWith("email:")
) {
const splitter = term.indexOf(":");
const labelType = term.slice(0, splitter);
let labelType = term.slice(0, splitter);
if (labelType === "email") {
labelType = "notification_emails";
}
labels[labelType] = [
...labels[labelType],
term.slice(splitter + 1).replace(/"?(.*?)"?$/, "$1"),
Expand Down
36 changes: 36 additions & 0 deletions tests/fixtures/glean.1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,42 @@
"seq": {
"type": "integer"
},
"server_knobs_config": {
"additionalProperties": false,
"description": "The Server Knobs configuration applied via applyServerKnobsConfig. Contains the complete configuration including metrics_enabled, pings_enabled, and event_threshold settings.",
"properties": {
"event_threshold": {
"description": "Optional threshold for event buffering before an events ping is collected and submitted",
"minimum": 0,
"type": ["integer", "null"]
},
"metrics_enabled": {
"additionalProperties": {
"type": "boolean"
},
"description": "Map of metric identifiers (category.name) to boolean values indicating whether the metric is enabled",
"propertyNames": {
"maxLength": 61,
"pattern": "^[a-z_][a-z0-9_]{0,29}(\\.[a-z_][a-z0-9_]{0,29})+$",
"type": "string"
},
"type": "object"
},
"pings_enabled": {
"additionalProperties": {
"type": "boolean"
},
"description": "Map of ping names to boolean values indicating whether the ping is enabled",
"propertyNames": {
"maxLength": 30,
"pattern": "^[a-z-_][a-z0-9-_]*$",
"type": "string"
},
"type": "object"
}
},
"type": "object"
},
"start_time": {
"format": "datetime",
"type": "string"
Expand Down