Skip to content

go version update and linter setup#7027

Merged
vhvb1989 merged 3 commits intomainfrom
go-1.26-and-linter-setup
Mar 6, 2026
Merged

go version update and linter setup#7027
vhvb1989 merged 3 commits intomainfrom
go-1.26-and-linter-setup

Conversation

@vhvb1989
Copy link
Member

@vhvb1989 vhvb1989 commented Mar 6, 2026

No description provided.

Copy link
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

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.agents to go 1.26.0 and add a local .golangci.yaml enabling 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:gosec annotations, 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.

Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

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:gosec annotations with clear justifications

Minor Suggestions

See inline comments for two medium items:

  1. Line-length 220 vs repo convention of 125 — consider tightening
  2. Magic int32 constants — use math.MaxInt32/math.MinInt32

LGTM! 🚀

@vhvb1989 vhvb1989 enabled auto-merge (squash) March 6, 2026 21:32
@vhvb1989 vhvb1989 merged commit f429b7a into main Mar 6, 2026
17 checks passed
Copilot AI pushed a commit that referenced this pull request Mar 7, 2026
* go version update and linter setup

* typo

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants