Skip to content

Fix PR link matching after Slack mentions - #67

Open
chausler wants to merge 1 commit into
DataDog:masterfrom
chausler:codex/fix-slack-link-matching
Open

Fix PR link matching after Slack mentions#67
chausler wants to merge 1 commit into
DataDog:masterfrom
chausler:codex/fix-slack-link-matching

Conversation

@chausler

@chausler chausler commented Jul 30, 2026

Copy link
Copy Markdown

Problem

A common Slack review request puts a user-group mention before the PR link:

<!subteam^S1234> CR Please - <https://github.com/example/repo/pull/42|github.com/example/repo/pull/42>

The current greedy link expression captures from the mention opening bracket through the PR link closing bracket. Because that captured value no longer starts with the PR URL, Slapr logs No message found requesting review, exits successfully, and never adds the status reaction.

This means a natural mention-first review request silently loses its automation even though the workflow is green. Slapr should find the PR URL regardless of preceding Slack markup so a successful job reliably updates the message review state.

Summary

  • match each Slack-formatted HTTP link independently when locating a PR review request
  • allow user-group mentions or other Slack markup before the PR URL
  • add regression coverage for the observed message shape above

Validation

  • /private/tmp/slapr-venv/bin/python -m pytest (28 passed)
  • docker build -t slapr:codex-link-match-test .
  • docker run --rm --entrypoint python slapr:codex-link-match-test -c "import slapr"

@chausler
chausler marked this pull request as ready for review July 30, 2026 04:41
@chausler

chausler commented Jul 30, 2026

Copy link
Copy Markdown
Author

@chouetz could you review this fix and approve the fork workflow run if needed? It fixes Slack review messages where a mention appears before the PR link; the full local test suite and Docker image validation pass. Thanks!

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.

1 participant