feat: Git-Ape canvas for the GitHub Copilot app (deployments, setup, launchpad)

未关闭
#507 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 3 天内回复

@arnaudlh 已经在做这个了。

开始于 2026年11月25日。

评估

这个 Issue 还没有评估数据。

描述

enhancement

Summary

Add a GitHub Copilot app canvas for Git-Ape: a side panel next to chat with three views.

  • Deployments: browse the deployments in .azure/deployments/ and see existing drift automation status when configured.
  • Setup: check whether the repository is ready for Git-Ape onboarding.
  • Launchpad: start the main Git-Ape agents and skills with one click.

It is a Copilot CLI extension in .github/extensions/git-ape-deployments/. The Copilot app loads it automatically for sessions in this repository, and users can install it at user scope to use it in any repository.

Problem

Git-Ape keeps its state in files and in GitHub: deployment artifacts under .azure/deployments/<id>/ (metadata.json, state.json, tests.json, architecture.md, template.json, logs), plus workflow files, environments and secrets. To answer simple questions, users must read JSON files, run az and gh commands, or ask the agent:

  • Which deployments exist, what state are they in, and did their tests pass?
  • What does a deployment's architecture look like?
  • What did the last automated drift check find, and is that report still from the latest run?
  • Is this repository ready for onboarding, and what is missing?
  • Which agent or skill should I use to start?

The Copilot app has no visual entry point for any of this.

Proposal

Deployments view
  • A list of deployments, newest first, with a status badge, project, environment and region, and a search box.
  • Detail tabs for the selected deployment:
    • Overview: summary, managed resources, integration test results and the selected deployment's reported drift status.
    • Architecture: the Mermaid diagrams from architecture.md.
    • Template: parameters, outputs and resources, including resources inside nested deployments.
    • Logs: deployment.log, error.log and rollback.log (last 16 KB).
    • Files: the files in the deployment folder.
  • The view refreshes live when files under .azure/deployments/ change.
  • Buttons that send a prompt to chat for the selected deployment: Ask Copilot to summarize, Check drift (azure-drift-detector) and Re-run tests (azure-integration-tester).
Existing drift automation status

This is part of the Deployments view, separate from the Check drift button that requests a new check.

  • Detect runnable git-ape-drift*.yml / .yaml workflows under .github/workflows, including git-ape-drift.lock.yml. Hide the status section when none is configured; ignore unrelated workflows with "drift" in their names.
  • Show the latest run of each detected workflow, its status/conclusion, timestamp and a link to the run.
  • Read the newest [drift-status] report issue with the drift-status label. Display the check timestamp, tracked/deployments-with-drift counts, and a link to the report.
  • Match deployment IDs to the report's Deployments table. Show reported no-drift, drift count/severity, skipped or unknown in deployment cards and Overview. Preserve qualifications such as suppressed findings.
  • Distinguish report findings from workflow execution status. A successful run without a report is not evidence of no drift. Failed/in-progress newer runs or unmatched reports make previous findings visibly stale; inaccessible or unparseable data is Unknown, never green.
  • Fetch automatically in the Deployments view, cache GitHub reads for five minutes, and provide Refresh drift status. Refresh reads existing results only; it never dispatches a workflow or changes Azure.
  • Use the session's existing GitHub CLI authentication and repository context. Surface missing CLI, sign-in, SSO and permission errors without changing accounts.
Setup view

A read-only checklist of what git-ape-onboarding needs:

Group Checks
CLI tools az 2.50 or later, gh 2.0 or later, jq 1.6 or later, git
Sign-in az account show and gh api user
Repository files The four git-ape-*.yml workflows and copilot-instructions.md. The drift workflow is optional.
GitHub configuration Admin permission, default branch main, the azure-deploy and azure-destroy environments, the AZURE_CLIENT_ID and AZURE_TENANT_ID secrets, and the AZURE_SUBSCRIPTION_ID variable. COPILOT_GITHUB_TOKEN is optional.
  • Repository files are checked every time the view loads. The CLI and GitHub checks run only when the user selects Run checks.
  • When organization SAML SSO blocks the gh token, the check shows Unknown and explains how to authorize it.
  • Start onboarding runs the git-ape-onboarding skill and includes the current gaps in the prompt. Check prerequisites with Copilot runs the prereq-check skill.
Launchpad view
Card Runs
New deployment Git-Ape agent
Import existing resources Azure IaC Exporter agent
Architecture review Azure Principal Architect agent
Policy compliance Azure Policy Advisor agent
Find skills git-ape-skills skill (search only, no install)

Every button only sends a prompt to chat. The skills and agents keep their own confirmation gates, so nothing changes in Azure or GitHub until the user approves it in chat.

Agent actions

Copilot can drive the canvas too:

Action Description
refresh Rescans the deployments directory and returns deployment summaries.
show_deployment Selects a deployment and returns its summary, resources, tests and file list.
get_selection Returns the deployment the user has selected.
show_view Switches to the deployments, setup or launchpad view.
get_setup_status Returns the onboarding checklist. With run: true, runs the CLI and GitHub checks first.
get_drift_status Reads existing drift workflow runs and the latest report. With refresh: true, bypasses the five-minute cache; never starts a check.

Open input: view, deploymentId and deploymentsDir (defaults to .azure/deployments).

Use in other repositories

The project copy loads only in this repository. The README shows how to copy the folder to ~/.copilot/extensions/git-ape-deployments/ (bash and PowerShell). The user copy reads the repository of the current session. In this repository it steps aside, so the project copy is used and the canvas ID stays unique.

Security design

  • The canvas is read-only. It never changes deployment artifacts, repository settings or Azure resources.
  • Setup checks run az, gh, jq and git through execFile with fixed arguments, no shell and a 20-second timeout. Only the names of secrets and variables are read, never their values. Error text is replaced with a fixed message or cut to one line of 160 characters at most.
  • Drift status uses read-only gh run list and gh issue list calls. Report content is untrusted data, rendered as text rather than executed or injected as HTML.
  • Prompts are built on the server from a fixed list. The page sends only an intent ID and, where needed, a deployment ID.
  • Each panel runs its own server on 127.0.0.1 with a random port. POST requests need a per-panel token and Content-Type: application/json.
  • Deployment IDs must match a strict pattern and stay inside the deployments directory.
  • Artifact content is rendered as text. Mermaid renders with securityLevel: "strict". A pinned Mermaid 11.17.2 bundle is downloaded once, checked against a SHA-384 hash, cached under ~/.copilot/extensions/git-ape-deployments/artifacts/ and served locally. The page never loads remote scripts. If the download fails, the diagram source is shown instead.

Implementation

A local prototype exists, but its code has not been committed or pushed. This issue records the proposed behavior and implementation scope; it does not indicate that the extension has shipped.

File Purpose
extension.mjs Canvas definition, agent actions and the local HTTP server
lib/deployments.mjs Reads deployment artifacts
lib/setup.mjs Read-only onboarding checks
lib/drift.mjs Workflow discovery, existing run/report reads, report parsing, freshness and cache
lib/intents.mjs The fixed list of chat prompts
lib/mermaid-bundle.mjs Pinned Mermaid download, hash check and cache
ui/ index.html, app.js and styles.css, using the app theme tokens for light and dark mode
README.md Usage, install in other repositories, actions and security notes

There is no package.json and no new dependency: the Copilot CLI provides the SDK. No existing skill, agent or workflow changes.

Testing

  • Tested in this repository with sample deployments in different states (succeeded, failed, destroy requested): Mermaid rendering, live refresh, the setup checks (including the SAML case) and the token check on POST requests.
  • Tested the user-scope copy against another repository that uses Git-Ape: repository detection, deployments and setup checks.
  • Drift status: six focused Node tests cover workflow discovery, report parsing, stale/failed/in-progress runs, missing reports, authorization errors, caching and refresh. Browser fixtures verify reported drift and stale findings in cards and Overview; the real canvas endpoint enforces the refresh token and hides status without automation.
  • Live status retrieval from the other repository currently returns Unknown with the session's GitHub identity. Successful live-report retrieval still needs verification with an authorized account.

Follow-ups

  • Confirm successful live-report retrieval with an authorized GitHub identity before shipping.
  • Add a page to the website docs.
  • Decide whether to ship the canvas with the Git-Ape plugin, so users don't have to copy it by hand.
主要语言
JavaScript
星标
282
派生
50
平均合并
4 天 20 小时
30 天内合并 PR
18

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/git-ape 的其他 Issue

查看 Azure/git-ape 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。