Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

2.1.0.pre.3 #7428

Merged
32 commits merged into from
Nov 8, 2019
Merged

2.1.0.pre.3 #7428

32 commits merged into from
Nov 8, 2019

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Nov 7, 2019

This is the upcoming 2.1.0.pre.3.

I only documented PRs that (I expect to) include user facing changes, but the release also includes:

  • Some improvements in bundler integration as a default gem. I don't think these changes should change behavior but there's some default gem integration issues that I could never reproduce but the less we rely and mess with bundler's own $LOAD_PATH usually help here. That's Remove unnecessary lines from bundler/setup #7398.
  • Improvements in the experience debugging bundler by making the UI non silent by default. Again, I don't expect user facing changes, but if I'm missing something, I think it would be for the better. This is Stop silencing output by default #7401.
  • Bumping fileutils version to 1.3.0. We were using 1.2.0 with some patches on top. Again, no expected changes on the user side, but we should aim that our releases include vendorize versions of dependencies that exactly match something released on rubygems.org, and this change goes in that direction. This is Bump vendored fileutils to 1.3.0 #7375.
  • Refactorings and updates to the development environment.

7359: Spec simplifications r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that while working on #7296 and investigating why CI was failing there, I ended up adding several simplifications that are not necessarily related to that PR. In order to make that PR more digestable, I extracted those simplifications and improvements to this separate PR.

### Why did you choose this fix out of the possible options?

I chose this fix because it makes our dev and test environment better and simpler with some little tweaks.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 892b18b)
7358: More release fixes r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

I just released [2.1.0.pre.2](https://rubygems.org/gems/bundler/versions/2.1.0.pre.2). It went smoother than 2.1.0.pre.1, but I still got an issue where I unintentionally pushed a release named "v" to github releases.

### What was your diagnosis of the problem?

My diagnosis was that the release task by default should use the version in the gemspec for the `release:github` tasks.

### What is your fix for the problem, implemented in this PR?

My fix adds that fallback.

### Why did you choose this fix out of the possible options?

I chose this fix because it does what the user expects when the task is not passed any arguments.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit ebe0b85)
7296: Improve exec'ing to the proper rubygems version r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that the `with_rubygems` script is hard to work with, because it does complicated ARGV manipulation before exec'ing.

### What was your diagnosis of the problem?

My diagnosis was that we don't need it.

### What is your fix for the problem, implemented in this PR?

My fix is to implement the same thing in a simpler way.

### Why did you choose this fix out of the possible options?

I chose this fix because it simplifies things.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 3260d59)
7360: Consistenly use the default RSpec formatter r=hsbt a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that our default RSpec formatter is `--documentation`, but we're overriding it almost everywhere to use `--progress`.

### What was your diagnosis of the problem?

My diagnosis was that we should probably use the default formatter, since I think we all prefer it.

### What is your fix for the problem, implemented in this PR?

My fix is to do that.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 9b9e015)
7364: Follow up to `ENV["RGV"]` handling refactor r=hsbt a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that #7296 broke rubygems CI.

### What was your diagnosis of the problem?

My diagnosis was that the handling of `ENV["RGV"]` when it contains the path of a rubygems checkout instead of a rubygems version (like it happens in the rubygems repo) was incorrect.

### What is your fix for the problem, implemented in this PR?

My fix is to correct the behaviour. I was able to reproduce the CI failures in rubygems/rubygems#2924, and verify they are be fixed by this PR by patching the vendored bundler locally.

Fixes #7363.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit a598871)
7361: Add caller information to some deprecation messages r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that some deprecations mention usage of deprecated methods, but include no information about where the deprecated method is being called.

### What was your diagnosis of the problem?

My diagnosis was that we should include this information with this kind of deprecation messages, to make migration easier.

### What is your fix for the problem, implemented in this PR?

My fix is to add an optional argument to the `major_deprecation` method, to print the location of the deprecated caller.

### Why did you choose this fix out of the possible options?

I chose this fix because it required little code changes.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit e719a58)
7362: Fix spec warnings r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that our specs print some warnings to screen.

### What was your diagnosis of the problem?

My diagnosis was that specs should have a clean output.

### What is your fix for the problem, implemented in this PR?

My fix is to remove the warnings.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 2a4d88a)
7372: October manpages r=hsbt a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that outdated manpages.

### What is your fix for the problem, implemented in this PR?

My fix is to update them.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 8058b2e)
7374: Fix typos r=hsbt a=biow0lf

Fix typos

Co-authored-by: Igor Zubkov <igor.zubkov@ag-force.com>
(cherry picked from commit d4993be)
7373: Refactor new gem specs r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that I rebased #6455 and I had trouble getting the specs to pass.

### What was your diagnosis of the problem?

My diagnosis was that the new gemspecs could use a refactor.

### What is your fix for the problem, implemented in this PR?

My fix is to refactor these specs so that they are easier to read and modify.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 6ceec55)
7375: Bump vendored fileutils to 1.3.0 r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that we were not using a released version of fileutils.

### What was your diagnosis of the problem?

My diagnosis was that we can upgrade, because 1.3.0 has been released.

### What is your fix for the problem, implemented in this PR?

My fix is to upgrade.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit fe5d24b)
7385: Remove taint usage on Ruby 2.7+ r=hsbt a=jeremyevans

### What was the end-user problem that led to this PR?

Ruby 2.7 is deprecating taint support.

See https://bugs.ruby-lang.org/issues/16131 for details.

### What was your diagnosis of the problem?

Bundler still uses `untaint` in a few places, which will cause deprecation warnings on Ruby 2.7.

### What is your fix for the problem, implemented in this PR?

`s/\.untaint/.tap{|x| x.untaint if RUBY_VERSION < "2.7" }/g`

### Why did you choose this fix out of the possible options?

It seemed simplest.

Co-authored-by: Jeremy Evans <code@jeremyevans.net>
(cherry picked from commit fcb0fef)
7386: Suppress `Warning: no department given for MutableConstant` r=colby-swandale a=koic

This PR suppresses the following `Warning: no department given for MutableConstant`.

```console
% cd path/to/bundler
% bundle exec rubocop -v
0.75.1
% bundle exec rubocop --parallel
(snip)

/Users/koic/src/github.com/bundler/bundler/lib/bundler/gem_helpers.rb:
Warning: no department given for MutableConstant. Run `rubocop -a --only
Migration/DepartmentName` to fix.
```

Co-authored-by: Koichi ITO <koic.ito@gmail.com>
(cherry picked from commit bb6edfa)
7390: Bump tested rubies and regenerate cassettes r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that we were not testing against the latest patch level rubies.

### What is your fix for the problem, implemented in this PR?

My fix is to upgrade our CI config, and regenerate the vcr cassettes, just to keep them up to date.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 27a01a5)
7389: Wrap up `bundle cache` migration to current `bundle package` r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that after #7249, we added the current `bundle package` functionality to the current `bundle cache` command, so that these commands are now aliases of each other.

The initial plan was to do this in a more careful manner but we concluded that this was only _adding_ functionality to `bundle cache`, so not backwards incompatible.

We still need to wrap up the original plan, where `bundle cache` is the preferred command.

### What is your fix for the problem, implemented in this PR?

My fix is to migrate docs, tests and help text to use `bundle cache`, and to remove duplicated specs for `bundle cache` and `bundle package`, since they are testing the exact same code.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 5ba1360)
7388: Fix help with command aliases r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that the output of `bundle help install` and `bundle install --help` was inconstent with `bundle i --help`, and the same issue with all of the other command aliases.

### What was your diagnosis of the problem?

My diagnosis was that the command reformatting so that `bundle <cmd> --help` "redirects" to `bundle help <cmd>` was ignoring command aliases.

### What is your fix for the problem, implemented in this PR?

My fix is to make this logic aware of command aliases.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 5bc9c58)
7410: November man pages r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that man pages are outdated after the month change.

Well, the problem actually is that I need to fix in a better way (like a monthly scheduled rebuild or something), but I keep just updating the man pages every month... 😅

### What is your fix for the problem, implemented in this PR?

My fix to run `bin/rake man:build` and commit the result.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 49f585c)
7401: Stop silencing output by default r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that bundler defaults to a silent UI:

https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler.rb#L66-L68

In my opinion, this isn't a good behavior for a CLI tool, and forces us to override it in many many different places. It has also caused several issues, for example, #3710 where `bundle list` was printing nothing.

The [solution to that issues](#3707) led us to add yet more places where we override the default UI, and @indirect [predicting that having to unset the UI everytime we want it to not be silent](#3707 (comment)) would cause many headaches.

Well, yeah... I've lost a lot of time trying to figure out why UI was silent sometimes, and normal another times, why some specs printed warnings and some didn't. In particular, see my series of "big fail PRs" fighting against bundler's UI: #7284, #7294, #7305, #7362.

Another series of issues/PRs probably related to this is issue #6900, where the output would use a different UI on different environments. We had a lot of trouble to reliably fix it (#6994, #7002, #7253).

I also run into these issues again when trying out the `RUBYGEMS_GEMDEPS` environment variable that enables `bundler/setup` from rubygems.

### What was your diagnosis of the problem?

My diagnosis was that we shouldn't silence UI by default.

### What is your fix for the problem, implemented in this PR?

My fix is to, instead of silencing and then overriding the default shell at many places, don't silence it by default and instead make it silent when needed. By doing this, I managed to get 100% of our specs green, so I'm pretty confident that the output is still the same (or if it's not, it's probably because some output/errors where being unintentionally swallowed).

Now specs should pass, but they print a bunch of output to the screen. You can see error messages, hard crashes, success messages... Some of them might be showing actual issues with either the code or tests, so I plan to go through each of them and review them. I can do that in this PR or separately, no strong opinion.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 1a585f5)
7399: Fix some realworld specs testing nothing r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that this helper was printing nothing to the standard output, so the specs in this file were just checking if lockfiles contained the empty string, which is obviously true. For example,

https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/spec/realworld/edgecases_spec.rb#L31

### What was your diagnosis of the problem?

My diagnosis was that the helper needs to actually print the extracted information about the resolved gem, so it can be checked that the lockfile is correct.

### What is your fix for the problem, implemented in this PR?

My fix adds the missing `puts`.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 46aead4)
7411: Try out specs against MRI 2.6 + Rubygems 3.0 r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that our Azure build was using outdated versions of ruby and rubygems.

### What was your diagnosis of the problem?

My diagnosis was that we should update them.

### What is your fix for the problem, implemented in this PR?

My fix is to update them. With the latest versions, failures go down to 319.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 674966e)
7402: Spec normalizations r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that I saw some room for improvement in our specs and I couldn't help myself :)

### What is your fix for the problem, implemented in this PR?

Essentially, the idea of this PR is to avoid using `__FILE__` or other folder-structure specific constructs to look for files, and instead use our helpers ìn `spec/support/path.rb`. The idea is that the helpers in this file are aware that `bundler` specs can be run from ruby-core or the upstream repo, and the folder structure is different for both.

Also, the PR normalizes some naming, some duplicated helpers, and the way we require files from specs.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 2e7a37b)
7398: Remove unnecessary lines from `bundler/setup` r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

These lines in the `bundler/setup` file are not necessary.

### What was your diagnosis of the problem?

Bundler no longer needs to be in the `$LOAD_PATH` once a version of itself has been loaded.

In any case, the `Metadata` source takes care of adding `bundler` to the index:

https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/source/metadata.rb#L13-L30

and then that spec is added to the resolution here:

https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/definition.rb#L180-L184

And from the resulting set of specs, the `$LOAD_PATH` is setup:

https://github.com/bundler/bundler/blob/e70643c1be3a4417bd537d7e63470265465e693e/lib/bundler/runtime.rb#L25-L38

 So `bundler` will be present in the `$LOAD_PATH` anyways, and the lines being removed here will never be useful.

### What is your fix for the problem, implemented in this PR?

My fix is to remove these lines to make the code easier to follow.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit bf7df42)
7394: Add inline RDoc documentation r=hsbt a=zverok

Since Bundler became part of the standard library, it renders in Ruby's docs. Unfortunately, what renders there...  is not really helpful: https://docs.ruby-lang.org/en/master/Bundler.html

I've added rudimentary documentation for `Bundler` module and two of its most user-facing methods to solve this problem at least partially.

Co-authored-by: zverok <zverok.offline@gmail.com>
(cherry picked from commit a7cc4ec)
7393: Make 'bundle add' cache newly added gems when needed r=deivid-rodriguez a=andrehjr

### What was the end-user problem that led to this PR?

The problem was that when calling `bundle add` with cache_all as true, I have to call an additional `bundle install` to vendor gems.

### What was your diagnosis of the problem?

My diagnosis was that a call to Bundler.load.cache was missing. For example Bundler::CLI::Update does the same after installing gems.

### What is your fix for the problem, implemented in this PR?

My fix was to call Bundler.load.cache when `Bundler.app_cache.exist? `

### Why did you choose this fix out of the possible options?

I chose this fix because it looks like this makes the behavior consistent with other commands.

I should also say that, as this is my first PR here, I'm not sure that this is the best solution, and it seems an easy fix for #7384.

Co-authored-by: André Luis Leal Cardoso Junior <andrehjr@gmail.com>
(cherry picked from commit f83412a)
7424: Drop unnecessary `tempfile` require r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The `tempfile` dependency was dropped in [1], but the require was left in there. This could cause gem conflicts because `tempfile` requires `tmpdir` which requires `fileutils`, which loads the default gem instead of our namespaced version, and that could cause fileutils version mismatches and code overriding warnings.

[1]: 4a37d66

### What is your fix for the problem, implemented in this PR?

My fix is to drop the unnecessary require.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 0070d9f)
7425: Properly avoid readline crashes when running specs on Windows r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that specs cannot be run on windows unless you add the ugly workaround currently included in the azure pipelines config.

### What was your diagnosis of the problem?

My diagnosis was that the `tmp/tmpdir` and `tmp/home` folder (which act as `ENV["HOME"]` and `ENV["TMPDIR"]` for our specs) are emptied in an `around(:each)` hook, but there's some stuff going before that and after `ENV["HOME"]` and `ENV["TMPDIR"]` are set (on a `before(:suite)` hook) that might require the folders they point to to exist.

This is the case of rb-readline, used on Windows:

https://github.com/ConnorAtherton/rb-readline/blob/9fba246073f78831b7c7129c76cc07d8476a8892/lib/rbreadline.rb#L1096

or any bundler's code that uses `Bundler.user_home`:

https://github.com/bundler/bundler/blob/f83412ae8cda9c933b8cf33ec2abfb78a408daab/lib/bundler.rb#L227

For example, running `rm -rf tmp/ && bin/rspec ./spec/other/major_deprecation_spec.rb:368` prints a warning about this that it's fixed by this PR:

```
$ rm -rf tmp/ && bin/rspec ./spec/other/major_deprecation_spec.rb:368

Randomized with seed 1955

(... stuff ...)

`/home/deivid/Code/bundler/tmp/1/home` is not a directory.
Bundler will use `/tmp/bundler/home/deivid' as your home directory temporarily.
.

Retried examples: 0

Finished in 5.26 seconds (files took 0.17927 seconds to load)
1 example, 0 failures

Randomized with seed 1955
```

### What is your fix for the problem, implemented in this PR?

My fix is to create the folders as soon as the environment variables are set.

### Why did you choose this fix out of the possible options?

I chose this fix because it's more general that a workaround living on a specific CI config.

Fixes #6902.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 3eabc1c)
7426: Revert "I don't think we need this now" r=deivid-rodriguez a=deivid-rodriguez

This reverts commit 3681686.

### What was the end-user problem that led to this PR?

The problem was that in #7401, after I got specs passing against a non-silenced by default UI, I started undoing workarounds that I thought were due to the silent by default UI.

### What was your diagnosis of the problem?

My diagnosis was that in the case I'm reverting here this is not actually fixed, [as the Azure Pipelines logs confirm](https://dev.azure.com/bundler/bundler/_build/results?buildId=2662&view=ms.vss-test-web.build-test-results-tab&runId=1003360&resultId=101526&paneView=debug).

### What is your fix for the problem, implemented in this PR?

My fix is to unrevert the specific commit that I shouldn't have reverted.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit b12a21f)
7427: Pass `env` as a parameter to `sys_exec` r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that Windows has trouble with commands of the form `BUNDLE_FROZEN=true bundle install`.

### What was your diagnosis of the problem?

My diagnosis was that we should use `Open3.popen3` explicit `env` argument instead of passing a command line that has environment variables in the front.

### What is your fix for the problem, implemented in this PR?

My fix is to do just that. This is a follow up to #7011, but specifically for the `ruby` test helper. I expect this to fix some more Windows failures.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 6f452d6)
7416: Don't use insecure temporary directory as home directory r=deivid-rodriguez a=fatkodima

Closes #6501

Co-authored-by: fatkodima <fatkodima123@gmail.com>
(cherry picked from commit ac758c8)
7417: Fix bundler/inline warning: method redefined; discarding old root r=deivid-rodriguez a=fatkodima

Closes #6167

Co-authored-by: fatkodima <fatkodima123@gmail.com>
(cherry picked from commit a1ecdbf)
@deivid-rodriguez
Copy link
Member Author

@bundlerbot merge

ghost pushed a commit that referenced this pull request Nov 8, 2019
7428: 2.1.0.pre.3 r=deivid-rodriguez a=deivid-rodriguez

This is the upcoming 2.1.0.pre.3.

I only documented PRs that (I expect to) include user facing changes, but the release also includes:

* Some improvements in bundler integration as a default gem. I don't think these changes should change behavior but there's some default gem integration issues that I could never reproduce but the less we rely and mess with bundler's own `$LOAD_PATH` usually help here. That's #7398.
* Improvements in the experience debugging bundler by making the UI non silent by default. Again, I don't expect user facing changes, but if I'm missing something, I think it would be for the better. This is #7401.
* Bumping fileutils version to 1.3.0. We were using 1.2.0 with some patches on top. Again, no expected changes on the user side, but we should aim that our releases include vendorize versions of dependencies that exactly match something released on rubygems.org, and this change goes in that direction. This is #7375. 
* Refactorings and updates to the development environment.

Co-authored-by: Bundlerbot <bot@bundler.io>
@ghost
Copy link

ghost commented Nov 8, 2019

Build succeeded

@ghost ghost merged commit e71aba6 into 2-1-stable Nov 8, 2019
@ghost ghost deleted the release/2.1.0.pre.3 branch November 8, 2019 17:48
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants