Skip to content

Fix missing .gitignore in generated extensions and surface local registry gaps in azd x build#8550

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/add-gitignore-for-go-extension
Open

Fix missing .gitignore in generated extensions and surface local registry gaps in azd x build#8550
Copilot wants to merge 5 commits into
mainfrom
copilot/add-gitignore-for-go-extension

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 5, 2026

Resolves #7926

This PR addresses feedback from authoring a Go extension via azd x init, fixing a scaffolding gap, improving azd x build ergonomics, and correcting the framework-services docs.

Scaffolding: embed template dotfiles

The language templates ship a .gitignore (the Go variant excludes bin/), but //go:embed languages silently skips files whose names begin with . or _, so generated extensions had none. Switching to //go:embed all:languages embeds the dotfiles. The only dotfiles under the templates are the four intended .gitignore files (go, python, dotnet, javascript) — there are no stray dotfiles or _-prefixed files that could leak into scaffolded output.

azd x build: warn on local registry gaps

After installing binaries, build now emits a non-fatal warning when ~/.azd/registry.json is missing or doesn't contain the extension. In that state the binaries are installed but the extension won't appear in azd ext list, so the message points the user at azd x pack then azd x publish to register it. This is the recovery the reporter had to reverse-engineer after a dev container rebuild wiped ~/.azd. The warning messages are concise and use color to highlight commands and de-emphasize the registry path, which is shown in full so it remains copy-pasteable across platforms.

image image

Docs (extension-framework-services.md)

Corrected the "Register the Framework Service" snippet — WithFrameworkService takes a provider factory, not an instance — and added the usage property to the extension.yaml snippet.

Copilot AI linked an issue Jun 5, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits June 5, 2026 20:52
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Add .gitignore to Go extension generation Fix missing .gitignore in generated extensions and surface local registry gaps in azd x build Jun 5, 2026
Copilot AI requested a review from JeffreyCA June 5, 2026 20:56
@JeffreyCA JeffreyCA requested a review from Copilot June 5, 2026 22:10
@github-actions github-actions Bot added the ext-x microsoft.azd.extensions developer extension (azd x) label Jun 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes extension scaffolding and improves developer feedback in the microsoft.azd.extensions developer kit extension, addressing gaps encountered when generating and iterating on extensions via azd x init / azd x build. It also corrects extension framework service documentation examples.

Changes:

  • Embed template dotfiles by switching to //go:embed all:languages, ensuring generated extensions include language-specific .gitignore files.
  • Add a non-fatal azd x build warning when the local source registry (~/.azd/registry.json) is missing/invalid or doesn’t contain the extension id (binaries are installed but the extension won’t appear in azd ext list).
  • Fix docs snippets for framework service registration and include the required usage property in the extension.yaml example.
Show a summary per file
File Description
cli/azd/extensions/microsoft.azd.extensions/version.txt Bumps extension version to 0.11.2.
cli/azd/extensions/microsoft.azd.extensions/internal/resources/resources.go Uses all: embedding to include dotfiles like .gitignore.
cli/azd/extensions/microsoft.azd.extensions/internal/resources/resources_test.go Adds tests ensuring .gitignore files are embedded and Go template ignores bin/.
cli/azd/extensions/microsoft.azd.extensions/internal/cmd/build.go Adds local-registry gap detection and warning text surfaced during azd x build.
cli/azd/extensions/microsoft.azd.extensions/internal/cmd/build_test.go Adds unit tests for localRegistryWarning behavior.
cli/azd/extensions/microsoft.azd.extensions/extension.yaml Updates extension manifest version to 0.11.2.
cli/azd/extensions/microsoft.azd.extensions/CHANGELOG.md Adds release notes for 0.11.2 covering dotfile embedding and build warnings.
cli/azd/docs/extensions/extension-framework-services.md Fixes WithFrameworkService example to pass a provider factory and adds usage to extension.yaml snippet.

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 1

Comment thread cli/azd/extensions/microsoft.azd.extensions/internal/cmd/build.go
@JeffreyCA JeffreyCA added the area/docs Documentation, design docs label Jun 5, 2026
@JeffreyCA JeffreyCA marked this pull request as ready for review June 5, 2026 22:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Review may take a bit longer — reach out to @rajeshkamal5050 or @kristenwomack if you'd like to discuss prioritization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation, design docs ext-x microsoft.azd.extensions developer extension (azd x)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback after creating Go extension

3 participants