Skip to content

Add go fix ./... to Makefile and CI#791

Merged
jonstacks merged 4 commits into
mainfrom
copilot/add-go-fix-to-makefile-ci
Mar 27, 2026
Merged

Add go fix ./... to Makefile and CI#791
jonstacks merged 4 commits into
mainfrom
copilot/add-go-fix-to-makefile-ci

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Adds go fix ./... as an early CI gate to prevent outdated Go idioms from accumulating, similar to the existing go mod tidy check.

Changes

  • tools/make/lint.mk: New go-fix target alongside fmt and vet
  • .github/workflows/ci.yaml:
    • New go-fix job — runs make go-fix, fails if any files are modified (i.e., go fix would have made changes)
    • build-images, build-and-test, e2e, e2e-multi-namespace, and e2e-uninstall all depend on go-fix, ensuring expensive jobs are gated behind it
Original prompt

This section details on the original issue you should resolve

<issue_title>Add go fix ./... to our Makefile and CI</issue_title>
<issue_description>Go 1.26 has revamped go fix ./... to perform automatic fixes. I'd like to include it in our CI github workflow similar to how we do a go mod tidy check to make sure that we don't pile up outdated idioms. Make sure it runs early on in our CI steps and that the more expensive tests like build and testing depend on it.</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

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
Copilot AI changed the title [WIP] Add go fix to Makefile and CI workflow Add go fix ./... to Makefile and CI Mar 24, 2026
Copilot AI requested a review from jonstacks March 24, 2026 22:27
@github-actions github-actions Bot added area/ci Issues/PRs relating to CI size/M Denotes a PR that changes 30-99 lines labels Mar 25, 2026
Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
@jonstacks jonstacks force-pushed the copilot/add-go-fix-to-makefile-ci branch from ef4d922 to 5f7b07e Compare March 25, 2026 15:05
@jonstacks jonstacks marked this pull request as ready for review March 25, 2026 15:11
@jonstacks jonstacks requested a review from a team as a code owner March 25, 2026 15:11
@jonstacks jonstacks requested a review from Copilot March 25, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-fix target that runs go fix ./....
  • Adds a go-fix CI 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-test can run when actions/charts/chartyaml/tests change, but it now has unconditional needs: go-mod-tidy and needs: go-fix. Since those jobs are currently gated to only run on go changes, build-and-test will be skipped for non-go changes due to unmet needs. Fix by aligning the if conditions (or removing these from needs where 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.

Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml Outdated
Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.41%. Comparing base (6838feb) to head (cfddf52).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jonstacks jonstacks added this pull request to the merge queue Mar 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 26, 2026
@jonstacks jonstacks added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 18e1015 Mar 27, 2026
20 checks passed
@jonstacks jonstacks deleted the copilot/add-go-fix-to-makefile-ci branch March 27, 2026 07:55
sabrina-ngrok pushed a commit that referenced this pull request Mar 27, 2026
* 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>
jonstacks added a commit to jonstacks/ngrok-operator that referenced this pull request Mar 27, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues/PRs relating to CI size/M Denotes a PR that changes 30-99 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add go fix ./... to our Makefile and CI

4 participants