Bug 1664259 - Corrects misspelled constant CAPABILITES_MISMATCH. r=emalysz

Differential Revision: https://phabricator.services.mozilla.com/D110494
This commit is contained in:
Kajal Sah 2021-04-01 18:38:36 +00:00
parent 706a175110
commit 1113406969
10 changed files with 17 additions and 17 deletions

View File

@ -167,7 +167,7 @@ class BaseAction {
// If capabilties don't match, we can't even be sure that the arguments // If capabilties don't match, we can't even be sure that the arguments
// should be valid. In that case don't try to validate them. // should be valid. In that case don't try to validate them.
if (suitability !== BaseAction.suitability.CAPABILITES_MISMATCH) { if (suitability !== BaseAction.suitability.CAPABILITIES_MISMATCH) {
try { try {
recipe.arguments = this.validateArguments(recipe.arguments); recipe.arguments = this.validateArguments(recipe.arguments);
} catch (error) { } catch (error) {
@ -308,7 +308,7 @@ BaseAction.suitability = {
* Use caution when interacting with this recipe, as it may not match the * Use caution when interacting with this recipe, as it may not match the
* expected schema. * expected schema.
*/ */
CAPABILITES_MISMATCH: "RECIPE_SUITABILITY_CAPABILITIES_MISMATCH", CAPABILITIES_MISMATCH: "RECIPE_SUITABILITY_CAPABILITIES_MISMATCH",
/** /**
* The recipe is suitable to execute in this client. * The recipe is suitable to execute in this client.
@ -339,7 +339,7 @@ BaseAction.suitabilitySet = new Set(Object.values(BaseAction.suitability));
BaseAction.suitabilityToUptakeStatus = { BaseAction.suitabilityToUptakeStatus = {
[BaseAction.suitability.SIGNATURE_ERROR]: Uptake.RECIPE_INVALID_SIGNATURE, [BaseAction.suitability.SIGNATURE_ERROR]: Uptake.RECIPE_INVALID_SIGNATURE,
[BaseAction.suitability.CAPABILITES_MISMATCH]: [BaseAction.suitability.CAPABILITIES_MISMATCH]:
Uptake.RECIPE_INCOMPATIBLE_CAPABILITIES, Uptake.RECIPE_INCOMPATIBLE_CAPABILITIES,
[BaseAction.suitability.FILTER_MATCH]: Uptake.RECIPE_SUCCESS, [BaseAction.suitability.FILTER_MATCH]: Uptake.RECIPE_SUCCESS,
[BaseAction.suitability.FILTER_MISMATCH]: Uptake.RECIPE_DIDNT_MATCH_FILTER, [BaseAction.suitability.FILTER_MISMATCH]: Uptake.RECIPE_DIDNT_MATCH_FILTER,

View File

@ -172,7 +172,7 @@ class BranchedAddonStudyAction extends BaseStudyAction {
break; break;
} }
case BaseAction.suitability.CAPABILITES_MISMATCH: { case BaseAction.suitability.CAPABILITIES_MISMATCH: {
if (study?.active) { if (study?.active) {
await this.unenroll(recipe.id, "capability-mismatch"); await this.unenroll(recipe.id, "capability-mismatch");
} }

View File

@ -83,7 +83,7 @@ class PreferenceExperimentAction extends BaseStudyAction {
break; break;
} }
case BaseAction.suitability.CAPABILITES_MISMATCH: { case BaseAction.suitability.CAPABILITIES_MISMATCH: {
if (experiment && !experiment.expired) { if (experiment && !experiment.expired) {
await PreferenceExperiments.stop(slug, { await PreferenceExperiments.stop(slug, {
resetValue: true, resetValue: true,

View File

@ -38,8 +38,8 @@ should be treated with extreme suspicion.
This should be considered a temporary error, because it may be related to This should be considered a temporary error, because it may be related to
server errors, local clocks, or other temporary problems. server errors, local clocks, or other temporary problems.
``CAPABILITES_MISMATCH`` ``CAPABILITIES_MISMATCH``
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
The recipe requires capabilities that this recipe runner does not have. Use The recipe requires capabilities that this recipe runner does not have. Use
caution when interacting with this recipe, as it may not match the expected caution when interacting with this recipe, as it may not match the expected
schema. schema.

View File

@ -78,7 +78,7 @@ class ActionsManager {
// If the recipe doesn't have matching capabilities, then a missing action // If the recipe doesn't have matching capabilities, then a missing action
// is expected. In this case, don't send an error // is expected. In this case, don't send an error
} else if (suitability !== BaseAction.suitability.CAPABILITES_MISMATCH) { } else if (suitability !== BaseAction.suitability.CAPABILITIES_MISMATCH) {
log.error( log.error(
`Could not execute recipe ${recipe.name}:`, `Could not execute recipe ${recipe.name}:`,
`Action ${recipe.action} is either missing or invalid.` `Action ${recipe.action} is either missing or invalid.`

View File

@ -469,7 +469,7 @@ var RecipeRunner = {
break; break;
} }
case BaseAction.suitability.CAPABILITES_MISMATCH: { case BaseAction.suitability.CAPABILITIES_MISMATCH: {
await Uptake.reportRecipe( await Uptake.reportRecipe(
recipe, recipe,
Uptake.RECIPE_INCOMPATIBLE_CAPABILITIES Uptake.RECIPE_INCOMPATIBLE_CAPABILITIES
@ -541,7 +541,7 @@ var RecipeRunner = {
Array.from(runnerCapabilities) Array.from(runnerCapabilities)
)}` )}`
); );
yield BaseAction.suitability.CAPABILITES_MISMATCH; yield BaseAction.suitability.CAPABILITIES_MISMATCH;
} }
} }
} }

View File

@ -338,7 +338,7 @@ decorate_task(async function() {
const verifySpy = sinon.spy(action, "validateArguments"); const verifySpy = sinon.spy(action, "validateArguments");
await action.processRecipe( await action.processRecipe(
recipe, recipe,
BaseAction.suitability.CAPABILITES_MISMATCH BaseAction.suitability.CAPABILITIES_MISMATCH
); );
ok(!verifySpy.called, "validateArguments should not be called"); ok(!verifySpy.called, "validateArguments should not be called");
}); });

View File

@ -201,7 +201,7 @@ decorate_task(
capabilities: ["impossible-capability"], capabilities: ["impossible-capability"],
filter_expression: "true", filter_expression: "true",
}), }),
BaseAction.suitability.CAPABILITES_MISMATCH, BaseAction.suitability.CAPABILITIES_MISMATCH,
"Recipes with non-matching capabilities should not pass" "Recipes with non-matching capabilities should not pass"
); );
ok(!evalSpy.called, "Filter should not be evaluated"); ok(!evalSpy.called, "Filter should not be evaluated");
@ -415,7 +415,7 @@ decorate_task(
processRecipeStub.args, processRecipeStub.args,
[ [
[compatibleRecipe, BaseAction.suitability.FILTER_MATCH], [compatibleRecipe, BaseAction.suitability.FILTER_MATCH],
[incompatibleRecipe, BaseAction.suitability.CAPABILITES_MISMATCH], [incompatibleRecipe, BaseAction.suitability.CAPABILITIES_MISMATCH],
], ],
"recipes should be marked if their capabilities aren't compatible" "recipes should be marked if their capabilities aren't compatible"
); );

View File

@ -1336,7 +1336,7 @@ decorate_task(
isTemporaryError: true, isTemporaryError: true,
}, },
{ {
suitability: BaseAction.suitability.CAPABILITES_MISMATCH, suitability: BaseAction.suitability.CAPABILITIES_MISMATCH,
isTemporaryError: false, isTemporaryError: false,
}, },
{ {
@ -1495,7 +1495,7 @@ decorate_task(
withStudiesEnabled(), withStudiesEnabled(),
async function test_non_temporary_error_clears_temporary_error_deadline() { async function test_non_temporary_error_clears_temporary_error_deadline() {
let suitabilitiesThatShouldClearDeadline = [ let suitabilitiesThatShouldClearDeadline = [
BaseAction.suitability.CAPABILITES_MISMATCH, BaseAction.suitability.CAPABILITIES_MISMATCH,
BaseAction.suitability.FILTER_MATCH, BaseAction.suitability.FILTER_MATCH,
BaseAction.suitability.FILTER_MISMATCH, BaseAction.suitability.FILTER_MISMATCH,
BaseAction.suitability.ARGUMENTS_INVALID, BaseAction.suitability.ARGUMENTS_INVALID,

View File

@ -503,7 +503,7 @@ decorate_task(
isTemporaryError: true, isTemporaryError: true,
}, },
{ {
suitability: BaseAction.suitability.CAPABILITES_MISMATCH, suitability: BaseAction.suitability.CAPABILITIES_MISMATCH,
isTemporaryError: false, isTemporaryError: false,
}, },
{ {
@ -667,7 +667,7 @@ decorate_task(
PreferenceExperiments.withMockExperiments([]), PreferenceExperiments.withMockExperiments([]),
async function test_non_temporary_error_clears_temporary_error_deadline() { async function test_non_temporary_error_clears_temporary_error_deadline() {
let suitabilitiesThatShouldClearDeadline = [ let suitabilitiesThatShouldClearDeadline = [
BaseAction.suitability.CAPABILITES_MISMATCH, BaseAction.suitability.CAPABILITIES_MISMATCH,
BaseAction.suitability.FILTER_MATCH, BaseAction.suitability.FILTER_MATCH,
BaseAction.suitability.FILTER_MISMATCH, BaseAction.suitability.FILTER_MISMATCH,
BaseAction.suitability.ARGUMENTS_INVALID, BaseAction.suitability.ARGUMENTS_INVALID,