Skip to content

docs: Fix robots.txt extension examples - #2647

Merged
Su (sushmangupta) merged 7 commits into
mainfrom
docs/robots-txt-extension-examples
Oct 23, 2026
Merged

Su (sushmangupta) merged 7 commits into
mainfrom
docs/robots-txt-extension-examples

Conversation

@d-kirkland

Copy link
Copy Markdown
Contributor

Summary

  • The page imports RobotsDirective, RobotsDirectiveType, and RobotsUserAgentBlock from ValueObject; their source declares the Struct namespace. The edit updates both examples’ imports.
  • The page calls $event->getParsedRobots(); the event exposes ParsedRobots $parsedResult, and the parser returns that property. The edit reads $event->parsedResult in both examples.
  • The page passes userAgents: $aiCrawlers to RobotsUserAgentBlock; its constructor accepts one string $userAgent and an array of directives. The edit creates one block per crawler.
  • The page calls $parsedRobots->addUserAgentBlock($aiBlock); ParsedRobots exposes readonly constructor properties, and the parser returns the event’s parsedResult. The edit assigns a new ParsedRobots with the original properties and added blocks.

Related links

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant. (Names and values were checked against the source at the tag linked above.)
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted. (N/A, no page moved.)
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms. (No new prose words.)
  • Any required dependent changes in downstream modules have already been merged and published. (N/A)
  • This pull request is ready for review.

Notes

  • This PR was fully AI generated and requires human review. The text was drafted by an OpenAI model (gpt-6-luna) and checked by a second OpenAI model (gpt-6.1-sol), run from a Claude Code session. It has not been merged, approved or reviewed by a person. Please verify the claims and the changed text against the source before merging.
  • Defect type: Breaks (4 of 4 changes). A reader who follows the page as written ends up with code, markup or a command that fails or does not do what the page says.
  • Codebase files this change was checked against (tag v6.7.15.1): src/Storefront/Page/Robots/Event/RobotsDirectiveParsingEvent.php L19-L23; src/Storefront/Page/Robots/Parser/ParsedRobots.php L17-L21; src/Storefront/Page/Robots/Parser/RobotsDirectiveParser.php L141-L145; src/Storefront/Page/Robots/Struct/RobotsDirective.php L1-L3; src/Storefront/Page/Robots/Struct/RobotsDirectiveType.php L1-L3; src/Storefront/Page/Robots/Struct/RobotsUserAgentBlock.php L14-L17.
  • How it was found: a read-through of this page against shopware/shopware at tag v6.7.15.1, then an independent re-check by a second AI model that re-read the page and the cited source files. Please check the cited lines yourself before merging.
  • Scope: main (Shopware 6.7) only. Older docs branches are not touched.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@d-kirkland Daniel Kirkland (d-kirkland) added Improvement PR created to append/modify info in the existing article Info Missed To Document Info Missed To Document labels Oct 22, 2026
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 74b4626
Preview: https://developer-documentation-3z5b5e2yj-shopware-frontends.vercel.app
Workflow run: #5830

@github-actions

Copy link
Copy Markdown
Contributor

📢 Developer Announcement Recommendation

Recommendation: ❌ No Announcement Recommended

No developer announcement signals were detected.

This PR does not appear to introduce developer-facing changes that require a community announcement.

Comment thread guides/plugins/plugins/content/seo/extend-robots-txt.md Outdated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the line-number reconstruction with the plain issue fields, so the example stays short and matches the source.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@d-kirkland

Copy link
Copy Markdown
Contributor Author

Agent 00-Docs (an AI agent, posting from the PR author's account). Thanks for catching this: you were right, the page still used methods that do not exist.

I pushed follow-up commits to this branch (no force-push):

  • getUserAgentBlocks(), getDirectives(), getType(), getValue() and addIssue() are gone from the page. The validation example now reads the public properties (userAgentBlocks, directives, type, value), builds ParseIssue with its real fields (lineNumber, lineContent, reason, severity), and assigns a rebuilt ParsedRobots to $event->parsedResult.
  • The custom directive example now uses $event->directiveType and $event->handled instead of getDirectiveName() and setHandled().
  • One commit (f036caa) added a line-number reconstruction that made the example too complex. The next commit (1a5560b) replaces it with the simple version, so ignore the first one.

I checked the new code against ParsedRobots, ParseIssue and RobotsDirectiveParsingEvent at v6.7.15.1, and a second AI model re-checked it. A person still needs to confirm it, and I have not tested the examples by running them. The (int) cast in the crawl-delay check is unchanged from the original page.

Comment thread guides/plugins/plugins/content/seo/extend-robots-txt.md Outdated
Su (sushmangupta) and others added 2 commits October 23, 2026 11:35
Co-authored-by: Nicolas Fortier <164332867+nfortier-shopware@users.noreply.github.com>
@sushmangupta
Su (sushmangupta) merged commit 3adbe55 into main Oct 23, 2026
10 checks passed
@sushmangupta
Su (sushmangupta) deleted the docs/robots-txt-extension-examples branch October 23, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement PR created to append/modify info in the existing article Info Missed To Document Info Missed To Document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants