Skip to content

Link branch views to their GitHub PRs - #311

Open
srid wants to merge 3 commits into
mainfrom
unholy-load
Open

Link branch views to their GitHub PRs#311
srid wants to merge 3 commits into
mainfrom
unholy-load

Conversation

@srid

@srid srid commented May 11, 2026

Copy link
Copy Markdown
Member

Branch and job pages now show a direct GitHub PR link when the branch has one. Vira derives the GitHub repository from the configured clone URL, asks gh pr list for a matching head branch, and renders a compact external PR button beside the existing page actions.

The lookup keeps the no-PR, unsupported-repo, and failed-lookup states separate. To avoid shelling out on every page load, branch PR lookups now go through a bounded in-process cache: entries live for 60 seconds, are keyed by clone URL plus branch, and are capped at 256 entries. Failed fresh lookups are logged; cached failures stay quiet.

This also records the project rule to never force push and never rebase in the APM source instructions, with generated agent files refreshed through just apm.

Verified

nix develop -c cabal build all
nix develop -c cabal run gh-test
nix develop -c cabal run git-effectful-test
nix develop -c cabal run vira-tests
nix develop -c hlint packages/vira/src/Vira/Web/PullRequestCache.hs packages/vira/src/Vira/App/Type.hs packages/vira/src/Vira/App/Run.hs packages/vira/src/Vira/Web/Widgets/Commit.hs packages/vira/test/Vira/Web/PullRequestCacheSpec.hs

Try it locally

nix run github:juspay/vira/unholy-load

Generated by /do on Codex (model gpt-5).

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.

1 participant