Skip to content

Conversation

@myronmarston
Copy link
Collaborator

@myronmarston myronmarston commented Jul 8, 2025

Dependabot is currently broken for ElasticGraph:

dependabot/dependabot-core#12426

Troubleshooting points to a root cause of Bundler 2.6.9 (used by the latest dependabot) having some subtle changes to how gemspecs are handled. Specifically, this PR:

ruby/rubygems#8480

In that PR, the gemspec method was refactored to no longer call gem.

Previously, our Gemfile set up depended on this. However, it was quite complicated in order to support the root Gemfile getting symlinkd into each gem subdirectory.

I've simplified things here:

  • Gemfile-shared now contains all dependencies that are not declared in the gemspecs.
  • Gemfile is now greatly simplified--it just evals Gemfile-shared and declares a dependency on each ElasticGraph gem.
  • config/Gemfile-for-gem contains a more complex gemfile, which gets symlinked into each ElasticGraph gem.
  • I've removed the last few unnecessary gemspec developemnt dependencies for non-ElasticGraph gems--we handle this through the development dependencies in Gemfile-shared instead. (rack-test was missing from the Gemfile before!)

This new simpler setup should fix the issues we're having with dependabot.

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2025

CLA assistant check
All committers have signed the CLA.

@myronmarston myronmarston marked this pull request as ready for review July 8, 2025 03:58
@myronmarston myronmarston force-pushed the myron/rework-Gemfiles branch 2 times, most recently from c22b861 to 4bc24f8 Compare July 8, 2025 17:47
@myronmarston myronmarston force-pushed the myron/rework-Gemfiles branch from 4bc24f8 to 882f28f Compare July 8, 2025 17:50
Dependabot is currently broken for ElasticGraph:

dependabot/dependabot-core#12426

Troubleshooting points to a root cause of Bundler 2.6.9 (used by
the latest dependabot) having some subtle changes to how gemspecs
are handled. Specifically, this PR:

ruby/rubygems#8480

In that PR, the `gemspec` method was refactored to no longer call `gem`.

Previously, our `Gemfile` set up depended on this. However, it was quite
complicated in order to support the root `Gemfile` getting symlinkd into
each gem subdirectory.

I've simplified things here:

- `Gemfile-shared` now contains all dependencies that are not declared in the gemspecs.
- `Gemfile` is now greatly simplified--it just evals `Gemfile-shared` and declares
  a dependency on each ElasticGraph gem.
- `config/Gemfile-for-gem` contains a more complex gemfile, which gets symlinked
  into each ElasticGraph gem.
- I've removed the last few unnecesary gemspec developemnt dependencies for non-ElasticGraph
  gems--we handle this through the development dependencies in `Gemfile-shared` instead.
  (`rack-test` was missing from the `Gemfile` before!)

This new simpler setup should fix the issues we're having with dependabot.
@myronmarston myronmarston force-pushed the myron/rework-Gemfiles branch from 882f28f to 91748a9 Compare July 8, 2025 18:07
@myronmarston myronmarston merged commit cce2474 into main Jul 8, 2025
17 of 18 checks passed
@myronmarston myronmarston deleted the myron/rework-Gemfiles branch July 8, 2025 18:26
myronmarston added a commit that referenced this pull request Jul 8, 2025
This partially reverts "chore: rework Gemfiles. (#645)" (cce2474).
It recombines the root `Gemfile` with `config/Gemfile-for-gem`, doing away with `Gemfile-shared`,
while keeping the changes to #645 that impact how the root bundle works (e.g. calling `gem`
with each ElasticGraph gem, rather than `gemspec`).

This appears to be necessary for dependabot. While some dependabot runs have been successful
since #645 was merged, the last few runs have failed with:

```
Handled error whilst updating rubocop-rake: dependency_file_not_supported {message: "{\"errors\":[{\"status\":400,\"title\":\"Bad Request\",\"detail\":\"The request contains invalid or unauthorized changes\"}]}"}
```

I think the problem is `Gemfile-shared`: it's non standard to put gem
versions there, and dependabot seems to not like it. By reverting back
to a single root `Gemfile` I'm hopeful it'll fix dependabot.

In addition, I've reapplied "Increase the dependabot open-pull-request-limit. (#657)", effectively reverting (#659).
That was a prior attempt at fixing dependabot which didn't work.
myronmarston added a commit that referenced this pull request Jul 9, 2025
This partially reverts "chore: rework Gemfiles. (#645)" (cce2474).
It recombines the root `Gemfile` with `config/Gemfile-for-gem`, doing away with `Gemfile-shared`,
while keeping the changes to #645 that impact how the root bundle works (e.g. calling `gem`
with each ElasticGraph gem, rather than `gemspec`).

This appears to be necessary for dependabot. While some dependabot runs have been successful
since #645 was merged, the last few runs have failed with:

```
Handled error whilst updating rubocop-rake: dependency_file_not_supported {message: "{\"errors\":[{\"status\":400,\"title\":\"Bad Request\",\"detail\":\"The request contains invalid or unauthorized changes\"}]}"}
```

I think the problem is `Gemfile-shared`: it's non standard to put gem
versions there, and dependabot seems to not like it. By reverting back
to a single root `Gemfile` I'm hopeful it'll fix dependabot.

In addition, I've reapplied "Increase the dependabot open-pull-request-limit. (#657)", effectively reverting (#659).
That was a prior attempt at fixing dependabot which didn't work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants