Skip to content

Commit

Permalink
Merge branch 'release-v44.1.1' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
chutten committed Apr 14, 2022
2 parents 9e6009e + 5f43b21 commit be8eddc
Show file tree
Hide file tree
Showing 20 changed files with 2,048 additions and 1,737 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.1.0
libraryVersion: 44.1.1
groupId: org.mozilla.telemetry
projects:
glean:
Expand Down
1 change: 1 addition & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ reviewers:
- badboy
- Dexterp37
- travis79
- chutten

numberOfReviewers: 1
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Unreleased changes

[Full changelog](https://github.com/mozilla/glean/compare/v44.1.0...main)
[Full changelog](https://github.com/mozilla/glean/compare/v44.1.1...main)

# v44.1.1 (2022-04-14)

[Full changelog](https://github.com/mozilla/glean/compare/v44.1.0...v44.1.1)

* Rust
* Raise the global dispatcher queue limit from 100 to 1000 tasks. ([bug 1764549](https://bugzilla.mozilla.org/show_bug.cgi?id=1764549))
* iOS
* Enable expiry by version in the `sdk_generator.sh` script ([#2013](https://github.com/mozilla/glean/pull/2013))

# v44.1.0 (2022-04-06)

Expand Down
19 changes: 9 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3,657 changes: 1,977 additions & 1,680 deletions DEPENDENCIES.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ Before submitting a PR:
- "Work in progress" pull requests are allowed to be submitted, but should be clearly labeled as such and should not be merged until all tests pass and the code has been reviewed.
- For changes to Rust code
- `make test-rust` produces no test failures
- `make clippy` runs without emitting any warnings or errors.
- `make rustfmt` does not produce any changes to the code.
- `make lint-rust` runs without emitting any warnings or errors.
- For changes to Kotlin code
- `make test-kotlin` runs without emitting any warnings or errors.
- `make ktlint` runs without emitting any warnings.
Expand Down
2 changes: 2 additions & 0 deletions docs/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ To get started adding Glean to your project, choose one of the following guides:
- **[Firefox Desktop](TODO)**
- Get started adding Glean to a Firefox Desktop component. -->

For development documentation on the `Glean SDK`, refer to [the Glean SDK development book](../dev/index.html).

## Sections

### [User Guides](./user/adding-glean-to-your-project/index.html)
Expand Down
17 changes: 17 additions & 0 deletions docs/user/language-bindings/ios/ios-build-configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ For other values it will throw an error.
bash sdk_generator.sh --build-date 2022-01-03T17:30:00
```

## `--expire-by-version <INTEGER>`

Default: none.

Expire the metrics and pings by version, using the provided major version.

If enabled, expiring metrics or pings by date will produce an error.

```sh
bash sdk_generator.sh --expire-by-version 95
```

Different products have different ways to compute the product version at build-time.
For this reason the `sdk_generator.sh` script cannot provide an automated way to detect the product major version at build time.
When using the expiration by version feature in iOS,
products must provide the major version by themselves.

## `--markdown <PATH>` / `-m <PATH>`

Default: unset.
Expand Down
12 changes: 0 additions & 12 deletions docs/user/user/pings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,6 @@ It's looks like `Glean/40.0.0 (Kotlin on Android)`, where `40.0.0` is the Glean
and `Kotlin on Android` is the name of the language used by the SDK that sent the request
plus the name of the platform it is running on.

#### `X-Client-Type` (deprecated)

Custom header to support handling of Glean pings in the legacy pipeline. Values is always `Glean`.

This header is deprecated and will soon be removed from all Glean SDKs.

#### `X-Client-Version` (deprecated)

The Glean SDK version e.g. `0.40.0`, sent as a custom header to support handling of Glean pings in the legacy pipeline.

This header is deprecated and will soon be removed from all Glean SDKs.

#### `X-Debug-Id` _(optional)_

Debug header attached to Glean pings by using the [debug APIs](../../reference/debug/debugViewTag.md),
Expand Down
2 changes: 1 addition & 1 deletion glean-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glean-core"
version = "44.1.0"
version = "44.1.1"
authors = ["Jan-Erik Rediger <jrediger@mozilla.com>", "The Glean Team <glean-team@mozilla.com>"]
description = "A modern Telemetry library"
repository = "https://github.com/mozilla/glean"
Expand Down
4 changes: 2 additions & 2 deletions glean-core/ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glean-ffi"
version = "44.1.0"
version = "44.1.1"
authors = ["Jan-Erik Rediger <jrediger@mozilla.com>", "The Glean Team <glean-team@mozilla.com>"]
description = "FFI layer for Glean, a modern Telemetry library"
repository = "https://github.com/mozilla/glean"
Expand Down Expand Up @@ -36,7 +36,7 @@ once_cell = "1.2.0"

[dependencies.glean-core]
path = ".."
version = "44.1.0"
version = "44.1.1"

[target.'cfg(target_os = "android")'.dependencies]
android_logger = { version = "0.10.0", default-features = false }
Expand Down
6 changes: 2 additions & 4 deletions glean-core/ios/Glean/Net/HttpPingUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ public class HttpPingUploader {
/// - parameters:
/// * path: The URL path to append to the server address
/// * data: The serialized text data to send
/// * headers: Map of headers from Glean to annotate ping with
/// * callback: A callback to return the success/failure of the upload
///
/// Note that the `X-Client-Type`: `Glean` and `X-Client-Version`: <SDK version>
/// headers are added to the HTTP request in addition to the UserAgent. This allows
/// us to easily handle pings coming from Glean on the legacy Mozilla pipeline.
func upload(path: String, data: Data, headers: [String: String], callback: @escaping (UploadResult) -> Void) {
// Build the request and create an async upload operation using a background URLSession
if let request = self.buildRequest(path: path, data: data, headers: headers) {
Expand Down Expand Up @@ -109,6 +106,7 @@ public class HttpPingUploader {
/// - parameters:
/// * path: The URL path to append to the server address
/// * data: The serialized text data to send
/// * headers: Map of headers from Glean to annotate ping with
/// * callback: A callback to return the success/failure of the upload
///
/// - returns: Optional `URLRequest` object with the configured headings set.
Expand Down
6 changes: 3 additions & 3 deletions glean-core/ios/GleanTests/Net/HttpPingUploaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class HttpPingUploaderTests: XCTestCase {
// We specify a single additional header here.
// In usual code they are generated on the Rust side.
let request = HttpPingUploader(configuration: Configuration())
.buildRequest(path: testPath, data: Data(testPing.utf8), headers: ["X-Client-Type": "Glean"])
.buildRequest(path: testPath, data: Data(testPing.utf8), headers: ["X-Test-Only": "Glean"])

XCTAssertEqual(
request?.url?.path,
Expand All @@ -74,9 +74,9 @@ class HttpPingUploaderTests: XCTestCase {
"Request cookie policy set correctly"
)
XCTAssertEqual(
request?.value(forHTTPHeaderField: "X-Client-Type"),
request?.value(forHTTPHeaderField: "X-Test-Only"),
"Glean",
"Request X-Client-Type set correctly"
"Request header set correctly"
)
}
}
19 changes: 13 additions & 6 deletions glean-core/ios/sdk_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ ARGS:
If not specified the plugin will use the \$SCRIPT_INPUT_FILE_{N} environment variables.
OPTIONS:
-a, --allow-reserved Allow reserved names.
-o, --output <PATH> Folder to place generated code in. Default: \$SOURCE_ROOT/\$PROJECT/Generated
-g, --glean-namespace <NAME> The Glean namespace to use in generated code.
-m, --markdown <PATH> Generate markdown documentation in provided directory.
-b, --build-date <TEXT> Set a specific build date or disable build date generation with `0`.
-h, --help Display this help message.
-a, --allow-reserved Allow reserved names.
-o, --output <PATH> Folder to place generated code in. Default: \$SOURCE_ROOT/\$PROJECT/Generated
-g, --glean-namespace <NAME> The Glean namespace to use in generated code.
-m, --markdown <PATH> Generate markdown documentation in provided directory.
-b, --build-date <TEXT> Set a specific build date or disable build date generation with `0`.
--expire-by-version <INTEGER> Expire metrics by version, with the provided major version.
-h, --help Display this help message.
HEREDOC
)

Expand All @@ -71,6 +72,7 @@ ALLOW_RESERVED=""
GLEAN_NAMESPACE=Glean
DOCS_DIRECTORY=""
BUILD_DATE=""
EXPIRE_VERSION=""
declare -a YAML_FILES=()
OUTPUT_DIR="${SOURCE_ROOT}/${PROJECT}/Generated"

Expand All @@ -96,6 +98,10 @@ while (( "$#" )); do
BUILD_DATE="--option build_date=$2"
shift 2
;;
--expire-by-version)
EXPIRE_VERSION="--expire-by-version $2"
shift 2
;;
-h|--help)
helptext
exit 0
Expand Down Expand Up @@ -170,6 +176,7 @@ PARSER_OUTPUT=$("${VENVDIR}"/bin/python -m glean_parser \
-o "${OUTPUT_DIR}" \
-s "glean_namespace=${GLEAN_NAMESPACE}" \
$BUILD_DATE \
$EXPIRE_VERSION \
$ALLOW_RESERVED \
"${YAML_FILES[@]}" 2>&1) || { echo "$PARSER_OUTPUT"; echo "error: glean_parser failed. See errors above."; exit 1; }

Expand Down
2 changes: 1 addition & 1 deletion glean-core/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
history = history_file.read()

# glean version. Automatically updated by the bin/prepare_release.sh script
version = "44.1.0"
version = "44.1.1"

requirements = [
"cffi>=1.13.0",
Expand Down
4 changes: 2 additions & 2 deletions glean-core/rlb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glean"
version = "44.1.0"
version = "44.1.1"
authors = ["Jan-Erik Rediger <jrediger@mozilla.com>", "The Glean Team <glean-team@mozilla.com>"]
description = "Glean SDK Rust language bindings"
repository = "https://github.com/mozilla/glean"
Expand All @@ -22,7 +22,7 @@ maintenance = { status = "actively-developed" }

[dependencies.glean-core]
path = ".."
version = "44.1.0"
version = "44.1.1"

[dependencies]
crossbeam-channel = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion glean-core/rlb/src/dispatcher/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::sync::RwLock;

use super::{DispatchError, DispatchGuard, Dispatcher};

pub const GLOBAL_DISPATCHER_LIMIT: usize = 100;
pub const GLOBAL_DISPATCHER_LIMIT: usize = 1000;
static GLOBAL_DISPATCHER: Lazy<RwLock<Option<Dispatcher>>> =
Lazy::new(|| RwLock::new(Some(Dispatcher::new(GLOBAL_DISPATCHER_LIMIT))));

Expand Down
7 changes: 4 additions & 3 deletions glean-core/rlb/tests/overflowing_preinit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,22 @@ fn overflowing_the_task_queue_records_telemetry() {
};

// Insert a bunch of tasks to overflow the queue.
for _ in 0..110 {
for _ in 0..1010 {
metrics::rapid_counting.add(1);
}

// Now initialize Glean
common::initialize(cfg);

assert_eq!(Some(100), metrics::rapid_counting.test_get_value(None));
assert_eq!(Some(1000), metrics::rapid_counting.test_get_value(None));

// The metrics counts the total number of overflowing tasks,
// (and the count of tasks in the queue when we overflowed: bug 1764573)
// this might include Glean-internal tasks.
let val = metrics::preinit_tasks_overflow
.test_get_value(None)
.unwrap();
assert!(val >= 110);
assert!(val >= 1010);

glean::shutdown();
}
7 changes: 0 additions & 7 deletions glean-core/src/upload/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ impl Builder {
"Content-Type".to_string(),
"application/json; charset=utf-8".to_string(),
);
headers.insert("X-Client-Type".to_string(), "Glean".to_string());
headers.insert(
"X-Client-Version".to_string(),
crate::GLEAN_VERSION.to_string(),
);

Self {
document_id: None,
Expand Down Expand Up @@ -273,8 +268,6 @@ mod test {
assert!(request.headers.contains_key("Date"));
assert!(request.headers.contains_key("X-Telemetry-Agent"));
assert!(request.headers.contains_key("Content-Type"));
assert!(request.headers.contains_key("X-Client-Type"));
assert!(request.headers.contains_key("X-Client-Version"));
assert!(request.headers.contains_key("Content-Length"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ except:
void apply(Project project) {
isOffline = project.gradle.startParameter.offline

project.ext.glean_version = "44.1.0"
project.ext.glean_version = "44.1.1"

// Print the required glean_parser version to the console. This is
// offline builds, and is mentioned in the documentation for offline
Expand Down

0 comments on commit be8eddc

Please sign in to comment.