Skip to content
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

🚮 Sweep experiments older than 2023-04-01 #431

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
8 changes: 0 additions & 8 deletions build-system/global-configs/canary-config.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"allow-doc-opt-in": ["amp-next-page"],
"allow-url-opt-in": [],
"amp-accordion-display-locking": 1,
"canary": 1,
"a4aProfilingRate": 0.01,
"adsense-ad-size-optimization": 1,
"doubleclickSraExp": 0.01,
"doubleclickSraReportExcludedBlock": 0.1,
"dfp-render-on-idle-cwv-exp": 1,
"expand-json-targeting": 1,
"flexAdSlots": 0.05,
"ios-fixed-no-transfer": 1,
"visibility-trigger-improvements": 1,
"ads-initialIntersection": 1,
"amp-cid-backup": 1,
"sticky-ad-transition": 0.1,
"layout-aspect-ratio-css": 1,
"tcf-post-message-proxy-api": 1,
"amp-consent-granular-consent": 1,
"disable-a4a-non-sd": 1,
"3p-vendor-split": 0.1,
"story-ad-placements": 1
}
8 changes: 0 additions & 8 deletions build-system/global-configs/prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
"allow-url-opt-in": [],
"canary": 0,
"a4aProfilingRate": 0.01,
"adsense-ad-size-optimization": 1,
"amp-accordion-display-locking": 1,
"doubleclickSraExp": 0.01,
"doubleclickSraReportExcludedBlock": 0.1,
"expand-json-targeting": 1,
"flexAdSlots": 0.05,
"ios-fixed-no-transfer": 0,
"visibility-trigger-improvements": 1,
"layout-aspect-ratio-css": 0,
"sticky-ad-transition": 0.02,
"disable-a4a-non-sd": 1,
"tcf-post-message-proxy-api": 1,
"amp-consent-granular-consent": 1,
"amp-cid-backup": 1,
"3p-vendor-split": 0.01,
"story-ad-placements": 0.01
}
5 changes: 3 additions & 2 deletions extensions/amp-a4a/0.1/amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
getConsentPolicyState,
} from '../../../src/consent';
import {getContextMetadata} from '../../../src/iframe-attributes';
import {getExperimentBranch, isExperimentOn} from '../../../src/experiments';
import {getExperimentBranch} from '../../../src/experiments';
import {getExtensionsFromMetadata} from './amp-ad-utils';
import {getMode} from '../../../src/mode';
import {insertAnalyticsElement} from '../../../src/extension-analytics';
Expand Down Expand Up @@ -2586,7 +2586,8 @@ export function isPlatformSupported(win) {
// Require Shadow DOM support for a4a.
if (
!isNative(win.Element.prototype.attachShadow) &&
isExperimentOn(win, 'disable-a4a-non-sd')
/* isExperimentOn(win, 'disable-a4a-non-sd') // launched: true */
true
) {
return false;
}
Expand Down
8 changes: 2 additions & 6 deletions extensions/amp-a4a/0.1/test/test-amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import {layoutRectLtwh, layoutSizeFromRect} from '../../../../src/layout-rect';
import {macroTask} from '../../../../testing/yield';
import {resetScheduledElementForTesting} from '../../../../src/service/custom-element-registry';
import {data as testFragments} from './testdata/test_fragments';
import {toggleExperiment} from '../../../../src/experiments';
import {data as validCSSAmp} from './testdata/valid_css_at_rules_amp.reserialized';

describes.realWin('amp-a4a: no signing', {amp: true}, (env) => {
Expand Down Expand Up @@ -254,7 +253,6 @@ describes.realWin('amp-a4a: no signing', {amp: true}, (env) => {
});

it('should fallback when shadow DOM is not supported', async () => {
toggleExperiment(env.win, 'disable-a4a-non-sd', true, true);
attachShadowStub.value(undefined);
const fallbackSpy = env.sandbox.spy(a4a, 'handleFallback_');
env.sandbox.stub(a4a, 'skipClientSideValidation').returns(false);
Expand All @@ -265,7 +263,6 @@ describes.realWin('amp-a4a: no signing', {amp: true}, (env) => {
});

it('should fallback when shadow DOM is polyfilled', async () => {
toggleExperiment(env.win, 'disable-a4a-non-sd', true, true);
attachShadowStub.value(function () {
// A non-native function.
return null;
Expand All @@ -279,7 +276,8 @@ describes.realWin('amp-a4a: no signing', {amp: true}, (env) => {
});

it('should ignore shadow DOM requirement without an experiment', async () => {
toggleExperiment(env.win, 'disable-a4a-non-sd', false, true);
/* toggleExperiment(env.win, 'disable-a4a-non-sd', false, true) // launched: true */
false;
attachShadowStub.value(undefined);
const fallbackSpy = env.sandbox.spy(a4a, 'handleFallback_');
env.sandbox.stub(a4a, 'skipClientSideValidation').returns(false);
Expand Down Expand Up @@ -1587,7 +1585,6 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {

// Remove attachShadow.
attachShadowStub.value(undefined);
toggleExperiment(fixture.win, 'disable-a4a-non-sd', true, true);

fetchMock.getOnce(
TEST_URL + '&__amp_source_origin=about%3Asrcdoc',
Expand Down Expand Up @@ -1634,7 +1631,6 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
attachShadowStub.value(function () {
return null;
});
toggleExperiment(fixture.win, 'disable-a4a-non-sd', true, true);

fetchMock.getOnce(
TEST_URL + '&__amp_source_origin=about%3Asrcdoc',
Expand Down
5 changes: 2 additions & 3 deletions extensions/amp-accordion/0.1/amp-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {createCustomEvent} from '../../../src/event-helper';
import {dev, devAssert, user, userAssert} from '../../../src/log';
import {dict} from '../../../src/utils/object';
import {getStyle, setImportantStyles, setStyles} from '../../../src/style';
import {isExperimentOn} from '../../../src/experiments';
import {
numeric,
px,
Expand All @@ -43,8 +42,8 @@ const EXPAND_CURVE_ = bezierCurve(0.47, 0, 0.745, 0.715);
const COLLAPSE_CURVE_ = bezierCurve(0.39, 0.575, 0.565, 1);

const isDisplayLockingEnabledForAccordion = (win) =>
isExperimentOn(win, 'amp-accordion-display-locking') &&
win.document.body.onbeforematch !== undefined;
/* isExperimentOn(win, 'amp-accordion-display-locking') // launched: true */
true && win.document.body.onbeforematch !== undefined;

class AmpAccordion extends AMP.BaseElement {
/** @override @nocollapse */
Expand Down
6 changes: 2 additions & 4 deletions extensions/amp-accordion/0.1/test/test-amp-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
whenUpgradedToCustomElement,
} from '../../../../src/dom';
import {poll} from '../../../../testing/iframe';
import {toggleExperiment} from '../../../../src/experiments';

describes.realWin(
'amp-accordion',
Expand Down Expand Up @@ -202,8 +201,6 @@ describes.realWin(
});

it('should expand when beforematch event is triggered on a collapsed section', async () => {
// Enable display locking feature.
toggleExperiment(win, 'amp-accordion-display-locking', true);
doc.body.onbeforematch = null;
await getAmpAccordion();
const section = doc.querySelector('section:not([expanded])');
Expand All @@ -216,7 +213,8 @@ describes.realWin(
expect(header.getAttribute('aria-expanded')).to.equal('true');

// Reset display locking feature
toggleExperiment(win, 'amp-accordion-display-locking', false);
/* toggleExperiment(win, 'amp-accordion-display-locking', false) // launched: true */
false;
doc.body.onbeforematch = undefined;
});

Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-accordion/1.0/amp-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class AmpAccordion extends BaseElement {

const {win} = this;
const displayLockingExperimentEnabled =
isExperimentOn(win, 'amp-accordion-display-locking') &&
win.document.body.onbeforematch !== undefined;
/* isExperimentOn(win, 'amp-accordion-display-locking') // launched: true */
true && win.document.body.onbeforematch !== undefined;

if (displayLockingExperimentEnabled) {
this.element.classList.add('i-amphtml-display-locking');
Expand Down
5 changes: 2 additions & 3 deletions extensions/amp-accordion/1.0/test/test-amp-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ describes.realWin(
win = env.win;
html = htmlFor(win.document);
toggleExperiment(win, 'bento-accordion', true, true);
toggleExperiment(win, 'amp-accordion-display-locking', true, true);
element = html`
<amp-accordion layout="fixed" width="300" height="200">
<section expanded id="section1">
Expand Down Expand Up @@ -658,7 +657,6 @@ describes.realWin(
let defaultBeforeMatch;

beforeEach(async () => {
toggleExperiment(win, 'amp-accordion-display-locking', true);
element = html`
<amp-accordion>
<section>
Expand All @@ -682,7 +680,8 @@ describes.realWin(
afterEach(() => {
win.CSS.supports = defaultCssSupports;
win.document.body.onbeforematch = defaultBeforeMatch;
toggleExperiment(win, 'amp-accordion-display-locking', false);
/* toggleExperiment(win, 'amp-accordion-display-locking', false) // launched: true */
false;
});

it('should expand collpased section with beforematch event', async () => {
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-analytics/0.1/analytics-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
import {dev, user, userAssert} from '../../../src/log';
import {getMode} from '../../../src/mode';
import {isArray} from '../../../src/types';
import {isExperimentOn} from '../../../src/experiments';
import {layoutRectLtwh} from '../../../src/layout-rect';
import {map} from '../../../src/utils/object';
import {provideVisibilityManager} from './visibility-manager';
Expand Down Expand Up @@ -342,7 +341,8 @@ export class AnalyticsRoot {
*/
getElements(context, selectors, selectionMethod) {
if (
isExperimentOn(this.ampdoc.win, 'visibility-trigger-improvements') &&
/* isExperimentOn(this.ampdoc.win, 'visibility-trigger-improvements') // launched: true */
true &&
isArray(selectors)
) {
userAssert(
Expand Down
22 changes: 12 additions & 10 deletions extensions/amp-analytics/0.1/test/test-analytics-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
VisibilityManagerForDoc,
VisibilityManagerForEmbed,
} from '../visibility-manager';
import {toggleExperiment} from '../../../../src/experiments';
import {user} from '../../../../src/log';

describes.realWin('AmpdocAnalyticsRoot', {amp: 1}, (env) => {
Expand Down Expand Up @@ -339,11 +338,11 @@ describes.realWin('AmpdocAnalyticsRoot', {amp: 1}, (env) => {
child.setAttribute('data-vars-id', 'child1');
child2.setAttribute('data-vars-id', 'child2');
child3.setAttribute('data-vars-id', 'child3');
toggleExperiment(win, 'visibility-trigger-improvements', true);
});

afterEach(() => {
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
});

it('should find element and elements by selector', async () => {
Expand All @@ -355,7 +354,8 @@ describes.realWin('AmpdocAnalyticsRoot', {amp: 1}, (env) => {
child2,
]);
// Check that non-experiment works
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
expect(
await root.getElements(body, '.notMyClass', null)
).to.deep.equal([child3]);
Expand Down Expand Up @@ -421,7 +421,8 @@ describes.realWin('AmpdocAnalyticsRoot', {amp: 1}, (env) => {
});

it('should find non AMP element with single selector', async () => {
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
child.classList.remove('i-amphtml-element');
child.removeAttribute('data-vars-id');
child.classList.add('myClass');
Expand Down Expand Up @@ -753,21 +754,21 @@ describes.realWin(
child.setAttribute('data-vars-id', '123');
child2.setAttribute('data-vars-id', '456');
child3.setAttribute('data-vars-id', '789');

toggleExperiment(win, 'visibility-trigger-improvements', true);
});

afterEach(() => {
child.classList.add('i-amphtml-element');
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
});

it('should find all elements by selector', async () => {
const elements = await root.getElements(body, ['.myClass'], null);

expect(elements).to.deep.equals([child, child2]);
// Check that non-experiment version works
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
expect(
await root.getElements(body, '.notMyClass', null)
).to.deep.equals([child3]);
Expand Down Expand Up @@ -829,7 +830,8 @@ describes.realWin(
});

it('should find non AMP element with single selector', async () => {
toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
child.classList.remove('i-amphtml-element');
expect(await root.getElements(body, '.myClass', null)).to.deep.equal([
child,
Expand Down
5 changes: 2 additions & 3 deletions extensions/amp-analytics/0.1/test/test-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {AmpdocAnalyticsRoot} from '../analytics-root';
import {Deferred} from '../../../../src/utils/promise';
import {Signals} from '../../../../src/utils/signals';
import {macroTask} from '../../../../testing/yield';
import {toggleExperiment} from '../../../../src/experiments';

describes.realWin('Events', {amp: 1}, (env) => {
let win;
Expand Down Expand Up @@ -2001,7 +2000,6 @@ describes.realWin('Events', {amp: 1}, (env) => {
let target2;

beforeEach(() => {
toggleExperiment(win, 'visibility-trigger-improvements', true);
readyPromise = Promise.resolve();
unlisten = env.sandbox.spy();
unlisten2 = env.sandbox.spy();
Expand Down Expand Up @@ -2045,7 +2043,8 @@ describes.realWin('Events', {amp: 1}, (env) => {
});
}

toggleExperiment(win, 'visibility-trigger-improvements', false);
/* toggleExperiment(win, 'visibility-trigger-improvements', false) // launched: true */
false;
});

it('should fire event per selector', async () => {
Expand Down
13 changes: 8 additions & 5 deletions extensions/amp-consent/0.1/amp-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {dict, hasOwn} from '../../../src/utils/object';
import {getData} from '../../../src/event-helper';
import {getServicePromiseForDoc} from '../../../src/service';
import {isArray, isEnumValue, isObject} from '../../../src/types';
import {isExperimentOn} from '../../../src/experiments';
import {toggle} from '../../../src/style';

const CONSENT_STATE_MANAGER = 'consentStateManager';
Expand Down Expand Up @@ -122,16 +121,20 @@ export class AmpConsent extends AMP.BaseElement {
this.matchedGeoGroup_ = null;

/** @private {?boolean} */
this.isTcfPostMessageProxyExperimentOn_ = isExperimentOn(
this.isTcfPostMessageProxyExperimentOn_ =
/* isExperimentOn(
this.win,
'tcf-post-message-proxy-api'
);
) // launched: true */
true;

/** @private {?boolean} */
this.isGranularConsentExperimentOn_ = isExperimentOn(
this.isGranularConsentExperimentOn_ =
/* isExperimentOn(
this.win,
'amp-consent-granular-consent'
);
) // launched: true */
true;

/** @private {?Promise<?Array>} */
this.purposeConsentRequired_ = this.isGranularConsentExperimentOn_
Expand Down
7 changes: 4 additions & 3 deletions extensions/amp-consent/0.1/consent-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {getConsentStateValue} from './consent-info';
import {getData} from '../../../src/event-helper';
import {getServicePromiseForDoc} from '../../../src/service';
import {htmlFor} from '../../../src/static-template';
import {isExperimentOn} from '../../../src/experiments';
import {setImportantStyles, setStyles, toggle} from '../../../src/style';

const TAG = 'amp-consent-ui';
Expand Down Expand Up @@ -183,10 +182,12 @@ export class ConsentUI {
/** @private {?Promise<string>} */
this.promptUISrcPromise_ = null;

this.isGranularConsentExperimentOn_ = isExperimentOn(
this.isGranularConsentExperimentOn_ =
/* isExperimentOn(
this.win_,
'amp-consent-granular-consent'
);
) // launched: true */
true;

this.init_(config, opt_postPromptUI);
}
Expand Down
Loading