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

Add Unruly ad network #14828

Merged
merged 1 commit into from May 22, 2018
Merged

Conversation

davidalk
Copy link
Contributor

Executed all the test as per instructions page and performed the linting and type checks. We have also implemented renderStart as per the advice in the pull request guide.

This is a re-raised PR so the following can be closed:

#14724

This PR has the correct verified author and squashed commits.

@davidalk
Copy link
Contributor Author

Hi, is there anything else required from our side for approval?

Thanks.

@jpettitt
Copy link
Contributor

jpettitt commented May 8, 2018

I've added a couple of reviewers and restarted your CI checks.

cc @calebcordry @lannka

@davidalk
Copy link
Contributor Author

Hi, any update on this PR?

Thanks.

@calebcordry calebcordry self-assigned this May 15, 2018
Copy link
Member

@calebcordry calebcordry left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! A few small things.

ads/unruly.js Outdated
@@ -0,0 +1,28 @@
/*
Copyright 2015 The AMP HTML Authors. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

nit: 2018

ads/unruly.md Outdated
@@ -0,0 +1,26 @@
<!---
Copyright 2015 The AMP HTML Authors. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

2018

ads/unruly.md Outdated
```html
<amp-ad width="620" height="349"
type="unruly"
date-siteId="xxx">
Copy link
Member

Choose a reason for hiding this comment

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

Is this a mandatory attribute? If so could you document it as so?

Copy link
Contributor

Choose a reason for hiding this comment

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

Typo? date-siteId or data-siteId

nit: prefer data-site-id for consistency.

@@ -1140,7 +1141,7 @@ <h2>Monetizer101</h2>
type="monetizer101"
data-widget="price-comparison"
data-config='{"shopId": 1, "priceMin": 500, "nameKeywords": "iphone"}'>
</amp-ad>
Copy link
Member

Choose a reason for hiding this comment

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

👍🙂

@calebcordry calebcordry removed the request for review from lannka May 15, 2018 16:31
ads/unruly.js Outdated

export function unruly(global, data, scriptLoader = loadScript) {
global.unruly = global.unruly || {};
global.unruly.native = {
Copy link
Member

Choose a reason for hiding this comment

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

You may want to validate the input here. We have this function to help:

amphtml/3p/3p.js

Lines 213 to 227 in d86f11f

/**
* Validates given data. Throws an exception if the data does not
* contains a mandatory field. If called with the optional param
* opt_optionalFields, it also validates that the data contains no fields other
* than mandatory and optional fields.
*
* Mandatory fields also accept a string Array as an item. All items in that
* array are considered as alternatives to each other. So the validation checks
* that the data contains exactly one of those alternatives.
*
* @param {!Object} data
* @param {!Array<string|!Array<string>>} mandatoryFields
* @param {Array<string>=} opt_optionalFields
*/
export function validateData(data, mandatoryFields, opt_optionalFields) {

@davidalk
Copy link
Contributor Author

Hi @calebcordry, thanks for your review, we've made the suggested changes and pushed.

const mockGlobal = {};
let expectedGlobal;
let expectedUrl;
const scriptLoader = (...args) => {
Copy link
Member

Choose a reason for hiding this comment

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

this spread may fail lint (we sometimes have frustrating lint rules) Travis is very backed up today due to some new changes, so let's let it finish and see what happens.

edit: rest, not spread, but same idea

@calebcordry
Copy link
Member

Looking good, you will also need to rebase due to merge conflicts. Let me know if you need help with the process.

@calebcordry
Copy link
Member

Travis appears to have borked here. When you rebase it should restart it anyway.

@calebcordry calebcordry added this to TODO in 3P Ads & Analytics Support via automation May 18, 2018
@calebcordry calebcordry moved this from TODO to In Review in 3P Ads & Analytics Support May 18, 2018
@davidalk
Copy link
Contributor Author

Have fixed the conflicts and pushed.

@davidalk
Copy link
Contributor Author

@calebcordry, its failing on the Percy tests, do you know how I can check these? I don't have permission when I select the details link.

@davidalk
Copy link
Contributor Author

Have got access to Percy and can see the diff was on the amp-video.amp.html page which isn't affected by this PR. Please can you go ahead with the merge? Thanks.

@calebcordry calebcordry merged commit 4b361c3 into ampproject:master May 22, 2018
3P Ads & Analytics Support automation moved this from In Review to Done May 22, 2018
@calebcordry
Copy link
Member

Looks good. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants