Skip to content

Commit

Permalink
Merge branch 'release-v50.0.0' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed May 20, 2022
2 parents b7176d4 + 40658a2 commit f234631
Show file tree
Hide file tree
Showing 373 changed files with 13,484 additions and 26,307 deletions.
2 changes: 1 addition & 1 deletion .buildconfig.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryVersion: 44.2.0
libraryVersion: 50.0.0
groupId: org.mozilla.telemetry
projects:
glean:
Expand Down
2 changes: 2 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
uniffi-bindgen = ["run", "--package", "embedded-uniffi-bindgen", "--"]
69 changes: 10 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ commands:
name: Turn on RUST_BACKTRACE and RUST_LOG for any job that installs rustc
command: |
echo "export RUST_BACKTRACE=1" >> $BASH_ENV
echo "export RUST_LOG=glean_core=debug,glean_ffi=debug" >> $BASH_ENV
echo "export RUST_LOG=glean_core=debug" >> $BASH_ENV
- run:
name: Setup Rust toolchain
command: |
Expand Down Expand Up @@ -150,7 +150,7 @@ commands:
steps:
- install-rustup
- setup-rust-toolchain:
rust-version: "1.53.0"
rust-version: "1.57.0"
- install-mingw
- run:
name: Install Python development tools for host
Expand Down Expand Up @@ -307,7 +307,8 @@ jobs:
- image: cimg/rust:1.60
resource_class: "medium+"
steps:
- test-rust
- test-rust:
rust-version: "1.60.0"

Rust tests - beta:
docker:
Expand All @@ -318,63 +319,11 @@ jobs:

Rust tests - minimum version:
docker:
- image: cimg/rust:1.53
- image: cimg/rust:1.57
resource_class: "medium+"
steps:
- test-rust:
rust-version: "1.53.0"

Rust FFI header check:
docker:
- image: cimg/rust:1.60
steps:
- checkout
- skip-if-doc-only
- setup-rust-toolchain:
rust-version: "nightly"
- run:
name: FFI header consistency check
command: |
CBINDGEN_VERSION=v0.20.0
CBINDGEN=cbindgen
CBINDGEN_SHA256=aef0a9e8a7ef57ee71fe877f32424e6581e54200ad7b6d62f0ab0dd881911191
curl -sfSL --retry 5 -O "https://github.com/eqrion/cbindgen/releases/download/${CBINDGEN_VERSION}/${CBINDGEN}"
echo "${CBINDGEN_SHA256} *${CBINDGEN}" | shasum -a 256 -c -
mv cbindgen ~/.cargo/bin/cbindgen
chmod +x ~/.cargo/bin/cbindgen
make cbindgen
if ! git diff --exit-code HEAD -- glean-core/ios/Glean/GleanFfi.h; then
echo "=================================================="
echo "GleanFfi.h is different from what's stored in git."
echo "Please regenerate the file using:"
echo " make cbindgen"
echo "Commit the modified file and push."
echo "=================================================="
exit 1
fi
C tests:
docker:
- image: cimg/rust:1.60
steps:
- checkout
- skip-if-doc-only
- setup-rust-toolchain:
rust-version: stable
- run:
name: FFI example
command: |
# Just a basic smoke test for now to make sure it compiles and runs
# without returning an error
cd glean-core/ffi/examples
make
./glean_app
- run:
name: Multi-bindings sample
command: |
cd samples/multi-bindings
make debug
make run
rust-version: "1.57.0"

Generate Rust documentation:
docker:
Expand Down Expand Up @@ -731,6 +680,10 @@ jobs:
- image: cimg/python:3.8
steps:
- checkout
- install-rustup
- run:
name: Run uniffi-bindgen
command: make bindgen-python
- run:
name: Python lints
command: make lint-python
Expand Down Expand Up @@ -1132,7 +1085,6 @@ workflows:
- Lint YAML with yamllint
- License check
- Lint Rust with clippy
- Rust FFI header check
- Docs internal metrics check
- Lint Android with ktlint and detekt
- Lint Python
Expand All @@ -1142,7 +1094,6 @@ workflows:
jobs:
- Rust tests - stable
- Rust tests - minimum version
- C tests
- Android tests
# iOS jobs run only on main by default, see below for manual-approved jobs
- iOS build and test:
Expand Down
7 changes: 7 additions & 0 deletions .detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ style:
# We want to allow "TODO" in comments
ForbiddenComment:
active: false
# Allow for generated code
WildcardImport:
excludeImports:
- mozilla.telemetry.glean.internal.*
# Multiple returns are ok
ReturnCount:
active: false
build:
maxIssues: 0

Expand Down
5 changes: 4 additions & 1 deletion .dictionary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 246 utf-8
personal_ws-1.1 en 248 utf-8
AAR
AARs
ABI
Expand Down Expand Up @@ -87,6 +87,7 @@ UUID
UUIDs
Unbreak
Underflowing
UniFFI
Uploaders
Wasm
WebRender
Expand All @@ -105,6 +106,7 @@ backoff
backport
barcode
bincode
bindgen
bool
boolean
booleans
Expand Down Expand Up @@ -189,6 +191,7 @@ ns
ol
ons
pdoc
perrymcmanis
pidcat
pipenv
polyfill
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 100
exclude = glean-core/python/glean/_glean_ffi.py
exclude = glean-core/python/glean/_uniffi.py
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ docs/user/appendix/changelog.md
docs/user/appendix/changelog/sdk.md
docs/user/appendix/changelog/js.md
target
.cargo

# Android stuff.
*.iml
Expand Down Expand Up @@ -65,7 +64,11 @@ samples/ios/app/.venv/
htmlcov/
*.log

glean-core/python/glean/_glean_ffi.py
glean-core/python/glean/_uniffi.py
__pycache__
*.py[cod]
.Python

# UniFFI generated code
glean-core/uniffi/src/glean_core.uniffi.rs
glean-core/uniffi/src/uniffi
35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Unreleased changes

[Full changelog](https://github.com/mozilla/glean/compare/v44.2.0...main)
[Full changelog](https://github.com/mozilla/glean/compare/v50.0.0...main)

# v50.0.0 (2022-05-20)

[Full changelog](https://github.com/mozilla/glean/compare/v44.2.0...v50.0.0)

This release is a major refactoring of the internals and contains several breaking changes to exposed APIs.
Exposed functionality should be unaffected.
See below for details.

* General
* Switch to UniFFI-defined and -generated APIs for all 3 foreign-language SDKs
* The task dispatcher has been moved to Rust for all foreign-language SDKs
* Updated to `glean_parser` v6.0.0
* Swift
* `testGetValue` on all metric types now returns `nil` when no data is recorded instead of throwing an exception.
* `testGetValue` on metrics with more complex data now return new objects for inspection.
See the respective documentation for details.
* `testHasValue` on all metric types is deprecated.
It is currently still available as extension methods.
Use `testGetValue` with not-null checks.
* Kotlin
* `testGetValue` on all metric types now returns `null` when no data is recorded instead of throwing an exception.
* `testGetValue` on metrics with more complex data now return new objects for inspection.
See the respective documentation for details.
* `testHasValue` on all metric types is deprecated.
It is currently still available as extension methods and thus require an additional import. Use `testGetValue` with not-null checks.
* On `TimingDistributionMetric`, `CustomDistributionMetric`, `MemoryDistributionMetric` the `accumulateSamples` method now takes a `List<Long>` instead of `LongArray`.
Use `listOf` instead of `longArrayOf` or call `.toList`
* `TimingDistributionMetricType.start` now always returns a valid `TimerId`, `TimingDistributionMetricType.stopAndAccumulate` always requires a `TimerId`.
* Python
* `test_get_value` on all metric types now returns `None` when no data is recorded instead of throwing an exception.
* `test_has_value` on all metric types was removed.
Use `test_get_value` with not-null checks.

# v44.2.0 (2022-05-16)

Expand Down
Loading

0 comments on commit f234631

Please sign in to comment.