Bug 1467563 - Don't send any telemetry for rollbacks that were never rolled out r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D1591
This commit is contained in:
Mike Cooper 2018-06-08 09:32:37 +00:00
Родитель 332df0f776
Коммит 7b91d4140a
2 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -24,8 +24,7 @@ class PreferenceRollbackAction extends BaseAction {
const rollout = await PreferenceRollouts.get(rolloutSlug);
if (!rollout) {
TelemetryEvents.sendEvent("unenrollFailed", "preference_rollback", rolloutSlug, {"reason": "rollout missing"});
this.log.info(`Cannot rollback ${rolloutSlug}: no rollout found with that slug`);
this.log.debug(`Rollback ${rolloutSlug} not applicable, skipping`);
return;
}

Просмотреть файл

@ -117,7 +117,7 @@ decorate_task(
},
);
// Test that a rollback without a matching rollout
// Test that a rollback without a matching rollout does not send telemetry
decorate_task(
PreferenceRollouts.withTestMock,
withSendEventStub,
@ -129,12 +129,7 @@ decorate_task(
await action.runRecipe(recipe);
await action.finalize();
Assert.deepEqual(
sendEventStub.args,
[["unenrollFailed", "preference_rollback", "missing-rollout", {reason: "rollout missing"}]],
"an unenrollFailure event should be sent",
);
// This is too common a case for an error, so it should be reported as success
Assert.deepEqual(sendEventStub.args, [], "an unenrollFailure event should not be sent");
Assert.deepEqual(
reportRecipeStub.args,
[[recipe.id, Uptake.RECIPE_SUCCESS]],