chore: Add pre-commit blocker report and improve Go version management
- Created a comprehensive pre-commit blocker report detailing GolangCI-Lint and TypeScript type check failures, including remediation steps and verification commands. - Enhanced the golangci-lint pre-commit hook to automatically rebuild the tool if a Go version mismatch is detected. - Introduced a new script `rebuild-go-tools.sh` to rebuild essential Go development tools, ensuring they are compiled with the current Go version. - Improved error handling and user feedback in the rebuilding process, providing clear instructions for manual intervention if needed. - Updated supervisor review report to reflect the successful implementation of Go version management and associated documentation.
This commit is contained in:
@@ -67,6 +67,55 @@ GitHub Actions workflows automatically use go 1.26.0 via `GOTOOLCHAIN: auto`, wh
|
||||
|
||||
For local development, install go 1.26.0+ from [go.dev/dl](https://go.dev/dl/).
|
||||
|
||||
### Go Version Updates
|
||||
|
||||
When the project's Go version is updated (usually by Renovate):
|
||||
|
||||
1. **Pull the latest changes**
|
||||
```bash
|
||||
git pull
|
||||
```
|
||||
|
||||
2. **Update your local Go installation**
|
||||
```bash
|
||||
# Run the Go update skill (downloads and installs the new version)
|
||||
.github/skills/scripts/skill-runner.sh utility-update-go-version
|
||||
```
|
||||
|
||||
3. **Rebuild your development tools**
|
||||
```bash
|
||||
# This fixes pre-commit hook errors and IDE issues
|
||||
./scripts/rebuild-go-tools.sh
|
||||
```
|
||||
|
||||
4. **Restart your IDE's Go language server**
|
||||
- VS Code: Reload window (`Cmd/Ctrl+Shift+P` → "Developer: Reload Window")
|
||||
- GoLand: File → Invalidate Caches → Restart
|
||||
|
||||
**Why do I need to do this?**
|
||||
|
||||
Development tools like golangci-lint and gopls are compiled programs. When you upgrade Go, these tools still run on the old version and will break with errors like:
|
||||
|
||||
```
|
||||
error: some/file.go:123:4: undefined: runtime.NewlyAddedFunction
|
||||
```
|
||||
|
||||
Rebuilding tools with `./scripts/rebuild-go-tools.sh` fixes this by compiling them with your new Go version.
|
||||
|
||||
**What if I forget?**
|
||||
|
||||
Don't worry! The pre-commit hook will detect the version mismatch and automatically rebuild tools for you. You'll see:
|
||||
|
||||
```
|
||||
⚠️ golangci-lint Go version mismatch:
|
||||
golangci-lint: 1.25.6
|
||||
system Go: 1.26.0
|
||||
|
||||
🔧 Rebuilding golangci-lint with current Go version...
|
||||
```
|
||||
|
||||
See [Go Version Upgrades Guide](docs/development/go_version_upgrades.md) for troubleshooting.
|
||||
|
||||
### Fork and Clone
|
||||
|
||||
1. Fork the repository on GitHub
|
||||
|
||||
Reference in New Issue
Block a user