Apply transitive dependabot go.mod dependency updates as part of automatic Github workflow #844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new Github workflow (the project's first) which is designed to fix our recent influx of Dependabot PRs which fail to pass our build tests. See #839, #831 et al.
Although Dependabot is correctly modifying the specific module it is working on, Dependabot does not consider any other modules in the repository while constructing the pull request. In our case, every build runs a
go mod tidy
across every go module, resulting in transitive dependencies of the changes introduced by Dependabot (e.g. a change inexporters/otlp/go.mod
affects thego.sum
files inexample/otel-collector/
andexample/otlp/
) being modified during the build.The workflow contained in this PR is designed to auto-fix these transitive dependencies whenever a pull request has a
dependencies
label added to it. Itevantorrie/mott-the-tidier@v1-beta
to perform the samego mod tidy
across a user-defined set of module paths as the CI buildgo.sum
changesThis should then retrigger another CI build with the newly fixed
go.sum
files, and ideally, pass correctly.It uses two "non-Github-authored" Actions.
evantorrie/mott-the-tidier
is written by me with a pre-ES2015 understanding of NodeJS Javascript. In this workflow, it is configured with thegosum_only
gate which will fail if there are any nongo.sum
files showing as modified in the repo after thego mod tidy
s complete. This is intended to prevent auto-commit of anything other thango.sum
files by the subsequent step in the job.stefanzweifel/git-auto-commit-action@v4
is available in the Github actions marketplace and commits back to the PR branch any changes created bymott-the-tidier
. Since we limitmott-the-tidier
to making changes only togo.sum
files, the resultinggit-auto-commit-action
has limited capacity for inadvertently corrupting the PR.