Skip to content

Commit 4ce1665

Browse files
author
Paula Van Zuijlen
committed
Merge remote-tracking branch 'mozilla/master' into syncstorage-sqlite
2 parents fdc303d + f01c21f commit 4ce1665

Some content is hidden

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

63 files changed

+1395
-4180
lines changed

.circleci/config.yml

Lines changed: 80 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# To avoid collision with other GCP connections we create specific vars for
88
# the ETE Test Pipeline.
99
# ETE_GOOGLE_PROJECT_ID - GCP Project ID for ecosystem-test-eng
10-
# ETE_GCLOUD_SERVICE_KEY - GCP syncstorage specific Service Account JSON Key
10+
# ETE_GCLOUD_SERVICE_KEY - GCP syncstorage specific Service Account JSON Key
1111
# ETE_GOOGLE_PROJECT_NUMBER - GCP Project Number for ecosystem-test-eng
1212
#
1313
version: 2.1
@@ -63,20 +63,17 @@ commands:
6363
steps:
6464
- run:
6565
name: Rust Clippy MySQL
66-
command: |
67-
cargo clippy --workspace --all-targets --no-default-features --features=mysql,py_verifier -- -D warnings
66+
command: make clippy_mysql
6867
rust-clippy-sqlite:
6968
steps:
7069
- run:
7170
name: Rust Clippy SQLite
72-
command: |
73-
cargo clippy --workspace --all-targets --no-default-features --features=sqlite,py_verifier -- -D warnings
71+
command: make clippy_sqlite
7472
rust-clippy-spanner:
7573
steps:
7674
- run:
7775
name: Rust Clippy Spanner
78-
command: |
79-
cargo clippy --workspace --all-targets --no-default-features --features=syncstorage-db/spanner --features=tokenserver-db/mysql --features=py_verifier -- -D warnings
76+
command: make clippy_spanner
8077
setup-mysql:
8178
steps:
8279
- run:
@@ -105,9 +102,9 @@ commands:
105102
106103
install-test-deps:
107104
steps:
108-
- run:
105+
- run:
109106
name: Install test dependencies
110-
command: cargo install cargo-nextest cargo-llvm-cov
107+
command: cargo install --locked cargo-nextest cargo-llvm-cov
111108

112109
make-test-dir:
113110
steps:
@@ -124,7 +121,7 @@ commands:
124121
name: nextest with code coverage (quota enforced)
125122
command: make test_with_coverage
126123
environment:
127-
SYNC_SYNCSTORAGE__ENFORCE_QUOTA: 1
124+
SYNC_SYNCSTORAGE__ENFORCE_QUOTA: 1
128125

129126
merge-unit-test-coverage:
130127
steps:
@@ -146,54 +143,25 @@ commands:
146143
when: always
147144
name: Tokenserver integration tests
148145
command: |
149-
# NOTE: Python3.12 requires `--break-system-packages`.
150-
# This command is run on the circleci/rust image, which is running python 3.10
151-
make run_token_server_integration_tests
152-
environment:
153-
SYNCSTORAGE_RS_IMAGE: app:build
154-
run-e2e-mysql-tests:
155-
steps:
156-
- run:
157-
name: e2e tests (syncstorage mysql)
158-
command: >
159-
/usr/local/bin/docker-compose
160-
-f docker-compose.mysql.yaml
161-
-f docker-compose.e2e.mysql.yaml
162-
up
163-
--exit-code-from mysql-e2e-tests
164-
--abort-on-container-exit
165-
environment:
166-
SYNCSTORAGE_RS_IMAGE: app:build
167-
168-
run-e2e-sqlite-tests:
169-
steps:
170-
- run:
171-
name: e2e tests (syncstorage sqlite)
172-
command: >
173-
/usr/local/bin/docker-compose
174-
-f docker-compose.sqlite.yaml
175-
-f docker-compose.e2e.sqlite.yaml
176-
up
177-
--exit-code-from sqlite-e2e-tests
178-
--abort-on-container-exit
146+
# NOTE: Python3.12 requires `--break-system-packages`.
147+
# This command is run on the circleci/rust image, which is running python 3.10
148+
make run_token_server_integration_tests
179149
environment:
180-
SYNCSTORAGE_RS_IMAGE: app:build
181-
182-
run-e2e-spanner-tests:
150+
SYNCSTORAGE_RS_IMAGE: app:build
151+
run-e2e-tests:
152+
parameters:
153+
db:
154+
type: enum
155+
enum: ["mysql", "spanner", "sqlite"]
183156
steps:
184157
- run:
185-
name: e2e tests (syncstorage spanner)
158+
name: e2e tests (syncstorage << parameters.db >>)
186159
command: >
187-
/usr/local/bin/docker-compose
188-
-f docker-compose.spanner.yaml
189-
-f docker-compose.e2e.spanner.yaml
190-
up
191-
--exit-code-from spanner-e2e-tests
192-
--abort-on-container-exit
160+
make docker_run_<< parameters.db >>_e2e_tests
193161
environment:
194-
SYNCSTORAGE_RS_IMAGE: app:build
162+
SYNCSTORAGE_RS_IMAGE: app:build
195163

196-
upload-to-gcs:
164+
gcs-configure-and-upload:
197165
parameters:
198166
source:
199167
type: string
@@ -203,9 +171,13 @@ commands:
203171
type: enum
204172
enum: ["xml", "json"]
205173
steps:
174+
- gcp-cli/setup:
175+
google_project_id: ETE_GOOGLE_PROJECT_ID
176+
gcloud_service_key: ETE_GCLOUD_SERVICE_KEY
177+
google_project_number: ETE_GOOGLE_PROJECT_NUMBER
206178
- run:
207179
name: Upload << parameters.source >> << parameters.extension >> Files to GCS
208-
when: always # Ensure the step runs even if previous steps, like test runs, fail
180+
when: always # Ensure the step runs even if previous steps, like test runs, fail
209181
command: |
210182
if [ "$CIRCLE_BRANCH" = "master" ]; then
211183
FILES=$(ls -1 << parameters.source>>/*.<< parameters.extension>> )
@@ -244,7 +216,7 @@ commands:
244216
jobs:
245217
checks:
246218
docker:
247-
- image: cimg/rust:1.81.0 # RUST_VER
219+
- image: cimg/rust:1.86 # RUST_VER
248220
auth:
249221
username: $DOCKER_USER
250222
password: $DOCKER_PASS
@@ -261,31 +233,27 @@ jobs:
261233

262234
build-and-test:
263235
docker:
264-
- image: cimg/rust:1.81.0 # RUST_VER
236+
- image: cimg/rust:1.86 # RUST_VER
265237
auth:
266238
username: $DOCKER_USER
267239
password: $DOCKER_PASS
268240
environment:
269-
SYNC_SYNCSTORAGE__DATABASE_URL: mysql://test:[email protected]/syncstorage
270-
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:[email protected]/tokenserver
271-
RUST_BACKTRACE: 1
272-
# XXX: begin_test_transaction doesn't play nice over threaded tests
273-
RUST_TEST_THREADS: 1
241+
SYNC_SYNCSTORAGE__DATABASE_URL: mysql://test:[email protected]/syncstorage
242+
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:[email protected]/tokenserver
243+
RUST_BACKTRACE: 1
244+
# XXX: begin_test_transaction doesn't play nice over threaded tests
245+
RUST_TEST_THREADS: 1
274246
- image: cimg/mysql:5.7
275247
auth:
276248
username: $DOCKER_USER
277249
password: $DOCKER_PASS
278250
environment:
279-
MYSQL_ROOT_PASSWORD: password
280-
MYSQL_USER: test
281-
MYSQL_PASSWORD: test
282-
MYSQL_DATABASE: syncstorage
251+
MYSQL_ROOT_PASSWORD: password
252+
MYSQL_USER: test
253+
MYSQL_PASSWORD: test
254+
MYSQL_DATABASE: syncstorage
283255
resource_class: large
284256
steps:
285-
- gcp-cli/setup:
286-
google_project_id: ETE_GOOGLE_PROJECT_ID
287-
gcloud_service_key: ETE_GCLOUD_SERVICE_KEY
288-
google_project_number: ETE_GOOGLE_PROJECT_NUMBER
289257
- checkout
290258
- display-versions
291259
- setup-python
@@ -302,20 +270,19 @@ jobs:
302270
# if the above tests don't run tokenserver-db tests (i.e. using --workspace)
303271
# then run-tokenserver-scripts-tests will fail. These tests expect the db to be
304272
# configured already, and it appears unit-tests modify the db to the expected state
305-
- run-tokenserver-integration-tests
306273
- store-test-results
307-
- upload-to-gcs:
274+
- gcs-configure-and-upload:
308275
source: workflow/test-results
309276
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
310277
extension: xml
311-
- upload-to-gcs:
278+
- gcs-configure-and-upload:
312279
source: workflow/test-results
313280
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/coverage
314281
extension: json
315282
#- save-sccache-cache
316283
build-mysql-image:
317284
docker:
318-
- image: cimg/rust:1.81.0 # RUST_VER
285+
- image: cimg/rust:1.86 # RUST_VER
319286
auth:
320287
username: $DOCKER_USER
321288
password: $DOCKER_PASS
@@ -328,7 +295,10 @@ jobs:
328295
- write-version
329296
- run:
330297
name: Build MySQL Docker image
331-
command: docker build -t app:build --build-arg DATABASE_BACKEND=mysql .
298+
command: >
299+
docker build -t app:build
300+
--build-arg DATABASE_BACKEND=mysql
301+
.
332302
no_output_timeout: 30m
333303
# save the built docker container into CircleCI's cache. This is
334304
# required since Workflows do not have the same remote docker instance.
@@ -340,6 +310,9 @@ jobs:
340310
- run:
341311
name: Save docker-compose config
342312
command: cp docker-compose*mysql.yaml /home/circleci/cache
313+
- run:
314+
name: Save Makefile to cache
315+
command: cp Makefile /home/circleci/cache
343316
- save_cache:
344317
key: mysql-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
345318
paths:
@@ -379,7 +352,7 @@ jobs:
379352

380353
build-spanner-image:
381354
docker:
382-
- image: cimg/rust:1.81.0 # RUST_VER
355+
- image: cimg/rust:1.86 # RUST_VER
383356
auth:
384357
username: $DOCKER_USER
385358
password: $DOCKER_PASS
@@ -392,7 +365,12 @@ jobs:
392365
- write-version
393366
- run:
394367
name: Build Spanner Docker image
395-
command: docker build -t app:build --build-arg DATABASE_BACKEND=spanner .
368+
# Build w/ the Oracle libmysqlclient-dev for TLS support
369+
command: >
370+
docker build -t app:build
371+
--build-arg DATABASE_BACKEND=spanner
372+
--build-arg MYSQLCLIENT_PKG=libmysqlclient-dev
373+
.
396374
no_output_timeout: 30m
397375
# save the built docker container into CircleCI's cache. This is
398376
# required since Workflows do not have the same remote docker instance.
@@ -404,6 +382,9 @@ jobs:
404382
- run:
405383
name: Save docker-compose config
406384
command: cp docker-compose*spanner.yaml /home/circleci/cache
385+
- run:
386+
name: Save Makefile to cache
387+
command: cp Makefile /home/circleci/cache
407388
- save_cache:
408389
key: spanner-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
409390
paths:
@@ -465,7 +446,7 @@ jobs:
465446

466447
mysql-e2e-tests:
467448
docker:
468-
- image: docker/compose:1.24.0
449+
- image: cimg/base:2025.04
469450
auth:
470451
username: $DOCKER_USER
471452
password: $DOCKER_PASS
@@ -477,14 +458,24 @@ jobs:
477458
- run:
478459
name: Restore Docker image cache
479460
command: docker load -i /home/circleci/cache/docker.tar
461+
- run:
462+
name: Restore Makefile from save_cache
463+
command: cp /home/circleci/cache/Makefile .
480464
- run:
481465
name: Restore docker-compose config
482466
command: cp /home/circleci/cache/docker-compose*.yaml .
483-
- run-e2e-mysql-tests
467+
- make-test-dir
468+
- run-e2e-tests:
469+
db: mysql
470+
- store-test-results
471+
- gcs-configure-and-upload:
472+
source: workflow/test-results
473+
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
474+
extension: xml
484475

485476
spanner-e2e-tests:
486477
docker:
487-
- image: docker/compose:1.24.0
478+
- image: cimg/base:2025.04
488479
auth:
489480
username: $DOCKER_USER
490481
password: $DOCKER_PASS
@@ -496,10 +487,20 @@ jobs:
496487
- run:
497488
name: Restore Docker image cache
498489
command: docker load -i /home/circleci/cache/docker.tar
490+
- run:
491+
name: Restore Makefile from save_cache
492+
command: cp /home/circleci/cache/Makefile .
499493
- run:
500494
name: Restore docker-compose config
501495
command: cp /home/circleci/cache/docker-compose*.yaml .
502-
- run-e2e-spanner-tests
496+
- make-test-dir
497+
- run-e2e-tests:
498+
db: spanner
499+
- store-test-results
500+
- gcs-configure-and-upload:
501+
source: workflow/test-results
502+
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
503+
extension: xml
503504

504505
sqlite-e2e-tests:
505506
docker:

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
<a name="0.18.3"></a>
2+
## 0.18.3 (2025-05-14)
3+
4+
5+
#### Chore
6+
7+
* bump to latest rust ([0148e04d](https://github.com/mozilla-services/syncstorage-rs/commit/0148e04dd2881869ffe52b6ebb93be6929f31a25))
8+
* update python cryptography (#1690) ([e93bb882](https://github.com/mozilla-services/syncstorage-rs/commit/e93bb8821ccdf94e34c184f51ad86f0388333f3d))
9+
* added build-and-push to GAR (#1654) ([cb37e2aa](https://github.com/mozilla-services/syncstorage-rs/commit/cb37e2aa4134d5e8e0c11178e267d3e7565da05d))
10+
* upload test artifacts to gcs ([aeedcf1e](https://github.com/mozilla-services/syncstorage-rs/commit/aeedcf1e19e622b4f0d0e9c813ba4da3c712f125))
11+
* switch back to libmariadb-dev (#1665) ([e0093a88](https://github.com/mozilla-services/syncstorage-rs/commit/e0093a88bfc059a891c1a5d3f74cef068b720861))
12+
* migrate tokenserver tests to pytest with junit output ([15840c5e](https://github.com/mozilla-services/syncstorage-rs/commit/15840c5ecfd1e6fbcd239bed0f50cf3537631775))
13+
* migrate unit tests to nextest and llvm-cov ([8c56cae8](https://github.com/mozilla-services/syncstorage-rs/commit/8c56cae8905325345972a4abe99c12c1fc1b012c))
14+
15+
#### Features
16+
17+
* build docker w/ Oracle's libmysqlclient (#1695) ([569e5100](https://github.com/mozilla-services/syncstorage-rs/commit/569e5100839245cd5869bb12b655b7fe571fbbcf))
18+
* emit oauth verification timeouts as metrics (not sentry) (#1694) ([624eced1](https://github.com/mozilla-services/syncstorage-rs/commit/624eced1e9cad6492a38397c9440b558d263cca0))
19+
20+
#### Bug Fixes
21+
22+
* re-enable tokensever e2e tests ([d0336c88](https://github.com/mozilla-services/syncstorage-rs/commit/d0336c8869e52a48e49fed989b5ac9573a3b1e55))
23+
* avoid underflow of the queued_tasks metric ([10daab06](https://github.com/mozilla-services/syncstorage-rs/commit/10daab06cf35cf5696aa6ed6b790d8115bfeb432))
24+
* Revert "fix: avoid underflow of the queued_tasks metric (#1628)" ([31dda136](https://github.com/mozilla-services/syncstorage-rs/commit/31dda136809879b8e7f91f095bc378bb41b9f304))
25+
* resolve pyo3 vuln deprecations (#1682) ([0675930a](https://github.com/mozilla-services/syncstorage-rs/commit/0675930a155d27bbf2eca2c0abf81d262a9cfb28))
26+
* **infra:** configure gcp utils before upload (#1698) ([5dcfefe2](https://github.com/mozilla-services/syncstorage-rs/commit/5dcfefe2b6a8946f02c7bfac2fd641b0a6a3356b))
27+
28+
#### Test
29+
30+
* **e2e:** run integration and e2e tests with pytest (#1697) ([6f15ad54](https://github.com/mozilla-services/syncstorage-rs/commit/6f15ad546d3c5234986db09fec485fb911624e5f))
31+
32+
#### Doc
33+
34+
* add tokenserver documentation to sync (#1681) ([dadbcea3](https://github.com/mozilla-services/syncstorage-rs/commit/dadbcea3f7428ad7f0a5ae6f0c2ad966c331660a))
35+
* update purge script's status now that it's running (#1679) ([6f0c7b28](https://github.com/mozilla-services/syncstorage-rs/commit/6f0c7b28db3f8a2701c4af4dfe7a2d691fc079ef))
36+
* document pruning scripts (#1645) ([7c9bc008](https://github.com/mozilla-services/syncstorage-rs/commit/7c9bc0089dd73a9ecaba8b33e26634b2a69b5ff0))
37+
38+
#### Refactor
39+
40+
* kill tokenserver's TokenType now that it's solely oauth ([a26ff490](https://github.com/mozilla-services/syncstorage-rs/commit/a26ff490b8086ce3c12b837ca00cc757caa54169))
41+
* simplify metric_label to return a &str ([0ca435fb](https://github.com/mozilla-services/syncstorage-rs/commit/0ca435fb1a05f073d1e78ed420d953a00c8d0d53))
42+
43+
44+
145
<a name="0.18.2"></a>
246
## 0.18.2 (2024-12-05)
347

0 commit comments

Comments
 (0)