Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fork of mongoid_rails_migrations to fix build #822

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

floehopper
Copy link
Contributor

  • This is an attempt to fix the problem described in Tests fail with new bundler on CI #816. It uses a forked version of mongoid_rails_migrations. The branch in that fork was branched off the v1.0.0 tag, which is the version of the gem that was specified in our Gemfile. This is so that we keep the changes to our app to a minimum.

  • This fix is a bit of a bodge - the proper fix would be along the lines of Don't require/use Bundler at runtime adacosta/mongoid_rails_migrations#3, but given that the failing build is a significant blocker, it feels as if this is worth a try. If it works OK, we can work on getting the proper fix in place.

  • I installed v1.14.5 of Bundler which is the version now specified in govuk-puppet for Ruby v2.2.4. Hence the change to BUNDLED WITH in the Gemfile.

  • I've run a migration locally to ensure that the gem still works OK even with this patch in place.

@floehopper
Copy link
Contributor Author

floehopper commented Mar 7, 2017

Note that the newer version of Bundler seems to cause a bunch of warnings when installing the bundle from scratch:

Unable to use the platform-specific () version of activesupport (3.2.22.3) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of sprockets (2.2.3) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of cucumber (2.2.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of railties (3.2.22.3) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of cucumber-rails (1.4.5) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of domain_name (0.5.20161129) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of faraday (0.9.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of rest-client (2.0.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of oauth2 (1.3.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of omniauth (1.4.2) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of rubocop (0.39.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of jquery-rails (3.1.4) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of jasmine-rails (0.14.1) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of quiet_assets (1.0.3) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of redis-namespace (1.5.0) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of rspec-expectations (3.2.1) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of rspec-mocks (3.2.1) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of rspec-rails (3.2.3) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.
Unable to use the platform-specific () version of sinatra (1.4.4) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.

However, as far as I can tell those warnings don't seem to be causing any problems at the moment.

@floehopper
Copy link
Contributor Author

The build is passing. Yay! 🎉

* This is an attempt to fix the problem described in #816. It uses a
forked version of mongoid_rails_migrations. The branch in that fork
was branched off the v1.0.0 tag, which is the version of the gem that
was specified in our `Gemfile`. This is so that we keep the changes to
our app to a minimum.

* This fix is a bit of a bodge - the proper fix would be along the
lines of adacosta/mongoid_rails_migrations#3, but given that the failing
build is a significant blocker, it feels as if this is worth a try.
If it works OK, we can work on getting the proper fix in place.

* I installed v1.14.5 of Bundler which is the version now specified in
govuk-puppet [1] for Ruby v2.2.4. Hence the change to `BUNDLED WITH`
in the `Gemfile`.

* I've run a migration locally to ensure that the gem still works OK
even with this patch in place.

[1]: https://github.com/alphagov/govuk-puppet/blob/e2d61705aaf6da180a781b6f46f83235fd890df0/modules/govuk_rbenv/manifests/all.pp#L46
@floehopper floehopper force-pushed the avoid-calling-bundler-require-in-library-code branch from ffeee9c to a80f96c Compare March 7, 2017 15:27
Copy link
Contributor

@h-lame h-lame left a comment

Choose a reason for hiding this comment

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

A passing build unblocks us and that's what's important for now I think. Good sleuthing @floehopper! I reckon I was on a parallel track with what I found in #816, but this has an actual solution which is better than my "well, we'll have to get bundler to release a new version and upgrade all our machines again" option.

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.

None yet

2 participants