Skip to content

Commit 2177b64

Browse files
committed
Merge branch 'release-v0.30.0' into release
2 parents 31a6594 + b8ce0b4 commit 2177b64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+645
-678
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
pip install -r requirements.txt
157157
glean_parser translate src/App/metrics.yaml src/App/pings.yaml \
158158
-f javascript -o src/App/generated \
159-
--option platform=qt --option version="0.29"
159+
--option platform=qt --option version="0.30"
160160
- run:
161161
name: Run Qt sample tests
162162
command: |

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Unreleased changes
22

3-
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.29.0...main)
3+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.30.0...main)
4+
5+
# v0.30.0 (2022-01-10)
6+
7+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.29.0...v0.30.0)
8+
9+
* [#1045](https://github.com/mozilla/glean.js/pull/1045): BUGFIX: Provide informative error message when unable to access database in QML.
10+
* [#1077](https://github.com/mozilla/glean.js/pull/1077): BUGFIX: Do not clear lifetime metrics before submitting `deletion-request` ping on initialize.
11+
- This bug causes malformed `deletion-request` pings in Glean is initialized with `uploadEnabled=false`.
412

513
# v0.29.0 (2022-01-04)
614

benchmarks/size/max.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import QuantityMetricType from "@mozilla/glean/private/metrics/quantity";
1515
import StringMetricType from "@mozilla/glean/private/metrics/string";
1616
import TextMetricType from "@mozilla/glean/private/metrics/text";
1717
import TimespanMetricType from "@mozilla/glean/private/metrics/timespan";
18+
import RateMetricType from "@mozilla/glean/private/metrics/rate";
1819
import UUIDMetricType from "@mozilla/glean/private/metrics/uuid";
1920
import URLMetricType from "@mozilla/glean/private/metrics/url";
2021
// Plugins
@@ -33,6 +34,7 @@ console.log(
3334
JSON.stringify(StringMetricType),
3435
JSON.stringify(TextMetricType),
3536
JSON.stringify(TimespanMetricType),
37+
JSON.stringify(RateMetricType),
3638
JSON.stringify(UUIDMetricType),
3739
JSON.stringify(URLMetricType),
3840
JSON.stringify(PingEncryptionPlugin),

glean/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
"parser": "@typescript-eslint/parser",
9090
"parserOptions": {
9191
"project": ["./tsconfig.json"]
92+
},
93+
"rules": {
94+
"@typescript-eslint/no-namespace": "off"
9295
}
9396
},
9497
{

glean/package-lock.json

Lines changed: 253 additions & 268 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glean/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@mozilla/glean",
3-
"version": "0.29.0",
3+
"version": "0.30.0",
44
"description": "An implementation of the Glean SDK, a modern cross-platform telemetry client, for JavaScript environments.",
55
"type": "module",
6-
"sideEffects": "false",
6+
"sideEffects": false,
77
"exports": {
88
"./package.json": "./package.json",
99
"./private/metrics/*": "./dist/core/metrics/types/*.js",

glean/src/core/config.ts

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ import { DEFAULT_TELEMETRY_ENDPOINT, GLEAN_MAX_SOURCE_TAGS } from "./constants.j
66
import type Plugin from "../plugins/index.js";
77
import { validateHeader, validateURL } from "./utils.js";
88
import type Uploader from "./upload/uploader.js";
9-
import type { DebugOptions } from "./debug_options.js";
109
import log, { LoggingLevel } from "./log.js";
1110
import { Context } from "./context.js";
1211

1312
const LOG_TAG = "core.Config";
1413

14+
/**
15+
* Lists Glean's debug options.
16+
*/
17+
export interface DebugOptions {
18+
// Whether or not lot log pings when they are collected.
19+
logPings?: boolean;
20+
// The value of the X-Debug-ID header to be included in every ping.
21+
debugViewTag?: string;
22+
// The value of the X-Source-Tags header to be included in every ping.
23+
sourceTags?: string[];
24+
}
25+
1526
/**
1627
* Describes how to configure Glean.
1728
*/
@@ -84,16 +95,24 @@ export class Configuration implements ConfigurationInterface {
8495
this.httpClient = config?.httpClient;
8596
}
8697

87-
get debugViewTag(): string {
88-
return this.debug.debugViewTag || "";
98+
get logPings(): boolean {
99+
return this.debug.logPings || false;
100+
}
101+
102+
set logPings(flag: boolean) {
103+
this.debug.logPings = flag;
104+
}
105+
106+
get debugViewTag(): string | undefined {
107+
return this.debug.debugViewTag;
89108
}
90109

91-
set debugViewTag(tag: string) {
92-
if (!validateHeader(tag)) {
110+
set debugViewTag(tag: string | undefined) {
111+
if (!validateHeader(tag || "")) {
93112
log(
94113
LOG_TAG,
95114
[
96-
`"${tag}" is not a valid \`debugViewTag\` value.`,
115+
`"${tag || ""}" is not a valid \`debugViewTag\` value.`,
97116
"Please make sure the value passed satisfies the regex `^[a-zA-Z0-9-]{1,20}$`."
98117
],
99118
LoggingLevel.Error
@@ -105,15 +124,15 @@ export class Configuration implements ConfigurationInterface {
105124
this.debug.debugViewTag = tag;
106125
}
107126

108-
get sourceTags(): string[] {
109-
return this.debug.sourceTags || [];
127+
get sourceTags(): string[] | undefined {
128+
return this.debug.sourceTags;
110129
}
111130

112-
set sourceTags(tags: string[]) {
113-
if (tags.length < 1 || tags.length > GLEAN_MAX_SOURCE_TAGS) {
131+
set sourceTags(tags: string[] | undefined) {
132+
if (!tags || tags.length < 1 || tags.length > GLEAN_MAX_SOURCE_TAGS) {
114133
log(
115134
LOG_TAG,
116-
`A list of tags cannot contain more than ${GLEAN_MAX_SOURCE_TAGS} elements.`,
135+
`A list of tags cannot contain more than ${GLEAN_MAX_SOURCE_TAGS} elements or less than one.`,
117136
LoggingLevel.Error
118137
);
119138
return;

glean/src/core/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const GLEAN_SCHEMA_VERSION = 1;
88
//
99
// PACKAGE_VERSION is defined as a global by webpack,
1010
// we need a default here for testing when the app is not build with webpack.
11-
export const GLEAN_VERSION = "0.29.0";
11+
export const GLEAN_VERSION = "0.30.0";
1212

1313
// The name of a "ping" that will include Glean ping_info metrics,
1414
// such as ping sequence numbers.

glean/src/core/context.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import type { DebugOptions } from "./debug_options.js";
65
import type MetricsDatabase from "./metrics/database.js";
76
import type EventsDatabase from "./metrics/events_database/index.js";
87
import type PingsDatabase from "./pings/database.js";
98
import type ErrorManager from "./error/index.js";
109
import type Platform from "../platform/index.js";
1110
import Dispatcher from "./dispatcher.js";
1211
import log, { LoggingLevel } from "./log.js";
12+
import type { Configuration } from "./config.js";
1313

1414
const LOG_TAG = "core.Context";
1515

@@ -39,7 +39,7 @@ export class Context {
3939
private _pingsDatabase!: PingsDatabase;
4040
private _errorManager!: ErrorManager;
4141
private _applicationId!: string;
42-
private _debugOptions!: DebugOptions;
42+
private _config!: Configuration;
4343

4444
// Whether or not Glean is initialized.
4545
private _initialized = false;
@@ -191,22 +191,22 @@ export class Context {
191191
Context.instance._initialized = init;
192192
}
193193

194-
static get debugOptions(): DebugOptions {
195-
if (typeof Context.instance._debugOptions === "undefined") {
194+
static get config(): Configuration {
195+
if (typeof Context.instance._config === "undefined") {
196196
log(
197197
LOG_TAG,
198198
[
199-
"Attempted to access Context.debugOptions before it was set. This may cause unexpected behaviour.",
199+
"Attempted to access Context.config before it was set. This may cause unexpected behaviour.",
200200
],
201201
LoggingLevel.Trace
202202
);
203203
}
204204

205-
return Context.instance._debugOptions;
205+
return Context.instance._config;
206206
}
207207

208-
static set debugOptions(options: DebugOptions) {
209-
Context.instance._debugOptions = options;
208+
static set config(config: Configuration) {
209+
Context.instance._config = config;
210210
}
211211

212212
static get startTime(): Date {

glean/src/core/debug_options.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)