Conversation
- Add Makefile: build, build-verbose, test, integration-test, clean, help - Add scripts/check-integration-env.sh: validates MSGRAPH* env vars before integration tests, exits 1 with per-variable error messages - Add internal/devtools/release: interactive release automation in Go (version bump, changelog, git commit/tag/push, dev-branch creation) replaces run-interactive-release.ps1; exposed as 'gomailtest devtools release' - Add internal/devtools/env: MSGRAPH* env var management commands exposed as 'gomailtest devtools env' - Add tests/integration/sendmail_test.go: Go integration test replacing the Pester-based Test-SendMail.ps1 - Wire devtools subcommand into root cobra command - Delete tests/Test-SendMail.ps1: broken (hardcoded OneDrive path, references legacy msgraphtool.exe binary) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Code ReviewOverall this is a well-structured PR that meaningfully improves the developer toolchain. The move from PowerShell scripts to a Makefile + portable Go implementation is the right call for a cross-platform tool. Below are issues worth addressing before merge. Bugs1. Buffered input loss across prompt calls ( Every prompt helper ( // Each of these creates a new bufio.Scanner on opts.In
PromptYesNo(w, r, "Continue anyway?", false) // scanner 1 drops buffer on return
PromptVersion(w, r, currentVer) // scanner 2 — may miss buffered bytesFix: accept a 2. Silent error discard for branch, _ := CurrentBranch() // error silently discarded
if branch != "main" && branch != "master" && ghAvailable() {If 3. // Fallback: use the directory of the running binary
exe, _ := os.Executable()
return filepath.Dir(exe), nilWith Code Quality4. Hardcoded AI attribution in user commits ( commitMsg := fmt.Sprintf("Bump version to %s\n\nCo-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>", newVer)This silently adds an AI co-author trailer to every release commit and dev-cycle commit the tool creates on behalf of the user. A developer running 5. fmt.Fprintf(os.Stderr, "missing: %s\n", name)Every other command in this PR correctly uses 6. The Quick Build section still shows Minor / Suggestions7. Both 8. The scanner walks 9. Integration test uses a relative binary path ( binary := filepath.Join("..", "..", "bin", "gomailtest")This assumes the test is invoked from 10. echo " gomailtest devtools env set"There is no What's Good
|
Summary
build-all.ps1andrun-integration-tests.ps1withbuild,build-verbose,test,integration-test,clean, andhelptargetsscripts/check-integration-env.shvalidates all fourMSGRAPH*env vars before integration tests run, exits 1 with clear per-variable error messagesinternal/devtools/releasereplacesrun-interactive-release.ps1with a portable Go implementation exposed asgomailtest devtools release(version bump, changelog, git commit/tag/push, dev-branch creation, optional PR viagh)internal/devtools/envexposesgomailtest devtools envfor managingMSGRAPH*env vars interactivelytests/integration/sendmail_test.gois a Go integration test (build-tagged) that replaces the broken Pester testtests/Test-SendMail.ps1deleted — hardcoded author's OneDrive path, referenced legacymsgraphtool.exebinaryTest plan
make build— binary appears atbin/gomailtest.exe; version line printedmake test— all unit tests passmake help— targets listed with descriptionsmake integration-testwithout env vars — exits 1 with "Missing required environment variable(s)" messagegomailtest devtools release --dry-run— walks all 13 steps without writing anythingtests/Test-SendMail.ps1is absent🤖 Generated with Claude Code