feat: add per-section host field for multi-host support#749
feat: add per-section host field for multi-host support#749phgermanov wants to merge 5 commits intodlvhdr:mainfrom
Conversation
|
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? |
|
@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) |
There was a problem hiding this comment.
This file has a lot of calls to getRESTClient(). Probably all calls should now
use getRESTClientForHost(), no?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
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
Summary
Add per-section
hostfield to support querying multiple GitHub hosts (github.com and GitHub Enterprise) in the same dashboard.Closes #737
Example config
How did you test this change?
parser_test.gogo test ./...)Images/Videos
N/A - no UI changes, configuration-only feature