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

amp-consent validator #14127

Merged
merged 3 commits into from
Mar 21, 2018

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Mar 20, 2018

For #13716

name: "amp-consent"
allowed_versions: "0.1"
allowed_versions: "latest"
requires_usage: GRANDFATHERED
Copy link
Contributor

Choose a reason for hiding this comment

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

New extensions should not be grandfathered. Please remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed


tags: { # amp-consent
html_format: AMP
html_format: EXPERIMENTAL
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this may be unintended and that this extension shouldn't be a part of EXPERIMENTAL format. (same for tags below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw a lot of tags are using the EXPERIMENTAL format : ) removed.

@honeybadgerdontcare
Copy link
Contributor

Please also include a test file (.html and .out).

}
attr_lists: "common-extension-attrs"
}
tags: { # amp-consent (json)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since <amp-consent> is unique, should this also be unique or can runtime handle multiple json scripts as children of <amp-consent>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One question: how can I specify that there should be at least one and only one json script? Is unique enough? Note <amp-consent> could have multiple other child nodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can any of the other multiple child nodes be a <script type="application/json>? If not then unique: true is what you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is to be tied expilcitly to <amp-consent> tag and only one exists then it needs:
satisfies: "amp-consent extension .json script" and unique: true.
Then <amp-consent> tag would need:
requires: "amp-consent extension .json script"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Changed.

@zhouyx zhouyx force-pushed the amp-consent-validator branch 2 times, most recently from d6b35ea to 7c88e78 Compare March 20, 2018 23:06
|
| <amp-consent id='ABC'>
>> ^~~~~~~~~
amp-consent/0.1/test/validator-amp-consent-invalid.html:33:0 The implied layout 'CONTAINER' is not supported by tag 'amp-consent'. (see https://www.ampproject.org/docs/reference/components/amp-consent) [AMP_LAYOUT_PROBLEM]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am surprised that no error against no json script was thrown here. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's because there is a json script present in the document in a correct location under an . I'd remove that second one, add the proper layout and also add a comment about what is being tested (e.g. <!-- Valid -->, <!-- Invalid: no json script tag -->

@zhouyx
Copy link
Contributor Author

zhouyx commented Mar 20, 2018

@honeybadgerdontcare I added the test. However I could not get the tests passed even after copying everything from the error message. Any ideas?

@honeybadgerdontcare
Copy link
Contributor

@zhouyx I think that is due to spaces in the license section. It looks like in travis that the blank lines have one space for each blank line in the .out file but it should be two spaces. I'd remove the blank lines between the html contents but obviously not for the license.

@zhouyx zhouyx force-pushed the amp-consent-validator branch 2 times, most recently from 3898c30 to 39a49fe Compare March 21, 2018 00:55
@honeybadgerdontcare honeybadgerdontcare merged commit a907113 into ampproject:master Mar 21, 2018
@zhouyx
Copy link
Contributor Author

zhouyx commented Mar 21, 2018

@honeybadgerdontcare Thank you for the help!

Gregable pushed a commit that referenced this pull request Mar 22, 2018
Gregable added a commit that referenced this pull request Mar 22, 2018
* Allow meta http-equiv=x-dns-prefetch-control

* Introduce excludes tagspec feature

* Revision bump for #13782

* Revision bump for #14040

* Revision bump for #14157,#14127
@Gregable
Copy link
Member

These validator changes will be live everywhere within an hour.

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

Successfully merging this pull request may close these issues.

4 participants