Skip to content

feat: add pipeline state machine and Copilot orchestration infrastructure#327

Draft
gambtho wants to merge 5 commits intoAzure:mainfrom
gambtho:ghp/pipeline-state-machine
Draft

feat: add pipeline state machine and Copilot orchestration infrastructure#327
gambtho wants to merge 5 commits intoAzure:mainfrom
gambtho:ghp/pipeline-state-machine

Conversation

@gambtho
Copy link
Collaborator

@gambtho gambtho commented Feb 26, 2026

Summary

Add core infrastructure for the Copilot-assisted CI/CD pipeline deployment feature. This PR introduces the state machine, auth, and orchestration layers that the pipeline UI components will build on.

What's included

  • Pipeline state machine — 14-state PipelineDeploymentState enum with reducer-based transitions, localStorage persistence, and schema versioning
  • GitHub OAuth browser flow hook — Token refresh, session restore, concurrent-refresh deduplication via mutex, and cross-component sync for independently mounted Headlamp plugin trees
  • GitHubAuthProvider context — Shared auth state across plugin components
  • Polling hook — Generic usePolling with configurable intervals, max polls, and auto-stop conditions
  • Pipeline storage utilities — Active/resumable pipeline detection
  • Copilot agent templates — Setup workflow YAML and agent instruction generation with full AKS deployment parameters
  • Pipeline orchestrationcreateSetupPR (branch, commit, open PR) and triggerCopilotAgent (parameterized issue creation)
  • Config validation — Namespace regex, required IDs, image tag format

Testing

  • 68 new tests across pipeline state machine, agent templates, and orchestration utilities
  • npm run tsc passes at each commit

Commits

  1. Pipeline state machine and GitHub auth infrastructure — State enum, reducer, polling hook, useGitHubAuth, GitHubAuthProvider, pipeline storage
  2. Copilot agent templates and pipeline orchestration — Template generation, PR creation, issue triggering, config validation, test fixtures

@gambtho gambtho changed the title Ghp/pipeline state machine feat: add GitHub Copilot pipeline deployment infrastructure Feb 26, 2026
@gambtho gambtho changed the title feat: add GitHub Copilot pipeline deployment infrastructure feat: add pipeline state machine and Copilot orchestration infrastructure Feb 26, 2026
@gambtho gambtho force-pushed the ghp/pipeline-state-machine branch from 8c9aff5 to f4f58e5 Compare February 26, 2026 16:20
@illume
Copy link
Collaborator

illume commented Feb 27, 2026

@gambtho can you please add the related issue(s)?

@illume illume added p-none No priority was assigned enhancement New feature or request labels Feb 27, 2026
Add GitHub OAuth authentication using Electron's native browser OAuth
flow via desktopApi (startBrowserOAuth + onOAuthCallback). Includes
token refresh, expiry checking, and encrypted token persistence via
Electron safeStorage with localStorage fallback for dev mode.
Add foundational types and utilities needed across the pipeline feature:

- ProjectDefinition type for project props used by pipeline components
- useAzureContext hook to resolve subscription, resource group, and tenant
  from cluster info
- getRelativeTime helper for human-readable timestamps
- openExternalUrl for Electron-aware external link handling
- CopyButton component for clipboard copy with visual feedback
Add Octokit-based GitHub API wrapper for repository listing, workflow
dispatch, and file operations. Includes pipeline-specific operations:
issue tracking, linked PR discovery, and status checks.

Define GitHub repo, workflow, and run types. Extract workflow and agent
config file path constants. Scope app install URL to selected repos.
…structure

Add core infrastructure for managing pipeline deployment lifecycle:

- PipelineDeploymentState enum with 14 states from Configured through
  Deployed, plus error states
- Reducer-based state machine with validated transitions, localStorage
  persistence, and schema versioning
- Generic polling hook with configurable intervals, max polls, and
  auto-stop conditions
- Pipeline storage utilities for detecting active/resumable pipelines
- GitHub OAuth browser flow hook with token refresh, session restore,
  and concurrent-refresh deduplication via mutex
- GitHubAuthProvider context for sharing auth state across independently
  mounted Headlamp plugin components
…ration utilities

Add template generation and multi-step orchestration for Copilot-based
CI/CD pipeline setup:

- Probe helpers for rendering health check configs as markdown and YAML
- Agent template generator producing setup workflow YAML and Copilot
  agent instructions with full AKS deployment parameters
- Pipeline orchestration: createSetupPR creates a branch, commits
  workflow + agent config, and opens a PR; triggerCopilotAgent creates
  a parameterized issue and assigns it to Copilot
- Config validation (namespace regex, required IDs, image tag format)
- Test fixtures for pipeline and container configuration
@gambtho gambtho force-pushed the ghp/pipeline-state-machine branch from f4f58e5 to 1402d1d Compare February 27, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request p-none No priority was assigned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants