Repository navigation
feat(consistency-audit): check that the info.xml links are reachable - #372
Merged
Merged
Conversation
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #352
consistency-auditnow reads the links of the App Store listing fromappinfo/info.xml:<website>,<bugs>,<repository>, the<user>,<admin>and<developer>links of<documentation>, every<screenshot>with itssmall-thumbnail, and<donation>. Each URL is asked once per run with aHEAD, and with aGETwhere a server answers 400, 403, 405 or 501 toHEAD. Redirects are followed one hop at a time, up to five, so a permanent one can be named. A request waits 10 seconds at most, and all of them run at once.link-dead[!]: 404 or 410, a host that does not resolve, or no http(s) URL. A<repository>or<bugs>that is not http(s) stays withrepository-link, so it is not reported twice.screenshot-not-image[!]: a screenshot that answers without animage/*content type, such as agithub.com/.../blob/...page.link-error[i]: any other 4xx or 5xx, a timeout, a refused connection or a redirect loop. These may be temporary, or come from a server that refuses requests without a browser, so they are noted and not counted as dead.link-redirect[i]: a chain of permanent redirects (301 or 308), with its target. A move that only drops.gitor a trailing slash is not named, since<repository>states the git URL and the forge sends it to its page.link-insecure[i]: anhttp://link that the server does not move to https, while the same address answers over https.[ok]with the number of links when none of these applies.Two ids are new beyond the issue. A screenshot pinned to a release tag of the app's own repository (#304), which answers 404 while the checkout has no such tag, is
link-pending[i] as long as its file is in the working tree; without the file it islink-dead. The repository is taken from the origin remote, asmake versiontakes it. A tag that origin has and the checkout lacks, as in a shallow clone, answers and is checked like any other link.link-unchecked[i] says that the links were not asked, either withNO_NETWORK=1or--no-network, or because not one of them answered, which is a run without network rather than a listing full of dead links.Until now the audit read nothing from the network itself; make handed in the server majors and the Node schedule. The links are now the one exception. The file header, the summary line of the report, the help and the skill say so, and
NO_NETWORK=1(asCONSISTENCY_AUDIT_NO_NETWORK) leaves them out. The text ofrepository-link, which said the audit reads no network, now points tolink-dead.Tested on a fixture against a local server that answers 200, 404, 301, 302, 405 to HEAD, 503, a redirect loop and an HTML page as a screenshot, with an unresolvable host, a tag-pinned screenshot with and without its file, and an http link next to a local https server. Each produced its finding. On a shallow clone of ernolf/twofactor_oath the four tag-pinned screenshots answer, and the
.gitredirect of<repository>is not named.NO_NETWORK=1throughmake consistency-audit RUNTIME=barereportslink-unchecked.make lint-markdownandreuse lintpass.