Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Azure AI Agents extension module to Go 1.26 and introduces module-scoped GolangCI-Lint configuration/CI, with additional formatting and lint-driven safety tweaks across the extension code.
Changes:
- Bump
cli/azd/extensions/azure.ai.agentstogo 1.26.0and add a local.golangci.yamlenabling gosec/lll/unused/errorlint. - Add a dedicated GitHub Actions workflow to run the shared Go lint workflow for the extension.
- Apply linter-motivated refactors (line wrapping,
//nolint:gosecannotations, range checks, and improved close handling in some places).
Reviewed changes
Copilot reviewed 20 out of 24 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go | Formatting, gosec suppressions, and int32 range validation for replica scaling fields. |
| cli/azd/extensions/azure.ai.agents/internal/project/parser.go | Formatting and additional gosec suppressions; improved response-body close handling in one path. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/azure/foundry_projects_client.go | Formatting for long URL construction. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/registry_api/operations.go | Formatting (endpoint string and function signature wrapping). |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/registry_api/helpers.go | Formatting (function signatures and long lines). |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/yaml.go | Comment wrapping and gosec suppression on a schema field name. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/parse.go | Wrap long error strings for lll compliance. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go | Remove placeholder TODO helpers; add int→int32 overflow guard. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/operations.go | Add gosec suppression and adjust response close handling. |
| cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/models.go | Minor formatting alignment. |
| cli/azd/extensions/azure.ai.agents/internal/exterrors/errors_test.go | Formatting/alignment in test table. |
| cli/azd/extensions/azure.ai.agents/internal/exterrors/codes.go | Add gosec suppression and align constants. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/show.go | Minor formatting alignment. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/monitor.go | Minor formatting alignment. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/listen.go | Add gosec suppressions around local workspace file reads. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_test.go | Add gosec suppressions for test fixture permissions. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code_test.go | Add gosec suppressions for test fixture file reads/writes. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go | Add gosec suppressions; tighten index bounds checks; adjust HTTP body close handling and scaffolding permissions. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_copy.go | Add gosec suppressions; explicitly ignore close errors in defers. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init.go | Remove unused prompting/flag validation helpers; wrap long strings; add gosec suppressions; adjust HTTP close handling and small message tweak. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/debug.go | Add gosec suppression for log file creation. |
| cli/azd/extensions/azure.ai.agents/go.mod | Update module Go version to 1.26.0. |
| cli/azd/extensions/azure.ai.agents/.golangci.yaml | New GolangCI-Lint configuration for the extension module. |
| .github/workflows/lint-ext-azure-ai-agents.yml | New CI workflow to lint the extension via the shared lint-go.yml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go
Outdated
Show resolved
Hide resolved
wbreza
approved these changes
Mar 6, 2026
Contributor
wbreza
left a comment
There was a problem hiding this comment.
Code Review Summary
TL;DR
Go 1.26 update + golangci-lint setup for the azure.ai.agents extension. Adds CI lint workflow, fixes all existing linter violations, removes dead placeholder code, and improves error handling patterns. Solid quality improvement.
✅ What Looks Good
- Dead code cleanup (3 placeholder/TODO functions removed)
- Improved bounds checking prevents negative index bugs
- Proper
defer Close()handling with error surfacing - Error message style fixes (lowercase, no trailing periods)
- CI pipeline catches lint issues on PRs
- Well-targeted
//nolint:gosecannotations with clear justifications
Minor Suggestions
See inline comments for two medium items:
- Line-length 220 vs repo convention of 125 — consider tightening
- Magic int32 constants — use
math.MaxInt32/math.MinInt32
LGTM! 🚀
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go
Show resolved
Hide resolved
rajeshkamal5050
approved these changes
Mar 6, 2026
Copilot AI
pushed a commit
that referenced
this pull request
Mar 7, 2026
* go version update and linter setup * typo * code enhances
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.