Tries to run tests on `/collections/null?_fd=0&pb=0` if the store has no custom collections
JasonHassold opened this issue · 3 comments
In the case where you have a store that only contains smart collections the lighthouse-ci-action will try to run tests on /collections/null?_fd=0&pb=0
since null
is the response that it gets from collection_response="$(api_request "$host/admin/api/2021-04/custom_collections.json?published_status=published&limit=1")"
The request should probably instead be made to the /collections.json
API route
The /collections.json
route doesn't seem to exist. Unless I'm misreading our own docs 🙈
But we definitely could try to ping /smart_collections.json
when the result is null.
Haha you are right that it isn't documented but I tried it and it seems to be working. I was originally going to recommend checking if it is null
and then pinging /smart_collections.json
as a backup, but then I just tried /collections.json
(which imo makes sense as a route) and it returned a result. The docs should probably be updated to include this route since it seems to be a part of the API, but idk where to report that
Thanks for letting me know. I'll ping the docs team!