Skip to content

fix: prevent stale pull request notification reports - #40

Merged
burmudar merged 4 commits into
mainfrom
wburgin/2026-10-02/codenotify-current-pr-comparison
Oct 2, 2026
Merged

burmudar merged 4 commits into
mainfrom
wburgin/2026-10-02/codenotify-current-pr-comparison

Conversation

@burmudar

@burmudar burmudar commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Generates notification reports from current PR state and validates that state before publishing a comment.

  • Use go-github v92 for webhook types and live PR reads.
  • Use exact base/head commits for the diff, base subscriptions, and report header.
  • Prepare comment mutations before the final state check; retry a base change once and skip superseded, draft, or closed PRs.

Test plan

$ go test ./... -run '^TestGitHubNotificationsCurrentComparison$' -count=1
ok  github.com/sourcegraph/codenotify  5.960s

$ go test ./... -count=1
ok  github.com/sourcegraph/codenotify  5.841s

$ docker build --platform linux/amd64 --progress=plain -t codenotify:current-pr-check .
#13 naming to docker.io/library/codenotify:current-pr-check done
#13 DONE 0.5s

@burmudar burmudar mentioned this pull request Oct 2, 2026
Base automatically changed from wburgin/2026-10-02/codenotify-go-1.26 to main October 2, 2026 09:20
@burmudar
burmudar marked this pull request as ready for review October 2, 2026 09:31
@sourcegraph-bot

Copy link
Copy Markdown

Codenotify: Notifying subscribers in CODENOTIFY files for diff 0c93fc6...e99471e.

Notify File(s)
@nicksnyder README.md
go.mod
go.sum
main.go
main_test.go

@burmudar burmudar self-assigned this Oct 2, 2026
@burmudar
burmudar requested a review from filiphaftek October 2, 2026 09:36
@burmudar
burmudar merged commit 35c907f into main Oct 2, 2026
4 checks passed
@burmudar
burmudar deleted the wburgin/2026-10-02/codenotify-current-pr-comparison branch October 2, 2026 09:41
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.

3 participants