Add go fix ./... to Makefile and CI#791
Conversation
Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com> Agent-Logs-Url: https://github.com/ngrok/ngrok-operator/sessions/712a2f99-7041-4934-8d20-03c44e18d4ff
go fix ./... to Makefile and CI
Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
ef4d922 to
5f7b07e
Compare
There was a problem hiding this comment.
Pull request overview
Adds a go fix ./... check to the project’s Makefile and wires it into GitHub Actions CI so that outdated Go idioms are caught (and required to be committed) before running more expensive jobs.
Changes:
- Adds a
make go-fixtarget that runsgo fix ./.... - Adds a
go-fixCI job that runs the target and fails if it modifies the working tree. - Updates CI job dependency graph so expensive jobs wait on the new early gate(s).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
tools/make/lint.mk |
Adds a go-fix make target to run go fix ./.... |
.github/workflows/ci.yaml |
Introduces a go-fix job and updates job needs/if gating to run it early. |
Comments suppressed due to low confidence (1)
.github/workflows/ci.yaml:145
build-and-testcan run whenactions/charts/chartyaml/testschange, but it now has unconditionalneeds: go-mod-tidyandneeds: go-fix. Since those jobs are currently gated to only run ongochanges,build-and-testwill be skipped for non-go changes due to unmetneeds. Fix by aligning theifconditions (or removing these fromneedswhere they aren’t required).
build-and-test:
runs-on: ubuntu-latest
needs:
- changes
- kubebuilder-diff
- lint
- go-mod-tidy
- go-fix
if: |
(github.event_name == 'push' && github.ref_name == 'main')
||
(
(needs.changes.outputs.actions == 'true') ||
(needs.changes.outputs.go == 'true') ||
(needs.changes.outputs.charts == 'true') ||
(needs.changes.outputs.chartyaml == 'true') ||
(needs.changes.outputs.tests == 'true') ||
(needs.changes.outputs.make == 'true')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
==========================================
- Coverage 51.64% 51.41% -0.24%
==========================================
Files 101 101
Lines 11188 11188
==========================================
- Hits 5778 5752 -26
- Misses 4993 5014 +21
- Partials 417 422 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Initial plan * Add go fix ./... to Makefile and CI Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com> Agent-Logs-Url: https://github.com/ngrok/ngrok-operator/sessions/712a2f99-7041-4934-8d20-03c44e18d4ff * chore: reorder job to colocated build-images dependencies Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> * fix: Update workflow to fix skipped tests Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> --------- Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com> Co-authored-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
* Initial plan * Add go fix ./... to Makefile and CI Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com> Agent-Logs-Url: https://github.com/ngrok/ngrok-operator/sessions/712a2f99-7041-4934-8d20-03c44e18d4ff * chore: reorder job to colocated build-images dependencies Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> * fix: Update workflow to fix skipped tests Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> --------- Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com> Co-authored-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
Adds
go fix ./...as an early CI gate to prevent outdated Go idioms from accumulating, similar to the existinggo mod tidycheck.Changes
tools/make/lint.mk: Newgo-fixtarget alongsidefmtandvet.github/workflows/ci.yaml:go-fixjob — runsmake go-fix, fails if any files are modified (i.e.,go fixwould have made changes)build-images,build-and-test,e2e,e2e-multi-namespace, ande2e-uninstallall depend ongo-fix, ensuring expensive jobs are gated behind itOriginal prompt
go fix ./...to our Makefile and CI #790📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.