Skip to content

Commit 2d9bb6a

Browse files
committed
Merge branch 'release-v0.23.0' into release
2 parents cdb9855 + e31acc5 commit 2d9bb6a

Some content is hidden

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

67 files changed

+1676
-960
lines changed

.circleci/config.yml

Lines changed: 72 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
- run:
4242
name: Run linters
4343
command: npm --prefix ./glean run lint
44+
- run:
45+
name: Audit dependency tree
46+
command: npm --prefix ./glean audit --production
4447

4548
test:
4649
docker:
@@ -63,15 +66,30 @@ jobs:
6366
name: Run integration tests
6467
command: export PATH=.:$PATH && npm --prefix ./glean run test:integration
6568

66-
samples-tests:
69+
build:
70+
docker:
71+
- image: cimg/python:3.9.4-node
72+
steps:
73+
- checkout
74+
- run:
75+
name: Install JavaScript dependencies
76+
command: npm --prefix ./glean install
77+
- run:
78+
name: Build library
79+
command: npm --prefix ./glean run build
80+
- run:
81+
name: Build docs
82+
command: npm --prefix ./glean run build:docs
83+
84+
webext-sample-tests:
6785
docker:
6886
- image: cimg/python:3.8.8-node
6987
steps:
7088
- checkout
7189
- run:
7290
name: Install JavaScript dependencies for Glean
7391
command: npm --prefix ./glean install
74-
# JS webext sample related jobs
92+
# JS sample related jobs
7593
- run:
7694
name: Install JavaScript dependencies for the JS web extension sample
7795
command: |
@@ -85,7 +103,7 @@ jobs:
85103
name: Run JS web extension sample test
86104
command: |
87105
export PATH=.:$PATH && npm --prefix ./samples/web-extension/javascript run test
88-
# TS webext sample related jobs
106+
# TS sample related jobs
89107
- run:
90108
name: Install Typescript dependencies for the TS web extension sample
91109
command: |
@@ -99,7 +117,15 @@ jobs:
99117
name: Run TS web extension sample test
100118
command: |
101119
export PATH=.:$PATH && npm --prefix ./samples/web-extension/typescript run test
102-
# Node.js sample related jobs
120+
121+
node-sample-tests:
122+
docker:
123+
- image: cimg/python:3.8.8-node
124+
steps:
125+
- checkout
126+
- run:
127+
name: Install JavaScript dependencies for Glean
128+
command: npm --prefix ./glean install
103129
- run:
104130
name: Install JavaScript dependencies for the Node.js sample
105131
command: |
@@ -114,55 +140,54 @@ jobs:
114140
command: |
115141
export PATH=.:$PATH && npm --prefix ./samples/node run test
116142
117-
check-size:
143+
qt-sample-tests:
118144
docker:
119-
- image: cimg/node:16.1.0
145+
- image: cimg/python:3.8.8-node
120146
steps:
121147
- checkout
122148
- run:
123-
name: Get and post build sizes to GitHub PR
124-
command: |
125-
./benchmarks/run.sh
126-
127-
check-qt-js:
128-
docker:
129-
- image: cimg/python:3.9.4-node
130-
steps:
131-
- checkout
149+
name: Install JavaScript dependencies for Glean
150+
command: npm --prefix ./glean install
132151
- run:
133-
name: Install JavaScript dependencies and build Glean.js for Qt
152+
name: Install Qt dependencies
134153
command: |
135-
npm --prefix ./glean install
136-
npm --prefix ./glean run build:qt
154+
sudo apt-get update
155+
sudo apt-get install -y gcc g++ make cmake \
156+
qtbase5-dev qt5-default qt5-qmake qttools5-dev-tools qtdeclarative5-dev \
157+
qtdeclarative5-dev-tools qml-module-qttest qml-module-qtquick2 \
158+
qml-module-qtquick-localstorage qml-module-qtquick-controls2
159+
sudo apt-get install xvfb
137160
- run:
138-
name: Setup Qt dependency
161+
name: Build and install Qt Glean.js library
139162
command: |
140-
# The following commands are copied from the VPN Qt setup for Linux
141-
# See: https://github.com/mozilla-mobile/mozilla-vpn-client/blob/main/.github/workflows/linux.yaml#L18-L21
142-
#
143-
# Add external PPA, latest version of QT is 5.12.x for Ubuntu 20.04
144-
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal -y
145-
sudo apt update
146-
sudo apt install git qt515tools qt515svg qt515networkauth-no-lgpl qt515charts-no-lgpl libgl-dev libpolkit-gobject-1-dev devscripts debhelper cdbs quilt qt515graphicaleffects qt515imageformats qt515quickcontrols2 libxcb-image0-dev libxcb-shape0-dev libxcb-sync0-dev libxcb-render-util0-dev libxcb-xfixes0-dev libxcb-icccm4-dev libx11-xcb-dev libxcb-keysyms1-dev libasound2-dev libaudio-dev libcups2-dev libdbus-1-dev libglu1-mesa-dev libmng-dev libtiff5-dev libxcursor-dev libxi-dev libxinerama-dev libxmu-dev libxrandr-dev libxv-dev libedit-dev libvulkan-dev qt515websockets -y
163+
npm --prefix ./glean run build:qt
164+
cp -r glean/dist/qt/org/ samples/qt/src/App/org/
147165
- run:
148-
name: Run the Qt sample app and check for errors
166+
name: Build the Node.js Glean generated files sample
149167
command: |
150-
cd samples/qt-qml-app
168+
cd samples/qt
151169
python3 -m venv venv
152170
source venv/bin/activate
153171
pip install -r requirements.txt
154-
glean_parser translate metrics.yaml pings.yaml -f javascript -o generated \
155-
--option platform=qt --option version="0.22"
172+
glean_parser translate src/App/metrics.yaml src/App/pings.yaml \
173+
-f javascript -o src/App/generated \
174+
--option platform=qt --option version="0.23"
175+
- run:
176+
name: Run Qt sample tests
177+
command: |
178+
cd samples/qt
179+
qmake -r
180+
QML_IMPORT_TRACE=1 xvfb-run make check
156181
157-
sudo apt-get install xvfb
158-
xvfb-run python main.py &> qml.log &
159-
# Wait for app to start
160-
sleep 10
161-
if ! grep -q "Initialized Glean succesfully." "qml.log"; then
162-
echo "\n\n\033[1;91m** Failed to initialize Glean in Qt! See more logs below. **\033[0m\n\n"
163-
cat qml.log
164-
exit 1
165-
fi
182+
check-size:
183+
docker:
184+
- image: cimg/node:16.1.0
185+
steps:
186+
- checkout
187+
- run:
188+
name: Get and post build sizes to GitHub PR
189+
command: |
190+
./benchmarks/run.sh
166191
167192
# via https://circleci.com/blog/deploying-documentation-to-github-pages-with-continuous-integration/
168193
docs-deploy:
@@ -192,7 +217,6 @@ jobs:
192217
git config user.name "moz-glean"
193218
npm --prefix ./glean run publish:docs
194219
195-
196220
publish:
197221
docker:
198222
- image: cimg/node:16.1.0
@@ -230,15 +254,19 @@ workflows:
230254
jobs:
231255
- lint
232256
- test
233-
- check-qt-js
234-
- samples-tests
257+
- build
258+
- webext-sample-tests
259+
- node-sample-tests
260+
- qt-sample-tests
235261
- hold:
236262
type: approval
237263
requires:
238264
- lint
239265
- test
240-
- check-qt-js
241-
- samples-tests
266+
- build
267+
- webext-sample-tests
268+
- node-sample-tests
269+
- qt-sample-tests
242270
filters:
243271
branches:
244272
ignore:

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
# Unreleased changes
22

3-
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.22.0...main)
3+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.23.0...main)
4+
5+
# v0.23.0 (2021-10-12)
6+
7+
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.22.0...v0.23.0)
8+
9+
* [#755](https://github.com/mozilla/glean.js/pull/755): Only allow calling of `test*` functions in "test mode".
10+
* Glean is put in "test mode" once the `Glean.testResetGlean` API called.
11+
* [#811](https://github.com/mozilla/glean.js/pull/811): Apply various fixes to the Qt entry point file.
12+
* Expose `ErrorType`. This is only useful for testing purposes;
13+
* Fix version of `QtQuick.LocalStorage` plugin;
14+
* Fix the way to access the lib from inside the `shutdown` method. Previous to this fix, it is not possible to use the `shutdown` method;
15+
* Expose the `Glean.testRestGlean` API.
16+
* [#822](https://github.com/mozilla/glean.js/pull/822): Fix API reference docs build step.
17+
* [#825](https://github.com/mozilla/glean.js/pull/825): Accept `architecture` and `osVersion` as initialization parameters in Qt. In Qt these values are not easily available from the environment.
418

519
# v0.22.0 (2021-10-06)
620

721
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.21.1...v0.22.0)
822

923
* [#796](https://github.com/mozilla/glean.js/pull/796): Support setting the `app_channel` metric.
1024
- As described in ["Release channels"](https://mozilla.github.io/glean/book/reference/general/initializing.html?highlight=channel#release-channels).
25+
* [#799](https://github.com/mozilla/glean.js/pull/799): Make sure Glean does not do anything else in case initialization errors.
26+
- This may happen in case there is an error creating the databases. Mostly an issue on Qt/QML where we use a SQLite database which can throw errors on initialization.
27+
* [#799](https://github.com/mozilla/glean.js/pull/799): Provide stack traces when logging errors.
1128

1229
# v0.21.1 (2021-09-30)
1330

@@ -22,6 +39,9 @@
2239
* [#754](https://github.com/mozilla/glean.js/pull/754): Change target ECMAScript target from 2015 to 2016 when building for Qt.
2340
* [#779](https://github.com/mozilla/glean.js/pull/779): Add a number of workarounds for the Qt Javascript engine.
2441

42+
* [#775](https://github.com/mozilla/glean.js/pull/775): Disallow calling test only methods outside of test mode.
43+
* NOTE: Test mode is set once the API `Glean.testResetGlean` is called.
44+
2545
# v0.20.0 (2021-09-17)
2646

2747
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.19.0...v0.20.0)

bin/prepare-release.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,17 @@ run rm "${WORKSPACE_ROOT}/${FILE}.bak"
120120
# This gets the version string without the patch version.
121121
GLEAN_VERSION_FOR_QML=$(node -p -e "'${NEW_VERSION}'.split('.').reverse().slice(1).reverse().join('.')")
122122

123-
FILE=samples/qt-qml-app/main.qml
123+
FILE=samples/qt/src/Tests/tst_maintests.qml
124124
run $SED -i.bak -E \
125-
-e "s/import org.mozilla.Glean [0-9a-z.-]+;/import org.mozilla.Glean ${GLEAN_VERSION_FOR_QML};/" \
126-
-e "s/import generated [0-9a-z.-]+;/import generated ${GLEAN_VERSION_FOR_QML};/" \
125+
-e "s/import org.mozilla.Glean [0-9a-z.-]+/import org.mozilla.Glean ${GLEAN_VERSION_FOR_QML}/" \
126+
-e "s/import generated [0-9a-z.-]+/import generated ${GLEAN_VERSION_FOR_QML}/" \
127+
"${WORKSPACE_ROOT}/${FILE}"
128+
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
129+
130+
FILE=samples/qt/src/App/App.qml
131+
run $SED -i.bak -E \
132+
-e "s/import org.mozilla.Glean [0-9a-z.-]+/import org.mozilla.Glean ${GLEAN_VERSION_FOR_QML}/" \
133+
-e "s/import generated [0-9a-z.-]+/import generated ${GLEAN_VERSION_FOR_QML}/" \
127134
"${WORKSPACE_ROOT}/${FILE}"
128135
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
129136

@@ -133,15 +140,15 @@ run $SED -i.bak -E \
133140
"${WORKSPACE_ROOT}/${FILE}"
134141
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
135142

136-
FILE=samples/qt-qml-app/README.md
143+
FILE=samples/qt/README.md
137144
run $SED -i.bak -E \
138-
-e "s/--option platform=qt --option version=[0-9a-z.-]+/--option platform=qt --option version=\"${GLEAN_VERSION_FOR_QML}\";/" \
145+
-e "s/--option platform=qt --option version=[0-9a-z.-]+/--option platform=qt --option version=\"${GLEAN_VERSION_FOR_QML}\"/" \
139146
"${WORKSPACE_ROOT}/${FILE}"
140147
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
141148

142149
FILE=.circleci/config.yml
143150
run $SED -i.bak -E \
144-
-e "s/--option platform=qt --option version=[0-9a-z.-]+/--option platform=qt --option version=\"${GLEAN_VERSION_FOR_QML}\";/" \
151+
-e "s/--option platform=qt --option version=[0-9a-z.-]+/--option platform=qt --option version=\"${GLEAN_VERSION_FOR_QML}\"/" \
145152
"${WORKSPACE_ROOT}/${FILE}"
146153
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
147154

bin/update-glean-parser-version.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ run $SED -i.bak -E \
4545
"${WORKSPACE_ROOT}/${FILE}"
4646
run rm "${WORKSPACE_ROOT}/${FILE}.bak"
4747

48-
# Update the version in samples/qt-qml-app/requirements.txt
49-
FILE=samples/qt-qml-app/requirements.txt
48+
FILE=samples/qt/requirements.txt
5049
run $SED -i.bak -E \
5150
-e "s/glean_parser==[0-9.]+/glean_parser==${NEW_VERSION}/" \
5251
"${WORKSPACE_ROOT}/${FILE}"

0 commit comments

Comments
 (0)