Skip to content

M6: Discussions & Projects (GraphQL) + Auto-merge#293

Draft
michaeljolley wants to merge 1 commit into
mjolley/m5-workflow-runsfrom
mjolley/m6-discussions-projects
Draft

M6: Discussions & Projects (GraphQL) + Auto-merge#293
michaeljolley wants to merge 1 commit into
mjolley/m5-workflow-runsfrom
mjolley/m6-discussions-projects

Conversation

@michaeljolley

Copy link
Copy Markdown

Part of the RayCast parity roadmap. Stacked on top of #292 (M5).

What this adds

Introduces a minimal GraphQL client alongside the Octokit REST client to reach capabilities REST does not expose.

  • GraphQL foundation: GitHubGraphQLClient / IGitHubGraphQLClient POST queries + mutations using the signed-in developer's OAuth token. The GraphQL endpoint is derived from the REST base address, so github.com works today and GHES (M8) will work once the host is configurable.
  • Discussions (My + Search): \DiscussionsPage\ is a \DynamicListPage; the user types a search query and results come from GraphQL \search(type: DISCUSSION). Top-level My Discussions (\�uthor:@me) and Search Discussions commands.
  • Projects (My): \ProjectsPage\ lists the signed-in user's Projects v2 via \�iewer.projectsV2. Top-level My Projects command.
  • Enable/Disable Auto-merge (deferred from M3): GraphQL-only mutation. \GitHubAutoMergeManager\ resolves the PR node id then calls \�nablePullRequestAutoMerge\ / \disablePullRequestAutoMerge. Wired into \MutationCommandsFactory\ so open PRs now offer Enable and Disable auto-merge.
  • Discussions/Projects icons, ResW strings, composition-root wiring.

Tests

  • Endpoint resolution (github.com + GHES), discussion/project mapping, auto-merge resolve-then-mutate, page rendering.
  • 201/201 tests pass.

Notes

  • Discussions/Projects are live-fetch (like Notifications/Workflow Runs), kept out of the search-keyed SQLite cache.
  • Both Enable and Disable auto-merge are offered since current auto-merge state is not queried up front.

Add a minimal GraphQL client alongside the Octokit REST client to cover
capabilities REST does not expose: Discussions, Projects v2, and pull-request
auto-merge (deferred from M3).

- GitHubGraphQLClient / IGitHubGraphQLClient: POSTs queries and mutations using
  the logged-in developer's OAuth token; derives the GraphQL endpoint from the
  REST base address so github.com and (later) GHES both work.
- Discussions: IDiscussion / Discussion, IDiscussionsDataManager /
  DiscussionsDataManager (GraphQL search, type DISCUSSION). DiscussionsPage is a
  DynamicListPage combining a base query with typed text; top-level My
  Discussions (author:@me) and Search Discussions commands.
- Projects: IProject / Project, IProjectsDataManager / ProjectsDataManager
  (viewer.projectsV2). ProjectsPage lists the signed-in user's projects; a
  top-level My Projects command.
- Auto-merge (deferred from M3): IGitHubAutoMergeManager /
  GitHubAutoMergeManager resolves the PR node id then enables/disables auto-merge
  via GraphQL. Wired into MutationCommandsFactory so open PRs offer Enable and
  Disable auto-merge (non-destructive).
- Discussions/Projects icons; ResW strings; composition-root wiring.
- Tests: endpoint resolution, discussion/project mapping, auto-merge
  resolve-then-mutate, and page rendering. 201/201 tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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