New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce experiment for new Fast Fetch signature verifier #11127
Introduce experiment for new Fast Fetch signature verifier #11127
Conversation
@@ -1961,8 +2000,22 @@ describe('amp-a4a', () => { | |||
sandbox.restore(); | |||
}); | |||
|
|||
it('should emit upgradeDelay lifecycle ping', () => { | |||
it('should emit upgradeDelay lifecycle ping with legacy verifier', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the description here read "...with new verifier" and the test below it "...with legacy verifier"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding off on merge until we all agree testing shows proper behavior.
} else if (/a4a-legacy-verifier/.test(win.location.hash)) { | ||
forceExperimentBranch(win, VERIFIER_EXP_NAME, LEGACY_VERIFIER_EID); | ||
} else { | ||
randomlySelectUnsetExperiments(win, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't actually need to put this in the else given randomlySelectUnsetExperiments should do nothing if you've already forced the experiment on.
return win[propertyName] || | ||
(win[propertyName] = new LegacySignatureVerifier(win)); | ||
if (!win[propertyName]) { | ||
if (/a4a-new-verifier/.test(win.location.hash)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let expId = (/a4a-new-verifier/.test(win.location.hash) && NEW_VERIFIER_EID) || (/a4a-legacy-verifier/.test(win.location.hash) && LEGACY_VERIFIER_EID);
if (expId) {
forceExperimentBranch(win, VERIFIER_EXP_NAME, expId);
}
randomlySelectUnset...
Once a traffic fraction is set, this will cause production traffic to start using the new signature verifier.
Related to #7618. Follow-up to #10674.
CC @ampproject/cloudflare