Repository navigation
fix(rules): crawl/robots-txt reports a wildcard Disallow: / that Googlebot or Bingbot is re-allowed past as robots-txt-disallow-wildcard - #1786
Conversation
…lebot or Bingbot is re-allowed past as robots-txt-disallow-wildcard Signed-off-by: Бат-Орших <[email protected]>
|
Reviewed head: 1fc677e Verdict: pending maintainer review. No correctness bugs found. The change adds a new check name and moves some files from fail to warn, which is a scoring and severity decision for the maintainer. Thanks for the focused fix, tests and docs. Findings, most severe first:
nik |
…w exceptions, with and without a Googlebot group that allows / Signed-off-by: Бат-Орших <[email protected]>
|
@nc9 thanks for the review. 2: I added two tests. One is 3: I went through every branch. I'll leave the warn-vs-fail call and the Googlebot/Bingbot list to the maintainer, and CI is waiting on workflow approval. |
|
Reviewed head: 2e52042 Verdict: pending maintainer review. The new commit is test-only and closes finding 2 of the last review; the design decision in finding 1 is still open. Changes since the last reviewed head (1fc677e), one commit touching only
Conventions: DCO sign-off present on the new commit, no new dependency; CHANGELOG and rule docs were covered in the earlier review and are unchanged by this commit. nik |
Signed-off-by: Бат-Орших <[email protected]>
Signed-off-by: Бат-Орших <[email protected]>
Signed-off-by: Бат-Орших <[email protected]>
|
Reviewed head: 35ed92b Verdict: pending maintainer review. The design decision from the earlier reviews (warn vs fail, and whether only Googlebot and Bingbot count) is still the maintainer's call, and the branch needs a rebase before anything else. Changes since the last reviewed head (2e52042): three merge commits of main (6f7202f, e724c48, 35ed92b). Of the PR's own files only Findings, most severe first:
Conventions: DCO sign-off present on the merge commits, rule docs updated, no new runtime dependency. nik |
|
Landed in bundle #1799, rebase-merged to main. nik |
crawl/robots-txtonly looked at theUser-agent: *group. A file withUser-agent: */Disallow: /plusUser-agent: Googlebot/Allow: /failedrobots-txt-disallow("robots.txt blocks all crawling"), although Google may crawl the site.When the
*group hasDisallow: /, the rule now looks for aGooglebotorBingbotgroup (matched without case). It asks the sharedisRobotsTxtDisallowedmatcher whether that crawler may fetch/. If one may, the rule emitsrobots-txt-disallow-wildcard(warn) instead, naming the crawlers still allowed in the value and the items.robots-txt-disallowkeeps its meaning: it fails only when no named group re-allows a major search crawler. Groups for other bots, or a Googlebot group with its ownDisallow: /, still give the failure. Only one of the two checks is emitted per run.The rule now declares
meta.checks(it is removed fromrule-checks-undeclared.json). Therobots-txt-disallowclean check clears both problem checks.robots-txt-disallowis still emitted, so its tracking key does not move and nosupersededChecksentry is added. The rule page and the CHANGELOG describe both checks.Tests: new
packages/rules/tests/robots-txt-disallow.test.tscovers a wildcard-only block, a wildcard block with a Googlebot allow, a wildcard block with a named group for another bot, a named group that only disallows a subpath (case-insensitive), and the pass case. It also asserts that every emitted check is declared. Two of these cases fail without the change.Ran:
bun teston the new test file, robots-txt-crawl-delay, rule-check-declarations, and the rules/audit-engine tests that run this rule (131 pass),bun run typecheckin packages/rules, oxlint on the changed files, andbun run docs:check.🤖 Generated with Claude Code
Fixes #1783
This change was prepared with an AI coding agent (Claude) and reviewed by me before submitting. I'm happy to make any changes you'd like.