Skip to content

build: run goMod in ci#2428

Open
thompson-tomo wants to merge 5 commits into
open-telemetry:mainfrom
thompson-tomo:build/run_goMod
Open

build: run goMod in ci#2428
thompson-tomo wants to merge 5 commits into
open-telemetry:mainfrom
thompson-tomo:build/run_goMod

Conversation

@thompson-tomo

@thompson-tomo thompson-tomo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This runs go mod tidy as part of the ci when go.mod/go.sum has changed and the branch is named renovate.

This has been tested in my fork where i merged these changes into main & verified that it ran as expected including resolving the build issue. This can be seen in thompson-tomo#109

@thompson-tomo thompson-tomo requested a review from a team as a code owner June 30, 2026 04:36
@wpessers wpessers added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jul 1, 2026
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: collector/go.mod
- run: find . -name "go.mod" -execdir go mod tidy \;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not 100% sure, but isn't this dangerous? When go mod tidy fails, the error would be swallowed? Or would we be able to see that failure in a later workflow that runs on the PR? (I think so, just checking to make sure...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it should be seen in the build workflow like we are seeing atm.

run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add collector/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The go sample app is not included in this, if that was intended it's fine by me though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good spot, i do however think sample-apps are ok as some updates are currently working. I am inclined to leave it as is given it unblocks ci & only add the additional path if we need it & we have a way to test it.

@wpessers

wpessers commented Jul 1, 2026

Copy link
Copy Markdown
Member

@thompson-tomo I approved for now, with just 2 minor questions. Related to the first one, can we confirm that after this workflow runs and pushes the chore: go mod tidy commit, it actually retriggers CI?

@thompson-tomo

thompson-tomo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@wpessers Yes, it does trigger. If you look at thompson-tomo#109 the pr is now passing. prior to this change that pr had 1 commit & was falling. That branch is a push of the failing branch from this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants