Skip to content

Fix isSectionEmpty to ignore Jira reference links and previous footer#21

Merged
gobetti merged 1 commit intomainfrom
fix/auto-fill-pr-jira-noise
Mar 4, 2026
Merged

Fix isSectionEmpty to ignore Jira reference links and previous footer#21
gobetti merged 1 commit intomainfrom
fix/auto-fill-pr-jira-noise

Conversation

@gobetti
Copy link
Contributor

@gobetti gobetti commented Mar 4, 2026

Summary

  • Testing Done not filled: Jira's GitHub integration appends reference-style link definitions ([IM-2611]: https://...) to the PR body. Since Testing Done is the last section, the isSectionEmpty regex captures to end-of-string and picks up this link as content, making the section appear non-empty. Fixed by stripping reference-style links, HTML comments, horizontal rules, and our own previous footer text before checking emptiness — so only genuine user-written content counts.
  • Footer --- dropped by GitHub: GitHub silently drops --- from PR bodies when it follows an HTML comment in certain contexts. Switched to *** which renders identically as a horizontal rule but survives GitHub's body processing.
  • Retry after partial fill: Previously, if Testing Done got a footer but no actual suggestions (e.g. Claude API timed out), subsequent runs would see the footer text and skip the section forever. The new stripping logic treats previous footers as noise, allowing the section to be retried.

Test plan

  • Open a PR where Jira adds a reference link before the workflow runs — Testing Done should still be filled
  • Re-run the workflow on a PR where Testing Done only has a placeholder + footer — it should attempt to fill the suggestions again
  • Verify the *** separator renders as a horizontal rule in the PR body

🤖 Generated with Claude Code


📝 Auto-filled

- Strip reference-style link definitions (e.g. [IM-2611]: url added by
  Jira's GitHub integration) from section content before checking emptiness,
  so the last section (Testing Done) is not treated as filled just because
  Jira appended a link definition below it
- Strip horizontal rules and our own footer text so a section that only
  received a footer (but no actual content) is retried on subsequent runs
- Switch footer separator from --- to *** since GitHub drops --- when
  it follows HTML comment placeholders in certain contexts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gobetti gobetti merged commit ddea896 into main Mar 4, 2026
1 check passed
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