Skip to content

✨ Add support for Mgid Ads in Web Stories#38588

Merged
calebcordry merged 30 commits intoampproject:mainfrom
mgid:VT-28545
Feb 3, 2023
Merged

✨ Add support for Mgid Ads in Web Stories#38588
calebcordry merged 30 commits intoampproject:mainfrom
mgid:VT-28545

Conversation

@velichkin
Copy link
Copy Markdown
Contributor

Adds support for the amp-ad type 'mgid' inside Web Stories. We already have integration with AMP through 3p iframe and it should work as it was before.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 16, 2022

CLA assistant check
All committers have signed the CLA.

@amp-owners-bot amp-owners-bot Bot requested a review from erwinmombay December 16, 2022 14:23
@erwinmombay erwinmombay requested review from calebcordry and powerivq and removed request for erwinmombay December 20, 2022 18:54
@erwinmombay
Copy link
Copy Markdown
Member

@powerivq @calebcordry could one of y'all take a look at this. thanks

@velichkin
Copy link
Copy Markdown
Contributor Author

@powerivq @calebcordry Please, take a look on code. Also, I see there is a problem with unit-tests, but I'm not sure it's related to our changes. When I try to run them on local machine, I'm getting same errors even on main branch.

@velichkin velichkin requested review from calebcordry and removed request for powerivq January 3, 2023 10:29
Comment thread extensions/amp-ad-network-mgid-impl/0.1/amp-ad-network-mgid-impl.js Outdated
Comment thread extensions/amp-ad-network-mgid-impl/0.1/amp-ad-network-mgid-impl.js Outdated
Comment thread extensions/amp-ad-network-mgid-impl/0.1/amp-ad-network-mgid-impl.js
Comment thread extensions/amp-ad-network-mgid-impl/0.1/amp-ad-network-mgid-impl.js
@velichkin
Copy link
Copy Markdown
Contributor Author

@calebcordry Can you help me with unit tests? There are 6 tests for amp-strategy that are permanently failing and I don't understand how it's related to my changes.

Comment thread extensions/amp-ad-network-mgid-impl/0.1/amp-ad-network-mgid-impl.js
@calebcordry
Copy link
Copy Markdown
Member

calebcordry commented Jan 24, 2023

I restarted the tests, they are likely just flaky.

@calebcordry
Copy link
Copy Markdown
Member

I restarted the tests a few times and they keep failing even though they seem unrelated. Could you try merging or rebasing latest main to see if it helps?

@velichkin
Copy link
Copy Markdown
Contributor Author

Done. Nothing changed.

@calebcordry
Copy link
Copy Markdown
Member

Yep I can repro the test failure on main, thanks for checking. I will try to fix it.

@calebcordry
Copy link
Copy Markdown
Member

calebcordry commented Jan 28, 2023

Ok I have a pending PR to fix broken tests #38656. Ill try to get that merged Monday. Thanks for your patience on this.

@calebcordry
Copy link
Copy Markdown
Member

@velichkin ok the fixed was merged. Can you try to sync to latest main one more time please?

@velichkin
Copy link
Copy Markdown
Contributor Author

@calebcordry Thanks, it's ok now. What's next?

@calebcordry
Copy link
Copy Markdown
Member

@dethstrobe can you take a look for the new folder extensions/amp-ad-network-mgid-impl creation? This is a new extension so it needs a new directory.

if (typeof networkInformation.saveData != 'undefined') {
params.push('nisd=' + (networkInformation.saveData ? 1 : 0));
}
} catch (e) {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this catch be...catching something? Or are we intentionally trying to obfuscate errors?

Do we even need a try/catch block here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intended. If in some weird browser networkInformation will be undefined, we should neither add params, neither trigger error.

}
return Services.timerFor(this.win)
.timeoutPromise(timeoutInt, referrerPromise)
.catch(() => undefined);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like another catch that is swallowing up errors. If this is intended, that's kind of odd, but we do a lot of odd things in AMP, so I guess it'll be fine. But if it's not intended then can we just remove the catch so that if there is an error, it just bubbles up like normal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intended.

@calebcordry calebcordry merged commit 181dc81 into ampproject:main Feb 3, 2023
@calebcordry
Copy link
Copy Markdown
Member

Woohoo, thanks for your patience on this one.

@ampprojectbot
Copy link
Copy Markdown
Member

Warning: disparity between this PR Percy build and its main build

The Percy build for this PR was approved (either manually by a member of the AMP team, or automatically if there were no visual diffs). However, during a continuous integration step we generated another Percy build using the commit on the main branch that this PR was merged into, and there appears to be a mismatch between the two.

This is possibly an indication of an issue with this pull request, but could also be the result of flakiness. Please inspect the two builds < This PR's Percy build / main commit's Percy build > and determine further action:

  • If the disparity appears to be caused by this PR, please create an bug report or send out a new PR to fix
  • If the disparity appears to be a flake, please @-mention ampproject/wg-approvers in a comment
  • If there is no disparity and this comment was created by mistake, please @-mention ampproject/wg-infra
  • If unsure, @-mention ampproject/wg-approvers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants