Skip to content

Commit 0b02bf2

Browse files
ncloudiojbytesized
authored andcommitted
Bug 1688698 - Add initial schemas for Contextual Services (mozilla-services#656)
* Bug 1688698 - Add initial schemas for Contextual Services * Renaming schemas * Use fake names in the test files * Finalized schema * Add custom retention to all schemas
1 parent 7256897 commit 0b02bf2

File tree

13 files changed

+555
-0
lines changed

13 files changed

+555
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"mozPipelineMetadata": {
4+
"bq_dataset_family": "contextual_services",
5+
"bq_metadata_format": "structured",
6+
"bq_table": "quicksuggest_click_v1",
7+
"expiration_policy": {
8+
"delete_after_days": 30
9+
}
10+
},
11+
"properties": {
12+
"advertiser": {
13+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
14+
"type": "string"
15+
},
16+
"block_id": {
17+
"description": "A unique identifier for the QuickSuggest link",
18+
"type": "integer"
19+
},
20+
"context_id": {
21+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
22+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$",
23+
"type": "string"
24+
},
25+
"experiments": {
26+
"additionalProperties": {
27+
"properties": {
28+
"branch": {
29+
"type": "string"
30+
}
31+
},
32+
"type": "object"
33+
},
34+
"description": "An object to record all active experiments, experiments IDs are stored as keys, and the value object stores the branch information. Example: {\"experiment_1\": {\"branch\": \"control\"}, \"experiment_2\": {\"branch\": \"treatment\"}}. This deprecates the \"shield_id\" used in activity-stream and messaging-system.",
35+
"type": "object"
36+
},
37+
"locale": {
38+
"description": "User's current locale",
39+
"type": "string"
40+
},
41+
"position": {
42+
"description": "The placement of the QuickSuggest link (1-based)",
43+
"type": "integer"
44+
},
45+
"release_channel": {
46+
"description": "Firefox release channel",
47+
"type": "string"
48+
},
49+
"reporting_url": {
50+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
51+
"type": "string"
52+
},
53+
"version": {
54+
"description": "Firefox version",
55+
"type": "string"
56+
}
57+
},
58+
"required": [
59+
"context_id",
60+
"block_id",
61+
"version"
62+
],
63+
"title": "quicksuggest-click",
64+
"type": "object"
65+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"mozPipelineMetadata": {
4+
"bq_dataset_family": "contextual_services",
5+
"bq_metadata_format": "structured",
6+
"bq_table": "quicksuggest_impression_v1",
7+
"expiration_policy": {
8+
"delete_after_days": 30
9+
}
10+
},
11+
"properties": {
12+
"advertiser": {
13+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
14+
"type": "string"
15+
},
16+
"block_id": {
17+
"description": "A unique identifier for the QuickSuggest link",
18+
"type": "integer"
19+
},
20+
"context_id": {
21+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
22+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$",
23+
"type": "string"
24+
},
25+
"experiments": {
26+
"additionalProperties": {
27+
"properties": {
28+
"branch": {
29+
"type": "string"
30+
}
31+
},
32+
"type": "object"
33+
},
34+
"description": "An object to record all active experiments, experiments IDs are stored as keys, and the value object stores the branch information. Example: {\"experiment_1\": {\"branch\": \"control\"}, \"experiment_2\": {\"branch\": \"treatment\"}}. This deprecates the \"shield_id\" used in activity-stream and messaging-system.",
35+
"type": "object"
36+
},
37+
"is_clicked": {
38+
"description": "Whether or not the user has clicked on this QuickSuggest link",
39+
"type": "boolean"
40+
},
41+
"locale": {
42+
"description": "User's current locale",
43+
"type": "string"
44+
},
45+
"matched_keywords": {
46+
"description": "The matched keywords when a QuickSuggest link is shown",
47+
"type": "string"
48+
},
49+
"position": {
50+
"description": "The placement of the QuickSuggest link (1-based)",
51+
"type": "integer"
52+
},
53+
"release_channel": {
54+
"description": "Firefox release channel",
55+
"type": "string"
56+
},
57+
"reporting_url": {
58+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
59+
"type": "string"
60+
},
61+
"search_query": {
62+
"description": "The user's typed-in search query in the AwesomeBar. Note that this ping is only sent when a QuickSuggest ad is shown for the current search query, so we don't have to limit its size here",
63+
"type": "string"
64+
},
65+
"version": {
66+
"description": "Firefox version",
67+
"type": "string"
68+
}
69+
},
70+
"required": [
71+
"context_id",
72+
"search_query",
73+
"matched_keywords",
74+
"block_id",
75+
"is_clicked",
76+
"version"
77+
],
78+
"title": "quicksuggest-impression",
79+
"type": "object"
80+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"mozPipelineMetadata": {
4+
"bq_dataset_family": "contextual_services",
5+
"bq_metadata_format": "structured",
6+
"bq_table": "topsites_click_v1",
7+
"expiration_policy": {
8+
"delete_after_days": 30
9+
}
10+
},
11+
"properties": {
12+
"advertiser": {
13+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
14+
"type": "string"
15+
},
16+
"context_id": {
17+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
18+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$",
19+
"type": "string"
20+
},
21+
"experiments": {
22+
"additionalProperties": {
23+
"properties": {
24+
"branch": {
25+
"type": "string"
26+
}
27+
},
28+
"type": "object"
29+
},
30+
"description": "An object to record all active experiments, experiments IDs are stored as keys, and the value object stores the branch information. Example: {\"experiment_1\": {\"branch\": \"control\"}, \"experiment_2\": {\"branch\": \"treatment\"}}. This deprecates the \"shield_id\" used in activity-stream and messaging-system.",
31+
"type": "object"
32+
},
33+
"locale": {
34+
"description": "User's current locale",
35+
"type": "string"
36+
},
37+
"position": {
38+
"description": "The placement of the tile (1-based)",
39+
"type": "integer"
40+
},
41+
"release_channel": {
42+
"description": "Firefox release channel",
43+
"type": "string"
44+
},
45+
"reporting_url": {
46+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
47+
"type": "string"
48+
},
49+
"tile_id": {
50+
"description": "A unique identifier for the sponsored tile",
51+
"type": "integer"
52+
},
53+
"version": {
54+
"description": "Firefox version",
55+
"type": "string"
56+
}
57+
},
58+
"required": [
59+
"context_id",
60+
"tile_id",
61+
"version"
62+
],
63+
"title": "topsites-click",
64+
"type": "object"
65+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"mozPipelineMetadata": {
4+
"bq_dataset_family": "contextual_services",
5+
"bq_metadata_format": "structured",
6+
"bq_table": "topsites_impression_v1",
7+
"expiration_policy": {
8+
"delete_after_days": 30
9+
}
10+
},
11+
"properties": {
12+
"advertiser": {
13+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
14+
"type": "string"
15+
},
16+
"context_id": {
17+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
18+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$",
19+
"type": "string"
20+
},
21+
"experiments": {
22+
"additionalProperties": {
23+
"properties": {
24+
"branch": {
25+
"type": "string"
26+
}
27+
},
28+
"type": "object"
29+
},
30+
"description": "An object to record all active experiments, experiments IDs are stored as keys, and the value object stores the branch information. Example: {\"experiment_1\": {\"branch\": \"control\"}, \"experiment_2\": {\"branch\": \"treatment\"}}. This deprecates the \"shield_id\" used in activity-stream and messaging-system.",
31+
"type": "object"
32+
},
33+
"locale": {
34+
"description": "User's current locale",
35+
"type": "string"
36+
},
37+
"position": {
38+
"description": "The placement of the tile (1-based)",
39+
"type": "integer"
40+
},
41+
"release_channel": {
42+
"description": "Firefox release channel",
43+
"type": "string"
44+
},
45+
"reporting_url": {
46+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
47+
"type": "string"
48+
},
49+
"tile_id": {
50+
"description": "A unique identifier for the sponsored tile",
51+
"type": "integer"
52+
},
53+
"version": {
54+
"description": "Firefox version",
55+
"type": "string"
56+
}
57+
},
58+
"required": [
59+
"context_id",
60+
"tile_id",
61+
"version"
62+
],
63+
"title": "topsites-impression",
64+
"type": "object"
65+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mozPipelineMetadata": {
3+
"expiration_policy": {
4+
"delete_after_days": 30
5+
}
6+
}
7+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"type": "object",
4+
"title": "quicksuggest-click",
5+
"properties": {
6+
@ACTIVITY-STREAM_EXPERIMENTS_1_JSON@,
7+
"context_id": {
8+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
9+
"type": "string",
10+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$"
11+
},
12+
"advertiser": {
13+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
14+
"type": "string"
15+
},
16+
"block_id": {
17+
"description": "A unique identifier for the QuickSuggest link",
18+
"type": "integer"
19+
},
20+
"position": {
21+
"description": "The placement of the QuickSuggest link (1-based)",
22+
"type": "integer"
23+
},
24+
"reporting_url": {
25+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
26+
"type": "string"
27+
},
28+
"version": {
29+
"description": "Firefox version",
30+
"type": "string"
31+
},
32+
"release_channel": {
33+
"description": "Firefox release channel",
34+
"type": "string"
35+
},
36+
"locale": {
37+
"description": "User's current locale",
38+
"type": "string"
39+
}
40+
},
41+
"required": [
42+
"context_id",
43+
"block_id",
44+
"version"
45+
]
46+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"type": "object",
4+
"title": "quicksuggest-impression",
5+
"properties": {
6+
@ACTIVITY-STREAM_EXPERIMENTS_1_JSON@,
7+
"context_id": {
8+
"description": "A UUID representing this user. Note that it's not client_id, nor can it be used to link to a client_id",
9+
"type": "string",
10+
"pattern": "^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$"
11+
},
12+
"search_query": {
13+
"description": "The user's typed-in search query in the AwesomeBar. Note that this ping is only sent when a QuickSuggest ad is shown for the current search query, so we don't have to limit its size here",
14+
"type": "string"
15+
},
16+
"matched_keywords": {
17+
"description": "The matched keywords when a QuickSuggest link is shown",
18+
"type": "string"
19+
},
20+
"is_clicked": {
21+
"description": "Whether or not the user has clicked on this QuickSuggest link",
22+
"type": "boolean"
23+
},
24+
"advertiser": {
25+
"description": "Name of the advertiser, e.g. amazon, ebay, bestbuy etc",
26+
"type": "string"
27+
},
28+
"position": {
29+
"description": "The placement of the QuickSuggest link (1-based)",
30+
"type": "integer"
31+
},
32+
"block_id": {
33+
"description": "A unique identifier for the QuickSuggest link",
34+
"type": "integer"
35+
},
36+
"reporting_url": {
37+
"description": "The reporting URL of the ad, normally pointing to the ad partner's reporting endpoint. It's URL encoded",
38+
"type": "string"
39+
},
40+
"version": {
41+
"description": "Firefox version",
42+
"type": "string"
43+
},
44+
"release_channel": {
45+
"description": "Firefox release channel",
46+
"type": "string"
47+
},
48+
"locale": {
49+
"description": "User's current locale",
50+
"type": "string"
51+
}
52+
},
53+
"required": [
54+
"context_id",
55+
"search_query",
56+
"matched_keywords",
57+
"block_id",
58+
"is_clicked",
59+
"version"
60+
]
61+
}

0 commit comments

Comments
 (0)