-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Summary
The lint-go CI job failed on main branch after merging PR #10756 which added comprehensive test coverage for compiler core files.
Failure Details
- Run: 21156741258
- Commit: 7a21eaf
- Trigger: push to main
- Failed Job: lint-go
- Failed Step: Run golangci-lint
- Started: 2026-01-20T01:51:39Z
- Completed: 2026-01-20T01:52:22Z (43 seconds)
Root Cause Analysis
What Changed
PR #10756 added 3 new test files with 41 test functions totaling 1,278 lines:
pkg/workflow/compiler_test.go(328 lines, 12 tests)pkg/workflow/compiler_orchestrator_test.go(489 lines, 12 tests)pkg/workflow/compiler_activation_jobs_test.go(461 lines, 17 tests)
What Failed
The lint-go job runs these steps in sequence:
- ✅ Check Go formatting (
go fmt ./...) - PASSED - ✅ Install golangci-lint - PASSED
- ❌ Run golangci-lint (
make golint) - FAILED - ⏭️ Lint error messages - SKIPPED
Enabled Linters
The golangci-lint configuration (.golangci.yml) enables:
- testifylint - Enforce testify best practices (most likely culprit for test files)
- misspell - Catch common misspellings
- unconvert - Remove unnecessary type conversions
Most Likely Cause
Since go fmt passed but golangci-lint failed, and the changes are all test files, the issue is most likely testifylint violations. Common testifylint issues include:
- Missing assertion messages
- Incorrect use of assert vs require
- Using assert.NotNil/assert.Nil instead of assert.NoError/assert.Error
- Not using testify helper functions properly
Investigation Findings
Timeline
- 01:50:25Z - PR Add test coverage for compiler core files (2,291 untested lines) #10756 merged to main by @pelikhan
- 01:50:28Z - CI workflow triggered (3 seconds after merge)
- 01:50:46Z - lint-go job started
- 01:51:39Z - golangci-lint step started
- 01:52:22Z - golangci-lint step failed (43 seconds duration)
Pre-merge Status
- All CI checks on the PR branch passed before merge
- The failure only occurred on the main branch after merge
- This suggests the lint-go checks may differ between PR and main branch runs
Historical Context
Recent PR #10742 ("chore: fix lint errors from go fmt") indicates recurring linting issues in the codebase. The AGENTS.md file has mandatory pre-commit validation requirements but they may not have been followed.
Reproduction Steps
To reproduce this failure locally:
# Clone and checkout the failing commit
git clone https://github.com/githubnext/gh-aw.git
cd gh-aw
git checkout 7a21eaf2ea0f8fc6377186a3dbd97963aae89495
# Install dependencies
make deps-dev
# Run the linter (this should fail)
make golint
# Or run full lint suite
make lintRecommended Actions
Immediate Fix
- Run
make golintlocally to see specific linting errors - Fix testifylint violations in the three new test files
- Run
make agent-finishto verify all checks pass - Commit fix with message: "fix: resolve golangci-lint errors in compiler test files"
Specific Files to Check
pkg/workflow/compiler_test.gopkg/workflow/compiler_orchestrator_test.gopkg/workflow/compiler_activation_jobs_test.go
Common testifylint Fixes
// ❌ BAD - No message
assert.NoError(t, err)
// ✅ GOOD - With descriptive message
assert.NoError(t, err, "Failed to compile workflow")
// ❌ BAD - Using NotNil for error
assert.NotNil(t, err)
// ✅ GOOD - Using Error for error
assert.Error(t, err, "Should return error for invalid input")Prevention Strategies
For Contributors
The AGENTS.md file already has mandatory pre-commit requirements, but they need to be reinforced:
-
Always run before committing:
make agent-finish # Runs build, test, recompile, fmt, lint -
Minimum for Go code changes:
make fmt # Format Go code make lint # Run all linters including golangci-lint
Process Improvements
- Add pre-commit hook: Install git pre-commit hook that runs
make fmt && make lint - Enhanced PR checks: Ensure lint-go runs on PR branches with same configuration as main
- Clearer error messages: When lint-go fails, the CI should show specific linting errors in the summary
AI Team Self-Improvement
Add to AGENTS.md under "Critical Requirements":
### Test File Linting Requirements
**When adding new test files (*.test.go, *_test.go):**
1. **Run linters after creating tests**:
```bash
make lint # Catches testifylint, misspell, unconvert issues
```
2. **testifylint best practices**:
- Always provide descriptive assertion messages
- Use `require.*` for setup assertions that must pass
- Use `assert.*` for test validations
- Use `assert.Error(t, err, "msg")` not `assert.NotNil(t, err)`
- Use `assert.NoError(t, err, "msg")` not `assert.Nil(t, err)`
3. **Before committing test files**:
```bash
make agent-finish # REQUIRED - Full validation
```
**Example**:
```go
// ✅ CORRECT testifylint usage
func TestCompile(t *testing.T) {
compiler := NewCompiler()
require.NotNil(t, compiler, "Compiler should be created")
err := compiler.Compile("test.md")
assert.NoError(t, err, "Should compile valid workflow")
}
```Limitations
- Cannot download job logs (requires admin rights to repository)
- Cannot run golangci-lint in investigation environment (Go not installed)
- Cannot reproduce exact linting error without local environment
Artifacts
Investigation artifacts saved to:
/tmp/investigation/run-details.json/tmp/investigation/jobs-summary.json/tmp/investigation/failed-jobs.json/tmp/investigation/commit-info.txt/tmp/investigation/summary.md
AI generated by CI Failure Doctor
To add this workflow in your repository, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. See usage guide.