Skip to content

Fix the scope checkbox on old AI menus and add scope instructions - #8826

Merged
theletterf merged 2 commits into
mainfrom
fix/ai-menu-old-scope-label
Oct 14, 2026
Merged

theletterf merged 2 commits into
mainfrom
fix/ai-menu-old-scope-label

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

Ticking Scope the docs work on an issue whose AI menu was posted before Aug 13 now starts the check, and ScopeBot gets a short instructions file that limits scope work to 9.x and Serverless.

Why

Visha ticked the box on #7634, #7636, and #7702 and the check never ran. The menu script built its line pattern from the label text, and #7947 renamed that label from docs-issue-scope to docs-scope. Menus posted earlier never matched, so selected stayed false. Separately, docs-scope.yml points at .github/scope-instructions.md, which did not exist. On #7702 ScopeBot asked about 8.17 and 8.18, which these docs do not cover.

What

Old menus parse

getLinePattern in .github/scripts/docs_ai_menu.cjs now matches the stable marker <!-- docs-ai-menu:issue-scope --> and accepts any label text. The next refresh rewrites an old menu in the current format, so the extra Triage and Size lines on old menus disappear.

Out of scope: An old menu that is already ticked does not trigger, because the trigger needs an unticked-to-ticked change. Untick and tick the box again, or comment /scope. The PR AI menu status and docs-content-internal are separate (a sibling PR covers docs-content-internal).

Scope instructions

.github/scope-instructions.md says that this repository documents Elastic Stack 9.x and Serverless, and that ScopeBot should not ask about or recommend 8.x work unless the issue asks for an 8.x backport. It adds no other rules.

Verify

I ran the script from main and the script from this branch against the live menu bodies of #7634, #7934, and #8814 with a local Node check, which is not committed. To repeat it, copy those menu comments to files and pass each body to parseMenuState from both versions of docs_ai_menu.cjs. The output:

# docs-content#7634 (old label, ticked)
  before  {"selected":false}
  after   {"selected":true,"statusText":"Status: not started."}
# docs-content#7934 (old label, unticked)
  before  {"selected":false}
  after   {"selected":false,"statusText":"Status: not started."}
# docs-content#8814 (current label)
  before  {"selected":true,"statusText":"Status: completed. [View progress](...)."}
  after   {"selected":true,"statusText":"Status: completed. [View progress](...)."}
# transition on old menu (unticked -> ticked) issue_scope_triggered = false  [before]
# transition on old menu (unticked -> ticked) issue_scope_triggered = true  [after]
# transition on current menu = true  [before]
# transition on current menu = true  [after]

A refresh of the old ticked menu keeps the tick and writes the current label with Status: running.. I did not run the workflows themselves. I have not tested the instructions file with a ScopeBot run.

Fixes elastic/docs-eng-team#1032

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes

Tool(s) and model(s) used: Claude Code (Claude Sonnet 5.5)

🤖 Generated with Claude Code

theletterf and others added 2 commits October 13, 2026 16:54
Menus posted before the label rename in #7947 never parsed as selected, so
ticking "Scope the docs work" on them started nothing. The line pattern now
matches the stable marker and ignores the label text.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
docs-scope.yml points at this file, but it did not exist, so ScopeBot asked
about 8.x versions that these docs do not cover.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@theletterf
theletterf marked this pull request as ready for review October 13, 2026 15:55
@theletterf
theletterf requested review from a team as code owners October 13, 2026 15:55
@theletterf
theletterf requested a review from reakaleek October 13, 2026 15:55
@theletterf

Copy link
Copy Markdown
Member Author

@bmorelli25 This fixes one of the issues identified by @vishaangelova. Could you approve?

@theletterf
theletterf added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 0497ba2 Oct 14, 2026
13 checks passed
@theletterf
theletterf deleted the fix/ai-menu-old-scope-label branch October 14, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants