Repository navigation
Git Tag manager Canvas - #6421
aaronpowell merged 2 commits into
Conversation
🚦 Submission status: 🛠️ Requires submitter fixesRisk tier: Why this tier
Automated checks
Action needed
Review
Commands
Updated for |
🔒 PR Risk Scan ResultsScanned 19 changed file(s).
✅ No matching risk patterns were detected in changed files. Skipped non-text or missing files
|
|
🔴 Contributor Reputation Check: HIGH risk
Maintainers: please review this contributor before merging. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical security issues permit unauthorized tag mutations, destructive operations against a changed remote destination, and execution of repository-supplied Git binaries on Windows.
8 open issues
Resolve Git from a trusted absolute path on Windows · New Pin the remote destination before tag mutations · New Restrict canvas framing to trusted origins · New Authenticate loopback clients before exposing the write token · New Ignore saved remotes that are no longer configured · New Disable signing when creating lightweight tags · New Show the correct tag objects for deletion scope · New Allow query strings when routing canvas requests · New
What changed in this PR
Adds a Git Tag Manager canvas and installable plugin to Awesome Copilot for browsing tags and previewing creation, push, and deletion operations before confirmation.
Changes:
- Implements Git operations, confirmation plans, remote checks, and saved preferences.
- Adds a themed canvas interface with filtering and operation previews.
- Includes integration tests, usage documentation, and marketplace registration.
| File | Description |
|---|---|
plugins/git-tag-manager/README.md |
Documents plugin installation and extension source. |
plugins/git-tag-manager/plugin.json |
Registers the plugin and bundled extension. |
extensions/git-tag-manager/test-fixture.mjs |
Creates disposable repositories for tests. |
extensions/git-tag-manager/storage.mjs |
Validates and saves repository preferences. |
extensions/git-tag-manager/server.test.mjs |
Tests HTTP access checks and confirmed operations. |
extensions/git-tag-manager/server.mjs |
Serves the canvas and operation API over loopback HTTP. |
extensions/git-tag-manager/schemas.mjs |
Defines inputs, validation, and error types. |
extensions/git-tag-manager/README.md |
Documents usage, safeguards, storage, and validation. |
extensions/git-tag-manager/public/theme.js |
Selects the canvas color theme. |
extensions/git-tag-manager/public/styles.css |
Styles the responsive interface and confirmation dialog. |
extensions/git-tag-manager/public/index.html |
Defines tag browsing and confirmation controls. |
extensions/git-tag-manager/public/client.js |
Handles rendering, filtering, previews, and API requests. |
extensions/git-tag-manager/manager.test.mjs |
Tests tag operations, preferences, and failure handling. |
extensions/git-tag-manager/manager.mjs |
Coordinates previews and confirmed Git mutations. |
extensions/git-tag-manager/git.mjs |
Wraps Git commands and remote destination checks. |
extensions/git-tag-manager/extension.mjs |
Registers canvas actions and manages server lifecycle. |
extensions/git-tag-manager/copilot-extension.json |
Declares extension identity and metadata format. |
docs/README.plugins.md |
Adds the plugin to the catalog. |
.gitignore |
Excludes the local development extension alias. |
.github/plugin/marketplace.json |
Adds the marketplace entry. |
Review effort: Balanced (dynamic)
|
|
||
| export async function git(repository, args) { | ||
| try { | ||
| const { stdout } = await exec("git", ["--no-pager", ...args], { |
| ...input, scope, id: randomUUID(), repository: this.repository, remote: this.remote, | ||
| targetOid, localOid: tag?.localOid ?? null, remoteOid: tag?.remoteOid ?? null, | ||
| remoteChange, expiresAt: Date.now() + 5 * 60 * 1000, |
| response.setHeader("Cache-Control", "no-store"); | ||
| response.setHeader("X-Content-Type-Options", "nosniff"); | ||
| response.setHeader("Referrer-Policy", "no-referrer"); | ||
| response.setHeader("Content-Security-Policy", "default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self'; img-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors *"); |
| throw new TagError("forbidden", "Cross-origin requests are not allowed."); | ||
| } | ||
| const route = request.url; | ||
| if (request.method === "GET" && files.has(route)) { |
| const repository = await resolveRepository(input.repository); | ||
| const prefs = await readPreferences(repository, directory); | ||
| const remotes = (await git(repository, ["remote"])).split("\n").filter(Boolean); | ||
| const remote = input.remote ?? prefs?.remote ?? (remotes.includes("origin") ? "origin" : remotes[0] ?? ""); |
| const args = ["tag"]; | ||
| if (plan.message?.trim()) args.push("-a", "-m", plan.message); |
| : plan.operation === "push" ? "Publish only this tag to the selected remote. Existing remote tags will not be overwritten." | ||
| : `Delete this tag from ${plan.scope === "both" ? "both local and remote locations" : `the ${plan.scope} location`}. This does not delete the underlying commit.`; | ||
| $("plan-details").replaceChildren(); | ||
| for (const [label, value] of [["Tag", plan.name], ["Repository", plan.repository], ["Remote", plan.remoteChange ? plan.remote : "No remote changes"], ["Commit", plan.targetOid || plan.localOid || plan.remoteOid]]) { |
| const navigation = request.method === "GET" && request.url === "/" && request.headers["sec-fetch-mode"] === "navigate"; | ||
| if (request.headers.host !== new URL(entry.url).host || | ||
| (request.headers.origin && request.headers.origin !== entry.url) || | ||
| (request.headers["sec-fetch-site"] === "cross-site" && !navigation)) { | ||
| throw new TagError("forbidden", "Cross-origin requests are not allowed."); | ||
| } | ||
| const route = request.url; |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved authentication, clickjacking, and destination-validation flaws can permit unauthorized tag changes or pushes beyond the repository the user confirmed.
12 open issues
Trimming remote URL output can hide destination differences · New Tag pushes can publish submodule changes to other remotes · New Remote alias changes can redirect confirmed tag mutations · New Authenticate loopback clients before exposing the write token Restrict canvas framing to trusted origins Pin the remote destination before tag mutations Resolve Git from a trusted absolute path on Windows Confirmation omits the annotated tag message · New Allow query strings when routing canvas requests Show the correct tag objects for deletion scope Disable signing when creating lightweight tags Ignore saved remotes that are no longer configured
Review effort: Balanced (dynamic)
| windowsHide: true, encoding: "utf8", | ||
| env: { ...process.env, GIT_TERMINAL_PROMPT: "0", GCM_INTERACTIVE: "never" }, | ||
| }); | ||
| return stdout.trimEnd(); |
| export async function pushTag(repository, remote, name, expectedRemoteOid, sourceOid) { | ||
| await checkPushDestination(repository, remote); | ||
| // Disable configured mirror/followTags so an explicit refspec affects exactly one tag. | ||
| const args = ["-c", "push.followTags=false", "-c", `remote.${remote}.mirror=false`, "push", "--porcelain"]; |
| if ((tag?.localOid ?? null) !== plan.localOid || (tag?.remoteOid ?? null) !== plan.remoteOid) { | ||
| throw new TagError("tag_changed", "The tag changed since preview. Refresh and prepare again."); | ||
| } | ||
| if (plan.remoteChange) await checkPushDestination(this.repository, plan.remote); |
| for (const [label, value] of [["Tag", plan.name], ["Repository", plan.repository], ["Remote", plan.remoteChange ? plan.remote : "No remote changes"], ["Commit", plan.targetOid || plan.localOid || plan.remoteOid]]) { | ||
| $("plan-details").append(text("dt", label), text("dd", value)); | ||
| } | ||
| $("confirm-name").textContent = plan.name; |


Pull Request Checklist
npm startand verified thatREADME.mdis up to date.mainbranch for this pull request.Description
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.
This pull request introduces a new Git Tag Manager plugin that allows users to create, push, view, and delete Git tags through an interactive canvas interface. Key changes include:
This plugin aligns with existing canvas structures in the repository, ensuring consistency in user experience and sharing capabilities.