Skip to content

Commit f56b6fb

Browse files
committed
Merge branch 'release-v0.12.0' into release
2 parents e559d51 + 0b4f11b commit f56b6fb

File tree

32 files changed

+2511
-1090
lines changed

32 files changed

+2511
-1090
lines changed

.circleci/config.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2.1
99
jobs:
1010
lint:
1111
docker:
12-
- image: cimg/node:14.13.1
12+
- image: cimg/node:16.1.0
1313
steps:
1414
- checkout
1515
- run:
@@ -24,7 +24,7 @@ jobs:
2424

2525
unit-tests:
2626
docker:
27-
- image: cimg/node:14.13.1
27+
- image: cimg/node:16.1.0
2828
steps:
2929
- checkout
3030
- run:
@@ -68,7 +68,7 @@ jobs:
6868

6969
check-size:
7070
docker:
71-
- image: cimg/node:14.13.1
71+
- image: cimg/node:16.1.0
7272
steps:
7373
- checkout
7474
- run:
@@ -114,9 +114,41 @@ jobs:
114114
exit 1
115115
fi
116116
117+
# via https://circleci.com/blog/deploying-documentation-to-github-pages-with-continuous-integration/
118+
docs-deploy:
119+
docker:
120+
- image: cimg/node:16.1.0
121+
steps:
122+
- checkout
123+
- run:
124+
name: Install Javascript dependencies
125+
command: npm --prefix ./glean install
126+
- run:
127+
name: Build documentation
128+
command: npm --prefix ./glean run build:docs
129+
- run:
130+
name: Disable jekyll builds
131+
command: touch glean/dist/docs/.nojekyll
132+
- run:
133+
name: Show contents
134+
command: ls -R glean/dist/docs
135+
# Needed for write access to the GitHub repository;
136+
# see https://circleci.com/docs/2.0/gh-bb-integration/#deployment-keys-and-user-keys
137+
- add_ssh_keys:
138+
fingerprints:
139+
- "0c:0b:f8:f0:45:60:92:79:60:34:b2:12:9c:55:1d:fa"
140+
# The gh-pages npm package can be used to push a directory to a git branch;
141+
# see https://www.npmjs.com/package/gh-pages
142+
- run:
143+
name: Deploy docs to gh-pages branch
144+
command: |
145+
git config user.email "brizental@mozilla.com"
146+
git config user.name "brizental"
147+
npm --prefix ./glean run publish:docs
148+
117149
publish:
118150
docker:
119-
- image: cimg/node:14.13.1
151+
- image: cimg/node:16.1.0
120152
steps:
121153
- checkout
122154
- run:
@@ -154,6 +186,12 @@ workflows:
154186
- unit-tests
155187
- check-qt-js
156188
- samples-tests
189+
- docs-deploy:
190+
filters:
191+
branches:
192+
ignore: /.*/
193+
tags:
194+
only: /^v.*/
157195
- publish:
158196
filters:
159197
branches:

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ updates:
1212
directory: "/samples/web-extension/javascript"
1313
schedule:
1414
interval: "daily"
15+
- package-ecosystem: "npm"
16+
directory: "/glean/tests/platform/utils/webext/sample"
17+
schedule:
18+
interval: "daily"
1519
- package-ecosystem: "pip"
1620
directory: "/samples/qt-qml-app"
1721
schedule:

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Unreleased changes
22

3-
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.11.0...main)
3+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.12.0...main)
4+
5+
# v0.12.0 (2021-05-11)
6+
7+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.11.0...v0.12.0)
8+
9+
* [#279](https://github.com/mozilla/glean.js/pull/279): BUGFIX: Ensure only empty pings triggers logging of "empty ping" messages.
10+
* [#288](https://github.com/mozilla/glean.js/pull/288): Support collecting `PlatformInfo` from `Qt` applications. Only OS name and locale are supported.
11+
* [#281](https://github.com/mozilla/glean.js/pull/281): Add the QuantityMetricType.
12+
* [#303](https://github.com/mozilla/glean.js/pull/303): Implement setRawNanos API for the TimespanMetricType.
413

514
# v0.11.0 (2021-05-03)
615

716
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.10.2...v0.11.0)
817

918
* [#260](https://github.com/mozilla/glean.js/pull/260): Set minimum node (>= 12.0.0) and npm (>= 7.0.0) versions.
1019
* [#202](https://github.com/mozilla/glean.js/pull/202): Add a testing API for the ping type.
11-
* [#253](https://github.com/mozilla/glean.js/pull/253): Implement the timespan metric type.
20+
* [#253](https://github.com/mozilla/glean.js/pull/253):
21+
* Implement the timespan metric type.
22+
* BUGFIX: Report event timestamps in milliseconds.
1223
* [#261](https://github.com/mozilla/glean.js/pull/261): Show a spinner while setting up python virtual environment
24+
* [#273](https://github.com/mozilla/glean.js/pull/273): BUGFIX: Expose the missing `LabeledMetricType` and `TimespanMetricType` in Qt.
1325

1426
# v0.10.2 (2021-04-26)
1527

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ folder in this repository and Glean.js' user documentation lives in [The Glean B
1818
> does not have a related bug filed with the [`[docdays]`](https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&f2=component&o1=substring&o2=equals&f1=status_whiteboard&v1=%5Bdocdays%5D&classification=Client%20Software&classification=Developer%20Infrastructure&classification=Components&classification=Server%20Software&classification=Other&list_id=15653426&resolution=---&v2=Glean.js) tag,
1919
> please file a bug.
2020
21+
Here's the [guide](https://github.com/mozilla/glean.js/tree/main/docs/getting_started.md) to get you started!
22+
2123
## Bug reports / Feature Requests
2224

2325
If you are using Glean.js and found a bug or a missing feature, please file a bug.

docs/adding_a_new_metric_type.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class StringMetric extends Metric<string, string> {
9090
}
9191
```
9292

93-
Oce you have your `Metric` subclass, include it in Glean.js'
93+
Once you have your `Metric` subclass, include it in Glean.js'
9494
[`METRIC_MAP`](https://github.com/mozilla/glean.js/blob/main/glean/src/core/metrics/utils.ts#L17).
9595
This map will be used as a template for creating metric instances from the metrics database.
9696

@@ -112,6 +112,10 @@ Still, metric type classes will always have at least one recording function and
112112
> Make sure that, when you included your `Metric` class on the `METRIC_MAP` the property has the
113113
> same value as the `type` property on the corresponding `MetricType`.
114114
115+
Once you are done implementing the `MetricType` class for your new metric type,
116+
make sure to manually expose it for Qt platforms by adding it to
117+
[the Qt entry point file](https://github.com/mozilla/glean.js/blob/main/glean/src/index/qt.ts).
118+
115119
#### Recording functions
116120

117121
_Functions that call Glean.js' database and store concrete values of a metric type._

docs/getting_started.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Getting started
2+
This guide is for developers who want to develop on Glean.js.
3+
## Prerequisites
4+
Glean.js uses [Node.js](https://nodejs.org/).
5+
Follow the [official guide](https://nodejs.dev/) to install it.
6+
### Version requirements
7+
* `node` >= 12.0.0
8+
* `npm` >= 7.0.0
9+
10+
## Building Glean.js
11+
1. a terminal, navigate to the directory you want the Glean.js repository to live. Then:
12+
```bash
13+
git clone https://github.com/mozilla/glean.js
14+
```
15+
2. navigate to the `glean` folder:
16+
```bash
17+
cd glean.js/glean
18+
```
19+
3. Install all the node modules used by Glean.js:
20+
```bash
21+
npm install
22+
```
23+
24+
## Running tests
25+
Once you have [built](#building-gleanjs) Glean.js, run
26+
```bash
27+
npm run test
28+
```
29+
in the `glean` folder.
30+
31+
This runs all the tests in the `glean` folder.
32+
Alternatively, you may want to run component-specific tests.
33+
To do so, substitute `test` in the command above with one of the followings:
34+
* `test:core` - executes tests inside `tests/core` folder.
35+
* `test:plugins` - executes tests inside `tests/plugins` folder.
36+
* `test:platform` - executes tests inside `tests/platform` folder.
37+
38+
You might want to run one specific test within a certain folder.
39+
To run the test with the title `DatetimeMetric` in the `core` folder:
40+
```bash
41+
npm run test:core -- --grep "DateTimeMetric"
42+
```
43+
You should see the output similar to the following:
44+
```shell
45+
46+
> @mozilla/glean@0.10.2 test:core
47+
> npm run test:base -- "tests/core/**/*.spec.ts" --recursive "--grep" "DatetimeMetric"
48+
49+
50+
> @mozilla/glean@0.10.2 test:base
51+
> node --experimental-modules --experimental-specifier-resolution=node --loader=ts-node/esm node_modules/mocha/lib/cli/cli.js "tests/core/**/*.spec.ts" "--recursive" "--grep" "DatetimeMetric"
52+
53+
(node:52217) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
54+
(Use `node --trace-warnings ...` to show where the warning was created)
55+
56+
57+
DatetimeMetric
58+
✓ datetime internal representation validation works as expected
59+
✓ attempting to get the value of a metric that hasn't been recorded doesn't error
60+
✓ attempting to set when glean upload is disabled is a no-op
61+
Attempted to delete an entry from an invalid index. Ignoring.
62+
Attempted to delete an entry from an invalid index. Ignoring.
63+
Storage for deletion-request empty. Ping will still be sent.
64+
Attempted to delete an entry from an invalid index. Ignoring.
65+
Ping 053b739c-0b86-4032-ac45-29533d57ddc7 succesfully sent 200.
66+
✓ ping payload is correct
67+
set properly sets the value in all pings
68+
✓ truncation works
69+
✓ get from different timezone than recording timezone keeps the original time intact
70+
71+
72+
7 passing (27ms)
73+
```

0 commit comments

Comments
 (0)