Skip to content

M4: Create flows (issue/PR/branch) + Add Comment#291

Draft
michaeljolley wants to merge 1 commit into
mjolley/m3-write-actionsfrom
mjolley/m4-create-flows
Draft

M4: Create flows (issue/PR/branch) + Add Comment#291
michaeljolley wants to merge 1 commit into
mjolley/m3-write-actionsfrom
mjolley/m4-create-flows

Conversation

@michaeljolley

Copy link
Copy Markdown

Part of the CmdPal GitHub extension parity roadmap (stacked on M3, PR #290).

Summary

Adds create/write flows built on \FormContent, plus the Add Comment action deferred from M3.

Create manager

  • \IGitHubCreateManager\ / \GitHubCreateManager\ (Octokit REST): create issue, create pull request, create branch (resolves the source ref SHA then creates
    efs/heads/...), and add a comment to an issue/PR.
  • \ParseOwnerRepo\ accepts both the short \owner/repo\ form and a full GitHub URL.

Forms, templates, and pages

  • Adaptive-card forms: \CreateIssueForm, \CreatePullRequestForm, \CreateBranchForm, \AddCommentForm, each with its own template under \Controls/Templates.
  • Required-field validation via the card; success/error toasts through \FormEventHelper.
  • Reusable \GitHubFormPage\ host wires each form to a \StatusMessage.

Command surface

  • Top-level commands: Create Issue, Create Pull Request, Create Branch.
  • Add Comment wired into the issue/PR list and detail views via the existing \MutationCommandsFactory\ (which now also holds the create manager), fulfilling the M3 deferral.

Design note

Repository and branch entry is text-input based (\owner/repo, branch names) rather than API-populated dropdowns. Dynamic pickers can be a later enhancement once a shared repo/branch lookup exists.

Tests

  • \CreateFormsTests: each form renders valid adaptive-card JSON (exercises templates + substitutions).
  • \GitHubCreateManagerTests: owner/repo parsing (short form, URL, whitespace, error cases).
  • Updated factory tests for the added Add Comment command.
  • Full suite: 186/186 passing. Build clean (x64 Debug).

Localization

Added top-level command names/subtitles, form labels/placeholders/validation errors, action titles, and success/error toasts to \Resources.resw.

Add create/write flows built on FormContent:
- IGitHubCreateManager/GitHubCreateManager for Octokit REST creates
  (issue, pull request, branch) plus issue/PR comments
- Adaptive-card forms + templates: CreateIssueForm, CreatePullRequestForm,
  CreateBranchForm, AddCommentForm
- Reusable GitHubFormPage host wiring form events to a StatusMessage
- Top-level Create Issue / Create Pull Request / Create Branch commands
- Add Comment (deferred from M3) wired into issue/PR list and detail views
  through MutationCommandsFactory

Repository/branch entry is text-input based (owner/repo, branch names) with
required-field validation. Add resource strings and unit tests covering
adaptive-card rendering and owner/repo parsing.

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