Conversation
WalkthroughThis PR introduces Go code formatting validation via gofmt checks in the CI/CD pipeline (GitHub Actions and Makefile) while simultaneously correcting import ordering and removing extraneous whitespace across multiple test files to achieve compliance with formatting standards. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Router-nonroot image scan failed❌ Security vulnerabilities found in image: Please check the security vulnerabilities found in the PR. If you believe this is a false positive, please add the vulnerability to the |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/actions/go-linter/action.yaml (1)
25-36: Run the gofmt check beforego vet/staticcheckfor fail-fast CI.This check is good; moving it to the top of the step list will reduce wasted CI time and keep ordering consistent with the
router/Makefilelint flow.♻️ Proposed reorder
runs: using: composite steps: + - name: Check code formatting + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "The following files are not formatted correctly:" + echo "$unformatted" + echo "" + echo "Run 'gofmt -w .' to fix formatting." + exit 1 + fi + shell: bash + working-directory: ${{ inputs.working-directory }} + - name: Run go vet run: go vet ./... shell: bash working-directory: ${{ inputs.working-directory }} - name: Run staticcheck linter uses: dominikh/staticcheck-action@v1.3.1 with: version: 2025.1.1 install-go: false working-directory: ${{ inputs.working-directory }} - - - name: Check code formatting - run: | - unformatted=$(gofmt -l .) - if [ -n "$unformatted" ]; then - echo "The following files are not formatted correctly:" - echo "$unformatted" - echo "" - echo "Run 'gofmt -w .' to fix formatting." - exit 1 - fi - shell: bash - working-directory: ${{ inputs.working-directory }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/go-linter/action.yaml around lines 25 - 36, The gofmt check step ("Check code formatting") runs too late; move that entire step block so it executes before the go vet/staticcheck steps in the GitHub Actions job sequence to fail-fast and match router/Makefile ordering, keeping the same run script, shell and working-directory inputs unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/actions/go-linter/action.yaml:
- Around line 25-36: The gofmt check step ("Check code formatting") runs too
late; move that entire step block so it executes before the go vet/staticcheck
steps in the GitHub Actions job sequence to fail-fast and match router/Makefile
ordering, keeping the same run script, shell and working-directory inputs
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fff4978e-49cf-4b70-813b-d04820fdd6d1
📒 Files selected for processing (16)
.github/actions/go-linter/action.yamlrouter-tests/events/kafka_events_test.gorouter-tests/events/nats_events_test.gorouter-tests/events/redis_events_test.gorouter-tests/lifecycle/shutdown_test.gorouter-tests/modules/context_error_field_test.gorouter-tests/modules/set_scopes_test.gorouter-tests/modules/stream_receive_test.gorouter-tests/observability/prometheus_test.gorouter-tests/telemetry/connection_metrics_test.gorouter-tests/telemetry/metrics_log_export_test.gorouter-tests/telemetry/stream_metrics_test.gorouter-tests/testenv/testenv.gorouter/Makefilerouter/pkg/mcpserver/server_test.gorouter/pkg/trace/meter.go
💤 Files with no reviewable changes (5)
- router/pkg/trace/meter.go
- router-tests/events/redis_events_test.go
- router-tests/events/kafka_events_test.go
- router-tests/events/nats_events_test.go
- router-tests/observability/prometheus_test.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2708 +/- ##
==========================================
+ Coverage 62.86% 63.12% +0.25%
==========================================
Files 249 249
Lines 26726 26643 -83
==========================================
+ Hits 16802 16819 +17
+ Misses 8534 8447 -87
+ Partials 1390 1377 -13
🚀 New features to boost your workflow:
|
This PR
Summary by CodeRabbit
Style
Chores
gofmtstandards.Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.