-
Notifications
You must be signed in to change notification settings - Fork 263
Description
CI Failure Investigation - Run #37390
Summary
golangci-lint failed in the lint-go job because pkg/workflow/known_needs_expressions.go still splits a needs.* expression with strings.Index, which triggers the modernize stringscut rule.
Failure Details
- Run: 22278268173
- Commit: c99d014
- Trigger: push
Root Cause Analysis
The lint-go job runs make golint, which invokes golangci-lint with the modernize suite that includes the stringscut check. The log shows pkg/workflow/known_needs_expressions.go:145:13: stringscut: strings.Index can be simplified using strings.Cut, so the linter exits with code 2 before any other checks run.
Failed Jobs and Errors
lint-go–pkg/workflow/known_needs_expressions.go:145:13: stringscut: strings.Index can be simplified using strings.Cut (modernize)
Investigation Findings
- Running
make golintlocally reproduces the failure because thestringscutrule is enabled by default in the lint configuration. - Swapping the
strings.Indexcall forstrings.Cuteliminates the warning without affecting the existing logic that drops post-activationneedsexpressions. - Attempts to run
make fmton the tree fail becausego fmt ./...wants Go 1.25.0 but the download fromproxy.golang.orgis blocked, and forcingGOTOOLCHAIN=localruns against Go 1.24.12, which is below the module'sgo 1.25requirement.
Recommended Actions
- Re-run
make golinton main after merging this change to confirm no otherstringscutviolations remain.
Prevention Strategies
Use strings.Cut (or other modern splitting helpers) whenever slicing needs.* expressions so the stringscut lint rule stays satisfied across the codebase.
AI Team Self-Improvement
Always prefer the Go 1.21+ helpers (e.g., strings.Cut) for substring extraction so modernization rules like stringscut do not break CI.
Historical Context
No prior CI Failure Doctor investigations matched this stringscut violation pattern.
🩺 Diagnosis provided by CI Failure Doctor
To install this workflow, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. View source at https://github.com/githubnext/agentics/tree/ea350161ad5dcc9624cf510f134c6a9e39a6f94d/workflows/ci-doctor.md.
- expires on Feb 23, 2026, 1:48 PM UTC