Skip to content

Comments

refactor: use azd-core shared packages, remove wrappers#13

Merged
jongio merged 7 commits intomainfrom
refactor
Feb 22, 2026
Merged

refactor: use azd-core shared packages, remove wrappers#13
jongio merged 7 commits intomainfrom
refactor

Conversation

@jongio
Copy link
Owner

@jongio jongio commented Feb 19, 2026

Summary

Migrate azd-copilot to use shared packages from azd-core, removing unnecessary wrapper packages.

Changes

  • version: Delegates to azd-core/version.NewCommand() (keeps ldflags init)
  • logging: Deleted internal/logging/ wrapper entirely, main.go imports azd-core/logutil directly
  • cache: Kept business logic (SetupCache, NeedsSetup) but uses azd-core/cache.Manager underneath

Security Fixes

  • Fixed getManager() race: replaced sync.Once with sync.Mutex for retryable initialization (sync.Once permanently caches errors)
  • Fixed copylocks: removed mutex copy in test restore functions
  • Fixed errcheck: added return value checks on Close() and system calls

Depends On

Quality

  • All 6 test packages pass (55 tests)
  • golangci-lint clean (10 issues fixed)
  • Build produces versioned binary

jongio and others added 5 commits February 18, 2026 23:54
- Replace internal logging with azd-core/logutil re-exports
- Replace internal cache with azd-core/cache.Manager
- Replace version command with azd-core/version.NewCommand

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevents race condition in getManager() where concurrent goroutines
could both see nil and create duplicate Manager instances.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sync.Once permanently caches initialization errors, leaving the package
broken even on transient failures. sync.Mutex allows retry while still
preventing concurrent double-initialization via check-then-act under lock.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix golangci-lint v2 issues (errcheck, staticcheck, revive)
- Fix test reliability issues
- All preflight checks now pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

🚀 Website Preview

Your PR preview was available here.

Preview has been cleaned up as the PR was closed.

github-actions bot added a commit that referenced this pull request Feb 19, 2026
go.work with ../azd-core is for local dev only and breaks CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Feb 22, 2026
CI runs from repo root but go.mod is in cli/. Add defaults working-directory
and fix all path references from ./cli/src/ to ./src/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Feb 22, 2026
@jongio jongio merged commit 238fa92 into main Feb 22, 2026
10 checks passed
@jongio jongio deleted the refactor branch February 22, 2026 08:01
github-actions bot added a commit that referenced this pull request Feb 22, 2026
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.

1 participant