Skip to content

Commit

Permalink
Bug 1930969 - Implement remaining environment matching in the search …
Browse files Browse the repository at this point in the history
…engine selector
  • Loading branch information
Standard8 committed Dec 12, 2024
1 parent 141ff80 commit 30eab50
Show file tree
Hide file tree
Showing 6 changed files with 700 additions and 40 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions components/search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
uniffi = { version = "0.28.2" }
firefox-versioning = { path = "../support/firefox-versioning" }

[build-dependencies]
uniffi = { version = "0.28.2", features = ["build"] }
30 changes: 23 additions & 7 deletions components/search/src/configuration_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
//! This module defines the structures that we use for serde_json to parse
//! the search configuration.
use crate::{SearchApplicationName, SearchEngineClassification, SearchUrlParam};
use crate::{
SearchApplicationName, SearchDeviceType, SearchEngineClassification, SearchUpdateChannel,
SearchUrlParam,
};
use serde::Deserialize;

/// The list of possible submission methods for search engine urls.
Expand Down Expand Up @@ -134,12 +137,25 @@ pub(crate) struct JSONVariantEnvironment {
/// A vector of applications that this applies to.
#[serde(default)]
pub applications: Vec<SearchApplicationName>,
// TODO: Implement these.
// pub channels: Option<Vec<String>,
// pub experiment: Option<String>,
// pub min_version: Option<String>,
// pub max_version: Option<String>,
// pub device_type: Option<String>,

/// A vector of release channels that this section applies to (not set = everywhere).
#[serde(default)]
pub channels: Vec<SearchUpdateChannel>,

/// The experiment that this section applies to.
#[serde(default)]
pub experiment: String,

/// The minimum application version this section applies to.
#[serde(default)]
pub min_version: String,

/// The maximum application version this section applies to.
#[serde(default)]
pub max_version: String,

#[serde(default)]
pub device_type: Vec<SearchDeviceType>,
}

/// Describes an individual variant of a search engine.
Expand Down
Loading

0 comments on commit 30eab50

Please sign in to comment.