📡 [src] add --repo persistent view#278
Open
chicks-net wants to merge 3 commits into
Open
Conversation
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new persistent “repo mode” to gh-observer that watches all active PRs for a repository (plus optional non-PR branch workflow runs), with additional rate-limit visibility and new config knobs to control refresh/fade behavior.
Changes:
- Introduces
--repo(persistent repo watcher) and--all-branches(show branch runs across all branches) CLI flags. - Adds new TUI model/view/update loop for repo mode, including PR grouping + optional branch-run sections and fade-out behavior.
- Extends GitHub client helpers (repo parsing/current repo detection, GraphQL PR rollup fetch, REST workflow run fetch) and adds config defaults + examples for repo mode.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Adds --repo/--all-branches flags and routes execution into persistent repo mode. |
| internal/tui/view.go | Adds a “rate limit critical” indicator when remaining quota is very low. |
| internal/tui/runview.go | Adds a “rate limit critical” indicator when remaining quota is very low. |
| internal/tui/repoview.go | New repo-mode TUI rendering: repo header, PR groups, optional branch run sections, rate-limit line. |
| internal/tui/repoupdate.go | New repo-mode update loop: periodic polling, rate-limit backoff, fade-out filtering, branch-run fetching. |
| internal/tui/repoupdate_test.go | Unit tests covering fade-out behavior for repo-mode PR checks and branch runs. |
| internal/tui/repomodel.go | New repo-mode model/state and constructor. |
| internal/tui/constants.go | Adds rate warning threshold constant used by the views. |
| internal/github/repo.go | Adds parsing for owner/repo or GitHub repo URL and auto-detection from git remote. |
| internal/github/repo_test.go | Tests for repo-argument parsing. |
| internal/github/repo_runs.go | Adds branch workflow run fetching + job enrichment for repo mode. |
| internal/github/repo_runs_test.go | Tests for run inclusion logic and conversion helpers. |
| internal/github/repo_graphql.go | Adds GraphQL query to fetch open PRs and their check-rollups in one call. |
| internal/github/client.go | Adds helper to fetch a repo’s default branch via REST API. |
| internal/config/config.go | Adds repo-mode refresh/fade/show-branch-runs settings with defaults. |
| .config.example.yaml | Documents new repo-mode config keys and their defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+164
to
+168
| // resolveRepoArg resolves the owner/repo from the --repo flag value. | ||
| // If the value is empty, it auto-detects the current repo from git remote. | ||
| func resolveRepoArg(val string) (string, string, error) { | ||
| if val != "" { | ||
| return ghclient.ParseRepoArg(val) |
Comment on lines
+66
to
+70
| opts.Status = "" | ||
| opts.Created = ">=" + time.Now().Add(-fadeWindow).Format(time.DateOnly) | ||
|
|
||
| completedRuns, rateLimit2, err := fetchBranchRunPage(ctx, client, owner, repo, opts) | ||
| if err != nil { |
Comment on lines
+54
to
+60
| return RepoModel{ | ||
| ctx: ctx, | ||
| token: token, | ||
| client: client, | ||
| owner: owner, | ||
| repo: repo, | ||
| prs: make(map[int]PRViewData), |
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.
Done
Meta
(Automated in
.just/gh-process.just.)