Support GitHub repos in the issues/PRs panel drawer (#46) #47
No reviewers
Labels
No labels
bug
docs
enhancement
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pedromcaraujo/forge!47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "github-panel-drawer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Teaches the per-channel panel drawer to speak GitHub as a second provider, so a channel can point at a GitHub repo and get the same Issues/PRs tabs and
#palette that Forgejo channels have. Closes #46.What changed
web/panel.py— the substantive work. Refactored the hardcoded-Forgejo sidecar into aProviderbase class withForgejoProvider/GitHubProvidersubclasses, isolating the four real divergences the issue identified:token <t>vsBearer <t>(+X-GitHub-Api-Version).api.github.comfromgithub.com(or/api/v3for Enterprise), derived from the web base.{Text,Mode,Context}vs GitHub's lowercase{text,mode,context}./issuesreturns PRs too, so they're filtered out to match the issues-only tab.modules/forge.nix—githubadded to thetypeenum; generalised option docs; a build-time assertion that a panel carriesrepo/tokenFile(andbaseUrlfor Forgejo).modules/launcher.nix—panelUrlacceptsgithuband defaults its web base togithub.com.web/index.html—isRepoPanel()/forgeLabel()helpers replace the three per-type checks and make user-visible strings ("Open in GitHub ↗", palette tooltip) provider-aware. Renderer and palette are otherwise unchanged.flake.nix— theevalcheck now configures both a Forgejo and a GitHub panel, so both providers' config paths are exercised in CI.Design note
The two-host question resolves without a new config field:
baseUrlstays the web host (what the drawer links to), and each provider derives its own API host. For public GitHub,baseUrlis optional and defaults tohttps://github.com.Verification
nix flake checkpasses; the builtchannels.jsonshows a GitHub panel resolving tourl: https://github.com/<owner>/<repo>withrepo/tokenFilekept server-side.python3 -m py_compile web/panel.pyclean;nixpkgs-fmtclean.Not covered