Repository navigation
Conversation
Polls one repo with a conditional REST request (ETag on the newest PR, so a 304 costs nothing) and one GraphQL query only when something moved, CI is pending, or five minutes have passed. Emits OPENED, MERGED, CLOSED, COMMENT, REVIEW, PUSH and CI events as JSON Lines (--jsonl, state in WATCHER_STATE_DIR, only state.json.next written) or as text (--once). Auth comes from `gh auth token --hostname HOST` and is only sent over https to that host's API; redirects are not followed. Any API failure exits 2 with one "METHOD path -> status" line on stderr.
… API A TCPServer fake of the REST and GraphQL endpoints plus a fake gh on PATH; GH_WATCH_NOW pins the clock. An id fixture for acme/widgets pins the event id formats. test/ is listed in .dotfiles-unmanaged since it describes the repo rather than any machine.
- Remote-derived hosts must pass `gh auth status` and get no env tokens; enterprise env tokens never reach github.com. --jsonl with WATCHER_CWD but no WATCHER_REPO exits 2 instead of trusting the remote. - Test hooks renamed to GHWATCH_TEST_API_BASE (loopback only) and GHWATCH_TEST_NOW, out of the host's GH_* passthrough. - Events dropped by the cap set `backlog` so the next run queries even after a 304; runs with no PR query keep the old `since`. - GraphQL split: a cheap heads query (50 newest open PRs, all on the five-minute refresh; unseen PRs keep their snapshot) and a batched nested query only for PRs updated since the last poll. - Logins compare case-insensitively; CI events carry the PR author and are never demoted for being `me`. - Unexpected data exits 2 with one line; nil guards in paging. - MAX_PAGES truncation is a failure; the *.ghe.com api. fallback fires only on the first request with no cached base. - Empty COMMENTED reviews that wrap inline comments are skipped; the issue CLOSED fixture no longer has closed_by.
- open_heads keeps paging between refreshes while hasNextPage and the last head's updatedAt is at or after the query window - complete() fails when it stops at MAX_CONN with the oldest node still inside the window - fetch_details fails when a batch's repository comes back nil - owner/name (and --wake-team) reject . and .. so --repo ../.. cannot leave --state-dir - with GHWATCH_TEST_API_BASE set, send GHWATCH_TEST_TOKEN or a fixed fake token and never ask gh for the real one Tests cover each case against the loopback fake API; token_for's auth rules are now tested in a subprocess with an explicit env.
A PR with more than MAX_CONN (100) comments, reviews, or review-thread replies in the poll window raised instead of advancing `since`, so every later poll hit the same limit and the repo never progressed. On truncation, keep what was fetched, hold `since` at the oldest fetched timestamp instead of letting it reach @now, set the backlog flag so the next poll runs a full query, and warn loudly instead of failing. (Confirmed separately: the open-PR paging raise at full_query time is self-healing — it only fires when refresh is false, and refresh forces itself true at least every FULL_EVERY seconds regardless of prior failures, so it doesn't wedge the same way. EOF )
- Require a non-empty UNTIL and slots >= 1 before honoring a ~/Library/Caches/heavy/slots override (0 slots or a missing UNTIL used to misbehave, e.g. BSD seq 1 0 running two slots instead of pausing). - Clamp the effective slot count to at least 1 after the env and override are both applied. - Accept an override file with no trailing newline (read's exit status after a complete EOF-terminated line was treated as a failure and the override was silently ignored). - Reject an UNTIL more than 7 days out, and show "(override until X)" in the waiting message when an override is active. - Validate HEAVY_SLOTS and HEAVY_MIN_IDLE are numeric on startup instead of looping forever with "integer expression expected". - Cache idle() once per loop pass instead of sampling CPU twice (the gate check and the status line) every minute.
…ild screenshots in ~/tmp/wt-* worktrees
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
bin/gh-watch, a Ruby poller (stdlib plusgh) that reports new PR comments, reviews and state changes for watcher hosts.sincenever advances after a partial read: open-PR paging, truncated connections and missing details fail the run instead.ghtoken.bin/h3checksH3_TIMEOUTup front.Tests:
ruby test/gh-watch_test.rb(46 runs, 0 failures) against a fake API on loopback;bin/script-lintclean; parses on system Ruby 2.6.bin/shell-lintandbin/dotfiles-link-checkfail on master already, on files this PR doesn't touch.— 🤖 Opus 5.5, posting on behalf of @ericboehs