Skip to content

github: tolerate free-text introduction lines in the stack footer parser - #1419

Open
netproteus wants to merge 1 commit into
facebook:mainfrom
netproteus:footer-parser
Open

github: tolerate free-text introduction lines in the stack footer parser#1419
netproteus wants to merge 1 commit into
facebook:mainfrom
netproteus:footer-parser

Conversation

@netproteus

@netproteus netproteus commented Aug 19, 2026

Copy link
Copy Markdown

Split out of #1410 per review feedback (discussion) — that PR makes the footer's review link configurable; this one hardens the parser that reads the footer back. The two are independent: this change applies directly to main.

Motivation

The stack footer is part of the PR description, so anything that edits the description on github.com can perturb it: an author adding a test plan from the web UI, a reviewer fixing a typo, a bot that rewrites PR bodies. Today, any non-bullet line left between the footer marker and the bullet list makes parse_stack_information return [], and the only symptom is that sl pr pull silently stops linking the stack — no error is shown.

ReviewStack's own parser already implements this more tolerant grammar: eden/contrib/reviewstack/src/saplingStack.ts treats non-bulleted lines after the marker as introduction prose, and its design comment anticipates that text changing over time ("particularly if someone wants to run their own fork of ReviewStack") — which #1410 enables.

Behavior

  • After the modern [//]: # (BEGIN SAPLING FOOTER) marker, free-text lines before the first bullet are skipped.
  • Text after the bullet list still terminates the list (unchanged).
  • Legacy marker-less bodies keep the conservative behavior — free text still ends the search — so detection cannot regress for pre-marker PRs.

Tests

Doctests cover the tolerated introduction, after-list termination, and the legacy conservative path.

🤖 Generated with Claude Code

@meta-cla meta-cla Bot added the CLA Signed label Aug 19, 2026
parse_stack_information() previously gave up at the first non-bullet
line after the footer marker unless that line happened to start with
"Stack created with [Sapling]". Editing the footer prose on github.com
(or customizing it) therefore silently broke `sl pr pull` ancestor
linking, even though ReviewStack's client-side parser explicitly
treats such lines as a free-text introduction.

Once the modern "[//]: # (BEGIN SAPLING FOOTER)" marker has been seen,
skip non-bullet lines before the first stack entry instead of aborting;
the first non-bullet line after the entries still terminates the list.
Legacy marker-less bodies keep the previous conservative behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Change-Id: I5001d29f86e81b842f6bb5c9f7e4fe74dda24627
@meta-codesync

meta-codesync Bot commented Aug 19, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D116548305. (Because this pull request was imported automatically, there will not be any future comments.)

@facebook-github-tools

Copy link
Copy Markdown

@netproteus has updated the pull request. You must reimport the pull request before landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant