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 a caches.json file that provides meta data about AMP Caches. #9804
Conversation
Currently contains only Google info. CC @dknecht :) Adds a generic path that checks the validity of all JSON files in the repo. Fixes ampproject#7259 Related to ampproject#6174
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.
LGTM with a few minor comments.
"updatePingApiUrlPrefix": "https://cdn.ampproject.org/" | ||
} | ||
] | ||
} |
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.
nit: Some json files in the code base have a trailing newline while others don't. Not sure what the preferred choice is here.
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.
Yeah, I added one here. Doesn't matter so much :)
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.
What's involved in getting the cloudflare cache listed here? Where is this mapping used? Should we create a follow up PR to add the cloudflare cache?
}); | ||
} | ||
|
||
gulp.task('json-syntax', 'Check that JSON files are valid JSON.', checkValidJson); |
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.
nit: missing a trailing newline
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.
Done
build-system/tasks/json-check.js
Outdated
JSON.parse(file.contents.toString()); | ||
} catch (e) { | ||
util.log(util.colors.red('Invalid JSON in "' | ||
+ file.relative + ': ' + e.message)); |
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.
nit: Missing a closing double quote before :
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.
Done
build-system/tasks/json-check.js
Outdated
@@ -0,0 +1,45 @@ | |||
/** | |||
* Copyright 2015 The AMP HTML Authors. All Rights Reserved. |
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.
2017
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.
Done
build-system/pr-check.js
Outdated
@@ -224,6 +224,7 @@ const command = { | |||
timedExecOrDie(`${gulp} clean`); | |||
}, | |||
runLintChecks: function() { | |||
timedExecOrDie(`${gulp} json-syntax`); |
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.
Depending on how long gulp json-syntax
is expected to take, it could be run before or after gulp lint
, which takes about 1m 20s to run. It makes a difference on Travis if we early-exit by running quicker tests before longer-running ones (provided, of course, there's no dependency between the tests).
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.
It is much faster (8s), so this order should be good.
build-system/pr-check.js
Outdated
@@ -224,6 +224,7 @@ const command = { | |||
timedExecOrDie(`${gulp} clean`); | |||
}, | |||
runLintChecks: function() { |
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.
Maybe rename this to runLintAndJsonChecks
for implicit documentation in other parts of this file?
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.
Done
@oliy Sent a PR, but the only usage right now is to discover update-ping endpoints, so you should only add yourself when you are ready to receive traffic. |
* Revert "Add a caches.json file that provides meta data about AMP Caches. (#9804)" This reverts commit 55a3ac0. * Revert "Fix flaky amp-animation test (#9817)" This reverts commit 4a9cf91. * Revert "Run integration tests for PRs that change `test/integration` (#9807)" This reverts commit 233c76e. * Revert "Finally, fix visState integration tests (#9806)" This reverts commit 47f9191. * Revert "add jwt plugin (#8672)" This reverts commit a23cbd1. * Revert "Add missing methods to AmpContext tests (#9682)" This reverts commit 646f103.
Currently contains only Google info. CC @dknecht :)
Adds a generic path that checks the validity of all JSON files in the repo.
Fixes #7259
Related to #6174