From 5c7d0553ff7c49b6b7e8c565b138cd9bcb444ac4 Mon Sep 17 00:00:00 2001 From: Julian Blacher Date: Sat, 24 Oct 2026 21:18:53 -0300 Subject: [PATCH 1/2] chore: release v0.4.0 Bump the version to 0.4.0 and turn the changelog's Unreleased section into 0.4.0, with a short summary. Also list two changes that landed after v0.3.0 without an entry (native OS notifications from #5, failed check names in notifications), and give 0.3.0 its own section. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 15 +++++++++++---- TASKS.md | 1 + internal/version/version.go | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2842d97..21a074e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Added -- `prw run` now notifies once (`merged` or `closed`) and automatically stops watching a PR once it is merged or closed, instead of polling it forever. This notification always fires, regardless of `--on`/`notification_filter`. +## [0.4.0] - 2026-10-24 + +prw now covers the whole PR lifecycle and is built for scripts and AI agents: it detects GitHub Actions results (previously reported as `pending` forever), works with Slack and Discord webhooks, and adds `prw wait`, `prw checks`, `prw flaky`, an MCP server, auto-watching your PRs, review and merge-conflict events, and failed-job log excerpts. It reuses your `gh` login and polls with conditional requests that cost no API quota. ### Added - `prw flaky `: finds flaky GitHub Actions jobs — jobs that failed and then passed when their workflow run was re-run on the same commit — in the repository's last `--runs` workflow runs (default 300, max 1000), grouped by workflow and job with counts, last occurrence and a link to the latest failed attempt; `--json`. Cancelled jobs (fail-fast victims) don't count. New MCP tool `get_flaky_checks`. @@ -22,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `prw wait `: blocks until the PR's CI finishes and exits `0` (success or merged), `1` (failed), `2` (timeout), `3` (other error) or `130` (interrupted). Fails fast on the first failed check, follows new pushes, retries transient API errors, and prints a JSON result with `--json`. Progress goes to stderr. - Zero-setup auth for GitHub CLI users: when no token is configured, `prw` uses `GH_TOKEN` or, failing that, the token from `gh auth token`. Lookup order: config file, `GITHUB_TOKEN`, `GH_TOKEN`, `gh auth token`. `prw config show` now reports the exact source. - Integration tests against the real GitHub API (`make integration`, build tag `integration`), run nightly by a new `Integration` workflow. They fail against the old status-only logic. +- `prw run` now notifies once (`merged` or `closed`) and automatically stops watching a PR once it is merged or closed, instead of polling it forever. This notification always fires, regardless of `--on`/`notification_filter`. +- Native OS notifications on macOS, Linux and Windows (`prw run --notify-native` or `prw config set notification_native true`), contributed by @marianogappa in #5. +- Failed check names and links are included in console notifications and in the webhook payload (`failed_checks`) ### Fixed - A check whose workflow ran more than once for the same commit (e.g. an older run cancelled by `concurrency: cancel-in-progress`) kept the PR failed even after the newer run passed. Only the newest run of each check counts now, like on GitHub. @@ -47,8 +51,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Webhook requests now time out after 10 seconds instead of waiting indefinitely, and webhook errors include the response body. - CI status now aggregates GitHub Check Runs (GitHub Actions) together with legacy commit statuses. Previously, repositories using only GitHub Actions were reported as `pending` forever and never triggered notifications. +## [0.3.0] - 2025-12-16 + ### Added -- Failed check names and links are included in console notifications and in the webhook payload (`failed_checks`) - Cross-platform prebuilt binaries (Linux, macOS, Windows) via GitHub Releases - Automated release workflow for tagged versions - Issue and pull request templates @@ -75,7 +80,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Complete documentation: README, CONTRIBUTING, SECURITY, QUICKSTART - MIT license -[Unreleased]: https://github.com/devblac/prw/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/devblac/prw/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/devblac/prw/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/devblac/prw/releases/tag/v0.3.0 [0.2.0]: https://github.com/devblac/prw/releases/tag/v0.2.0 [0.1.0]: https://github.com/devblac/prw/releases/tag/v0.1.0 diff --git a/TASKS.md b/TASKS.md index 10db5e1..d260cd8 100644 --- a/TASKS.md +++ b/TASKS.md @@ -96,6 +96,7 @@ Legend — Impact: 1–5 · Effort: S (≤½ day), M (1–2 days), L (3+ days) - ✅ #12 `prw checks ` — done (buckets fail/cancel/pending/pass/neutral/skipping, durations, links, `--json`, exit 8 while running; verified live on devblac/docker-lint#5, zephyrproject-rtos/zephyr#105183 — 35 checks, superseded run hidden — and devblac/prw#13) - ✅ #15 Failed job log excerpt — done (`--logs` on `checks`/`wait`, MCP `get_failed_logs`; parser tested on a real staticcheck failure log; verified live on cloudposse/atmos#3476, #3422 and #2199 — a commit status — and over MCP stdio) - ✅ #16 Flakiness detection — done as `prw flaky` + MCP `get_flaky_checks` (failed-then-passed across attempts of the same run; verified live: grafana/grafana 4 flaky jobs in 300 runs, hashicorp/terraform "Unit Tests"; parallel fetching cut grafana from 24s to 9s). The "status history" half was dropped: low value for its cost. +- 🚀 v0.4.0 released with everything above (PRs #6–#22). - Next: #17 packaging (Homebrew/Scoop) + keychain token storage, #8 `gh` extension publishing — both need owner decisions ## Planned diff --git a/internal/version/version.go b/internal/version/version.go index 74a6b33..cec8f58 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -3,7 +3,7 @@ package version import "fmt" var ( - Version = "0.3.0" + Version = "0.4.0" Commit = "unknown" ) From fe0aca21ba4467fd640ea4677881a7db0b740266 Mon Sep 17 00:00:00 2001 From: Julian Blacher Date: Sat, 24 Oct 2026 21:20:02 -0300 Subject: [PATCH 2/2] test: fix data race in captureStdout captureStdout restored os.Stdout right after the pipe was drained, while the goroutine running the command had read os.Stdout earlier. Closing a pipe isn't a synchronization point for the race detector, so `go test -race` on CI flagged TestChecksCmd_PendingExitCode (main went red after #21). os.Stdout is now restored after receiving the command's error from the channel, which orders the two. Co-Authored-By: Claude Opus 5.5 --- cmd/prw/main_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/prw/main_test.go b/cmd/prw/main_test.go index 5ab8e01..5ebab2b 100644 --- a/cmd/prw/main_test.go +++ b/cmd/prw/main_test.go @@ -32,9 +32,10 @@ func captureStdout(fn func() error) (string, error) { }() io.Copy(&buf, r) - os.Stdout = oldStdout - + // Restore stdout only after receiving from errCh: the channel orders fn's reads + // of os.Stdout before this write (the pipe closing doesn't, for the race detector). err := <-errCh + os.Stdout = oldStdout return buf.String(), err }