Skip to content

feat: add per-section host field for multi-host support#749

Open
phgermanov wants to merge 5 commits intodlvhdr:mainfrom
phgermanov:feature/per-section-host
Open

feat: add per-section host field for multi-host support#749
phgermanov wants to merge 5 commits intodlvhdr:mainfrom
phgermanov:feature/per-section-host

Conversation

@phgermanov
Copy link
Copy Markdown

Summary

Add per-section host field to support querying multiple GitHub hosts (github.com and GitHub Enterprise) in the same dashboard.

Closes #737

Example config

prSections:
  - title: Enterprise PRs
    filters: is:open author:@me
    host: github.enterprise.com
  - title: GitHub.com PRs  
    filters: is:open author:@me
    # no host = default

How did you test this change?

  • Added unit tests for host field parsing in parser_test.go
  • All existing tests pass (go test ./...)
  • Manual testing with multi-host config

Images/Videos

N/A - no UI changes, configuration-only feature

@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Jan 28, 2026

This is great! Can you also add it under the docs at docs/src/content/docs/configuration/pr-section.mdx and docs/src/content/docs/configuration/issue-section.mdx and docs/src/content/docs/configuration/notification-section.mdx?

@phgermanov
Copy link
Copy Markdown
Author

@dlvhdr thanks, docs are added.

func FetchNotifications(limit int, repoFilters []string, readState NotificationReadState, pageInfo *PageInfo) (NotificationsResponse, error) {
client, err := getRESTClient()
func FetchNotifications(limit int, repoFilters []string, readState NotificationReadState, pageInfo *PageInfo, host string) (NotificationsResponse, error) {
client, err := getRESTClientForHost(host)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This file has a lot of calls to getRESTClient(). Probably all calls should now
use getRESTClientForHost(), no?

Copy link
Copy Markdown
Author

@phgermanov phgermanov Mar 6, 2026

Choose a reason for hiding this comment

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

Done. All call sites now go through getRESTClientForHost(host), which falls back to getRESTClient() internally when host is empty bce56f6

}
log.Debug("Fetching PRs", "query", query, "limit", limit, "endCursor", endCursor)
err = client.Query("SearchPullRequests", &queryResult, variables)
err = c.Query("SearchPullRequests", &queryResult, variables)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

there are a lot of commands for issues and prs like assigning, commenting etc.
Would these work when acting on a PR from a different host?

Copy link
Copy Markdown
Author

@phgermanov phgermanov Mar 6, 2026

Choose a reason for hiding this comment

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

addressed in the latest push bce56f6

Extend host parameter to issue and PR task functions
(CloseIssue, ReopenIssue, AssignIssue, UnassignIssue,
CommentOnIssue, LabelIssue, AssignPR, UnassignPR,
CommentOnPR, ApprovePR) so gh CLI commands target the
correct GitHub host for enterprise configurations.
Also resolves merge conflicts from main.
…osts

- Extract AssigneesFromLogins, AddAssignees, RemoveAssignees to data/assignee.go
  (removes identical copies from prssection and issuessection)
- Cache GraphQL and REST clients per host to avoid re-creating them on every API call
- Extract getCurrSectionHost() helper to eliminate repeated 3-line pattern in ui.go
- Reuse buildTaskId() in issue task functions instead of inline fmt.Sprintf
- Consolidate notify/notifyErr into shared notifyWithErr
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.

Feature Request: Support multiple GitHub hosts in a single view

2 participants