Skip to content

🪜 [src] watch whole repos persistently#274

Closed
chicks-net wants to merge 2 commits into
mainfrom
chicks/2026-05-16-repo-persist
Closed

🪜 [src] watch whole repos persistently#274
chicks-net wants to merge 2 commits into
mainfrom
chicks/2026-05-16-repo-persist

Conversation

@chicks-net
Copy link
Copy Markdown
Member

Done

  • 🪜 [src] watch whole repos persistently
  • document in README

Meta

(Automated in .just/gh-process.just.)

Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Signed-off-by: Christopher Hicks <chicks.net@gmail.com>
Copilot AI review requested due to automatic review settings May 16, 2026 17:28
Comment thread internal/tui/repoview.go
var duration string
if run.RunStartedAt != nil && !run.RunStartedAt.IsZero() {
if run.Status == "completed" && run.UpdatedAt != nil && !run.UpdatedAt.IsZero() {
duration = timing.FormatDuration(run.UpdatedAt.Time.Sub(run.RunStartedAt.Time))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
QF1008: could remove embedded field "Time" from selector (staticcheck)

Comment thread main.go
var duration string
if run.RunStartedAt != nil && !run.RunStartedAt.IsZero() {
if run.Status == "completed" && run.UpdatedAt != nil && !run.UpdatedAt.IsZero() {
duration = timing.FormatDuration(run.UpdatedAt.Time.Sub(run.RunStartedAt.Time))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
QF1008: could remove embedded field "Time" from selector (staticcheck)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds repository-wide workflow-run watching and persist-mode support to gh-observer, including configuration and README updates.

Changes:

  • Adds --repo/-r parsing, repo-watch mode, and repo-watch TUI/snapshot rendering.
  • Adds persist-mode state and refresh behavior to PR and Actions run watchers.
  • Adds repo flag parsing, repo workflow-run fetching helpers, config defaults, and documentation.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
README.md Documents repo-wide monitoring, persist mode, and config.
main.go Adds --repo, parsing, repo-watch dispatch, and snapshot output.
internal/tui/view.go Shows persist-mode status in PR view.
internal/tui/update.go Adds persist polling and new-commit reset handling.
internal/tui/runview.go Shows persist-mode status in run view.
internal/tui/runupdate.go Keeps run watcher alive in persist mode.
internal/tui/runmodel.go Adds persist fields to run model.
internal/tui/repoview.go Adds repo-watch TUI rendering.
internal/tui/repoupdate.go Adds repo-watch TUI update/fetch loop.
internal/tui/repomodel.go Adds repo-watch model state.
internal/tui/model.go Adds persist fields to PR model.
internal/tui/messages.go Adds repo-watch update message.
internal/github/runs.go Adds repository workflow-run fetch and exit helpers.
internal/github/pr.go Adds --repo value parsing.
internal/github/pr_test.go Adds repo flag parser tests.
internal/config/config.go Adds persist refresh interval config.
.config.example.yaml Documents persist refresh interval and links setting.
Comments suppressed due to low confidence (1)

internal/tui/repoview.go:129

  • The repo-watch icon mapping omits action_required from the failure cases, so those failed workflow runs render with the default neutral marker instead of a failure indicator. This is inconsistent with the exit-code logic that treats action_required as a failure.
		case "failure", "timed_out":
			return "✗"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/tui/update.go
Comment on lines +119 to +122
return m, tea.Batch(
fetchCheckRuns(m.ctx, m.token, m.owner, m.repo, m.prNumber),
tick(m.refreshInterval),
)
Comment thread internal/github/runs.go
Comment on lines +37 to +41
for {
runs, resp, err := client.Actions.ListRepositoryWorkflowRuns(ctx, owner, repo, opts)
if err != nil {
return nil, rateLimitRemaining, fmt.Errorf("failed to list repository workflow runs: %w", err)
}
Comment thread main.go
Comment on lines +151 to +157
prNumber, _, _, err := ghclient.GetCurrentPRWithRepo()
if err != nil {
// No PR detected — watch the repo's workflow runs
return runArgs{mode: modeRepoWatch, owner: flagOwner, repo: flagRepo, persist: persist}, nil
}
// PR detected — use it with the flag's owner/repo
return runArgs{mode: modePR, owner: flagOwner, repo: flagRepo, prNumber: prNumber, persist: persist}, nil
Comment thread internal/tui/repoview.go
Comment on lines +73 to +77
case "failure", "timed_out":
style = m.styles.Failure
case "cancelled", "skipped":
style = m.styles.Queued
default:
Comment thread internal/github/runs.go
Comment on lines +89 to +91
// FailureRunConclusion returns true if the conclusion indicates a failed run.
func FailureRunConclusion(conclusion string) bool {
return conclusion == "failure" || conclusion == "timed_out" || conclusion == "action_required"
Comment thread internal/tui/repoview.go
Comment on lines +38 to +40
name := run.DisplayTitle
if len(name) > 40 {
name = name[:37] + "..."
Comment thread main.go
Comment on lines +461 to +463
name := run.DisplayTitle
if len(name) > 40 {
name = name[:37] + "..."
Comment thread internal/tui/repoview.go
Comment on lines +86 to +90
styledIcon := style.Render(icon)
styledStatus := style.Render(status)
styledDuration := style.Render(duration)

fmt.Fprintf(&b, "%s %-40s %-10s %-10s %s\n", styledIcon, name, styledStatus, styledDuration, branch)
Comment thread internal/tui/update.go
Comment on lines +100 to +101
if m.persist {
cmds = append(cmds, fetchPRInfo(m.ctx, m.token, m.owner, m.repo, m.prNumber))
// fetchRepositoryRuns fetches recent workflow runs for the repository.
func fetchRepositoryRuns(ctx context.Context, token, owner, repo string) tea.Cmd {
return func() tea.Msg {
client, err := ghclient.NewClient(ctx)
@chicks-net
Copy link
Copy Markdown
Member Author

Failed attempt at #269

@chicks-net chicks-net closed this May 18, 2026
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.

2 participants