Skip to content

Dependabot gomod: per-directory entries break the gen/go ↔ remote-worker replace coupling #212

Description

@pdettori

Problem

Dependabot's gomod config declares two separate entries, one per directory:

  - package-ecosystem: gomod
    directory: /gen/go
    groups:
      grpc-protobuf: ...

  - package-ecosystem: gomod
    directory: /remote-worker
    groups:
      grpc-protobuf: ...

Each directory: entry is an independent update universe, so Dependabot opens
one PR per module. But the two modules are coupled:

  • remote-worker/go.mod has
    replace github.com/kagenti/serverless-harness/gen/go => ../gen/go
  • the proto job in .github/workflows/ci.yml builds both modules in the
    same job (Build and test Go stubs + Build and test remote-worker)

So any bump to a gen/go dependency makes remote-worker/go.mod stale, and CI
fails with:

go: updates to go.mod needed; to update it:
	go mod tidy

Dependabot cannot fix this itself, because the tidy has to land in the same
commit as the gen/go bump — and its branches are not writable by maintainers.

Observed

First occurrence, on the very first pair of PRs produced after #208 enabled
gomod coverage:

Merge order does not rescue it: #209 leaves protobuf v1.36.11 // indirect,
which #210 then invalidates, so #210 fails even after a rebase.

Proposed fix

Collapse the two entries into one using the plural directories: key, so a
single PR spans both modules and the grpc-protobuf group applies across them:

  - package-ecosystem: gomod
    directories:
      - /gen/go
      - /remote-worker
    schedule:
      interval: weekly
    groups:
      grpc-protobuf:
        patterns:
          - 'google.golang.org/grpc*'
          - 'google.golang.org/protobuf*'
          - 'google.golang.org/genproto*'

Worth verifying that Dependabot runs go mod tidy in the dependent module when
a replace target moves within the same PR. If it does not, the alternative is a
Go workspace (go.work) covering both modules, or a small CI autofix step that
runs go mod tidy and commits.

Impact if unfixed

Every future gen/go dependency bump produces a red PR needing manual bundling.
Given the weekly schedule and the grpc-protobuf group's churn, that is roughly
a recurring weekly chore.

Assisted-By: Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions