Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
### Glean
- Updated to v66.0.0 ([#7025](https://github.com/mozilla/application-services/issues/7025))

### Nimbus
- The `participation` field is no longer required in the Cirrus
`EnrollmentRequest` type. Instead, when users opt-out, the client application
should no longer send enrollment requests to Cirrus.
([#7030](https://github.com/mozilla/application-services/pull/7030))

[Full Changelog](In progress)

# v145.0 (_2025-10-13_)
Expand Down
9 changes: 2 additions & 7 deletions components/nimbus/src/stateless/cirrus_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::{
enrollment::{
map_features_by_feature_id, EnrolledFeatureConfig, EnrollmentChangeEvent,
EnrollmentsEvolver, ExperimentEnrollment, Participation,
EnrollmentsEvolver, ExperimentEnrollment,
},
error::CirrusClientError,
metrics::{EnrollmentStatusExtraDef, MetricsHandler},
Expand Down Expand Up @@ -43,15 +43,13 @@ impl fmt::Display for EnrollmentResponse {
/// Definitions for the fields are as follows:
/// - `client_id`: This field is the client's id as defined by the calling application. Though this is an Option type, if it is missing the method will throw a NimbusError.
/// - `context`: The application context for the request. This value will be converted into TargetingAttributes.
/// - `is_user_participating`: Whether or not the user is participating in experimentation. Defaults to `true`
/// - `next_experiments`: The list of experiments for which enrollment should be evaluated.
/// - `prev_enrollments`: The client's current list of enrollments.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
#[serde(rename_all = "camelCase")]
pub struct EnrollmentRequest {
pub client_id: Option<String>,
pub request_context: Map<String, Value>,
pub participation: Participation,
#[serde(default)]
pub prev_enrollments: Vec<ExperimentEnrollment>,
}
Expand Down Expand Up @@ -97,7 +95,6 @@ impl CirrusClient {
let EnrollmentRequest {
client_id,
request_context,
participation,
prev_enrollments,
} = match serde_json::from_str(request.as_str()) {
Ok(v) => v,
Expand All @@ -114,7 +111,6 @@ impl CirrusClient {
Ok(match serde_json::to_string(&self.enroll(
client_id,
request_context,
participation,
&prev_enrollments,
)?) {
Ok(v) => v,
Expand All @@ -126,7 +122,6 @@ impl CirrusClient {
&self,
user_id: String,
request_context: Map<String, Value>,
participation: Participation,
prev_enrollments: &[ExperimentEnrollment],
) -> Result<EnrollmentResponse> {
let available_randomization_units =
Expand All @@ -148,7 +143,7 @@ impl CirrusClient {

let (enrollments, events) = enrollments_evolver
.evolve_enrollments::<EnrolledFeatureConfig>(
participation,
Default::default(),
Default::default(),
&state.experiments,
prev_enrollments,
Expand Down
9 changes: 1 addition & 8 deletions components/nimbus/src/tests/stateless/test_cirrus_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::metrics::EnrollmentStatusExtraDef;
use crate::{
enrollment::{
EnrollmentChangeEventType, ExperimentEnrollment, NotEnrolledReason, Participation,
EnrollmentChangeEventType, ExperimentEnrollment, NotEnrolledReason,
},
tests::{
helpers::TestMetrics,
Expand Down Expand Up @@ -50,7 +50,6 @@ fn test_can_enroll() -> Result<()> {
let result = client.enroll(
"test".to_string(),
Default::default(),
Participation::default(),
&[],
)?;
assert_eq!(result.enrolled_feature_config_map.len(), 1);
Expand Down Expand Up @@ -90,7 +89,6 @@ fn test_will_not_enroll_if_previously_did_not_enroll() -> Result<()> {
let result = client.enroll(
"test".to_string(),
Default::default(),
Participation::default(),
&[enrollment],
)?;

Expand Down Expand Up @@ -119,10 +117,6 @@ fn test_handle_enrollment_works_with_json() -> Result<()> {
)]))
.unwrap(),
),
(
"participation".to_string(),
to_value(Participation::default()).unwrap(),
),
(
"nextExperiments".to_string(),
Value::Array(vec![to_value(exp.clone()).unwrap()]),
Expand Down Expand Up @@ -214,7 +208,6 @@ fn test_sends_metrics_on_enrollment() -> Result<()> {
client.enroll(
"test".to_string(),
Default::default(),
Participation::default(),
&[],
)?;

Expand Down