summaryrefslogtreecommitdiff
path: root/spec/bundler/fetcher
Commit message (Collapse)AuthorAgeFilesLines
* Load `CompactIndexClient` upfronttests/fix_autoload_thread_safety_issueDavid Rodríguez2020-01-131-0/+3
| | | | | | To prevent potential autoloading issues in our parallel tests. I think this could be the cause of https://github.com/rubygems/bundler/runs/386607433.
* Use vendorized version of uri libraryDavid Rodríguez2019-12-085-20/+20
|
* Fix thread leak in compact index specsDavid Rodríguez2019-06-171-1/+1
| | | | | | This spec was not stopping threads after itself. That would cause the previous spec in the file (that checks that no threads are left behind) to fail.
* Add debugging information to flaky testdebug_flaky_test_failuresDavid Rodríguez2019-05-291-2/+5
|
* Merge #6928Bundlerbot2019-04-282-3/+29
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6928: When a 401 response is received, raise BadAuthenticationError if credentials were present in the request URI r=deivid-rodriguez a=jdliss ### What was the end-user problem that led to this PR? Some gem servers respond to bad username/password request with a 401 instead of a 403. ### What was your diagnosis of the problem? When a 401 response was received, bundler would automatically assume no credentials were supplied, leading to a response of ``` Authentication is required for http://moto@gems.motologic.com/. Please supply credentials for this source. You can do this by running: bundle config http://moto@gems.motologic.com/ username:password ``` even when a username and password was present in the bundler config. ### What is your fix for the problem, implemented in this PR? There already exists a check for credentials in the request URI for 403 responses. I took that pattern and implemented it for 401 responses as well. ### Why did you choose this fix out of the possible options? I chose this fix because a very similar pattern already exists in bundler, I just applied the same logic to another response code. Co-authored-by: Jonathan <jonacom@lissismore.com>
| * remove unneeded variable in specJonathan2019-01-281-1/+0
| |
| * fix rubocop offensesJonathan2019-01-231-2/+2
| |
| * raise BadAuthenticationError when userinfo is found in 401 responsesJonathan2019-01-232-3/+30
| |
* | Remove unnecessary ruby filters from specsremove_unnecessary_ruby_filtersDavid Rodríguez2019-02-221-1/+1
|/
* Ensure credentials are masked in FallbackError from Net::HTTPNotFoundgreysteil/show-notfound-uriGrey Baker2019-01-141-0/+9
|
* Include URL in Bundler::Fetcher::FallbackError message for Net::HTTPNotFoundGrey Baker2019-01-031-1/+2
|
* Avoid leaving test data in the md5 availability cacheseg-global-gem-cacheSamuel Giddins2017-06-271-1/+8
|
* Extract md5 checking to SharedHelpersSamuel Giddins2017-06-271-1/+4
|
* Auto merge of #5634 - koic:specify_require_spec_helper_in_dot_rspec, r=indirectThe Bundler Bot2017-05-305-5/+0
|\ | | | | | | | | | | | | | | | | Specify `--require spec_helper` in .rspec Specifying `--require spec_helper` in .rspec will automatically require spec_helper in *_spec.rb. It isn't necessary to specify `require "spec_helper"` in individual *_spec.rb. I think that it's a [DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself) way. Refer: https://github.com/rspec/rspec/wiki#rspec
| * Specify `--require spec_helper` in .rspecKoichi ITO2017-05-035-5/+0
| |
* | [RuboCop] Enable Style/PercentLiteralDelimitersKoichi ITO2017-05-282-7/+7
| | | | | | | | Run `rubocop -a --only Style/PercentLiteralDelimiters` and `rubocop --auto-gen-config`.
* | Unify the notation of RubyGemsKoichi ITO2017-05-041-1/+1
|/
* [Downloader] Print underlying error in HTTPErrorseg-downloader-errorSamuel Giddins2017-04-131-3/+3
|
* remove unused Process.kill mock in FIPS-mode specWill Jordan2017-02-171-6/+0
|
* simplify `md5_available?` test using `OpenSSL::Digest:MD5.digest`Will Jordan2017-02-171-12/+10
|
* Enable compact index when OpenSSL FIPS mode is enabled but not activeWill Jordan2017-02-161-6/+38
|
* Disable RSpec monkey patchingSamuel Giddins2017-01-155-5/+5
|
* [CompactIndex] Only check for fips constant when it is definedseg-fipsSamuel Giddins2016-12-011-1/+1
|
* [CompactIndex] Disable when openssl is in fips modeSamuel Giddins2016-12-011-0/+16
|
* Merge tag 'v1.12.6'Samuel Giddins2016-10-101-1/+1
|\ | | | | | | | | | | | | | | | | Version 1.12.6 # Conflicts: # CHANGELOG.md # lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb # lib/bundler/version.rb
| * Fix usage of select...count to use countSamuel Giddins2016-10-101-1/+1
| |
| * Auto merge of #4607 - will-in-wi:clean_up_workers, r=segiddinsHomu2016-05-251-0/+24
| | | | | | | | | | | | | | | | | | | | Clean up worker threads once done with them Right now, the thread pools created by CompactIndex are not cleaned up once they are done. I assume that over time, they would be garbage collected, but in the meantime there could be 200+ threads running. Many shared hosts have fork bomb protection set up which kills Bundler. This patch will clean up the threads as soon as they are done, keeping the total number of active threads at any one time to a minimum. Fixes https://github.com/bundler/bundler/issues/4367
| * Fix the following warning in the test suite:James Wen2016-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` Bundler::Fetcher::Downloader fetch when the # requests counter is greater than the redirect limit WARNING: An expectation of `:body` was set on `nil`. To allow expectations on `nil` and suppress this message, set `config.allow_expectations_on_nil` to `true`. To disallow expectations on `nil`, set `config.allow_expectations_on_nil` to `false`. Called from /home/travis/build/bundler/bundler/spec/bundler/fetcher/downloader_spec.rb:19:in `block (3 levels) in <top (required)>'. ```
| * [Fetcher] Switch from bundler.rubygems.org to index.rubygems.orgSamuel Giddins2016-03-111-2/+2
| |
* | Update the dependency fetcher spec to pass in a flat array of gem namesseg-sort-dep-api-gem-namesSamuel Giddins2016-10-091-2/+2
| |
* | Auto merge of #4811 - NickLaMuro:dots_for_compact_index_logger, r=segiddinsHomu2016-07-261-0/+30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix random string printing inconsistencies and formatting Add dot output for CompactIndex fetcher --------------------------------------- The `Bundler::Fetcher::CompactIndex`'s logging was missing the "dot logging" when not in debug mode, which is an assumed behavior based on the code in `lib/bundler/source/rubygems.rb`: ```ruby api_fetchers.each do |f| Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug? idx.use f.specs_with_retry(dependency_names, self) Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over end ``` While this isn't critical for `bundler` function properly by any stretch of the imagination, it provides a small bit of user feedback that requests are still continuing to be processed and `bundler` hasn't stalled. It also maintains logging consistency between the different fetcher models. Add newlines for `Bundler::Retry` --------------------------------- This is very pedantic, but it makes it so that retry warning messages that used to look like this: ``` Fetching gem metadata from https://rubygems.org/....Retrying fetcher due to error (2/4): Error::OMGWatHappened LOL, no idea ..... ``` Now will look like this: ``` Fetching gem metadata from https://rubygems.org/.... Retrying fetcher due to error (2/4): Error::OMGWatHappened LOL, no idea..... ``` I think this reads a bit better and puts context to the "dots" so they now match up with the original attempt and the retries Remove unneeded if statement ---------------------------- Ran across this while failing at writing tests for the above (for longer than I want to admit in public), but basically the `if` statement to determine whether or not to print "name" in the `Bundler.ui.warn` was not needed, as it never could be reached because of a short circuiting return statement prior to the print ```ruby return true unless name ``` Have no idea how to test it anymore than we already are, so instead of embarrassing myself further, I moved on.
| * | Update CompactIndex to use log_specsNick LaMuro2016-07-251-0/+30
| | | | | | | | | | | | | | | | | | | | | `Bundler::Fetcher::CompactIndex` was missing the dots that are used by the fallback, `Bundler::Fetcher::Dependency` when running the `specs` method. This simply makes use of the newly extracted `log_specs` method instead of simply calling out to `Bundler.ui.debug`.
* | | Add URI to http response output in debug modeNick LaMuro2016-07-251-1/+1
|/ / | | | | | | | | Useful when mapping completed responses to requests when debugging to determine which requests are still in progress.
* | [RuboCop] Update to 0.41.2Samuel Giddins2016-07-201-3/+6
| |
* | add a test for not logging passwordsRoman Sandler2016-06-181-0/+12
| |
* | Do not log the credentials used to contact a gem serverRoman Sandler2016-06-181-11/+9
| | | | | | | | | | | | | | | | | | | | Adds a filter_uri method to HTTPError backed by the URICredentialsFilter to be used when preparing error output. In the tests, replace a double object with a real URI and change a test hostname to be valid so that older versions of Ruby's URI module don't choke on it. It would be cool to somehow replace this work with the `anonymized_uri` in the Bundler::Source::Rubygems::Remote class.
* | Fail gracefully on Errno::EHOSTUNREACHAllen Zhao2016-06-101-0/+9
| |
* | Remove useless comment.William Johnston2016-05-241-1/+0
| |
* | Fix issue with older versions of Ruby and URI.William Johnston2016-05-241-1/+1
| |
* | Fix code syntax testWilliam Johnston2016-05-241-1/+1
| |
* | Ack, forgot RubocopWilliam Johnston2016-05-241-2/+2
| |
* | Add test for thread issueWilliam Johnston2016-05-241-0/+25
| |
* | Suggest usage of `--full-index` flag in case of Dependency API failureJames Wen2016-03-311-15/+21
| | | | | | | | | | | | - Closes #4384 Signed-off-by: James Wen <jrw2175@columbia.edu>
* | [Fetcher] Switch from bundler.rubygems.org to index.rubygems.orgseg-index-rubygems-orgSamuel Giddins2016-03-111-2/+2
| |
* | Fix the following warning in the test suite:James Wen2016-03-101-1/+1
|/ | | | | | | | | | | | | | | ``` Bundler::Fetcher::Downloader fetch when the # requests counter is greater than the redirect limit WARNING: An expectation of `:body` was set on `nil`. To allow expectations on `nil` and suppress this message, set `config.allow_expectations_on_nil` to `true`. To disallow expectations on `nil`, set `config.allow_expectations_on_nil` to `false`. Called from /home/travis/build/bundler/bundler/spec/bundler/fetcher/downloader_spec.rb:19:in `block (3 levels) in <top (required)>'. ```
* Compatibility with frozen string literalsSamuel Giddins2016-01-314-0/+4
|
* [RuboCop] Fix Style/MutableConstantSamuel Giddins2016-01-311-6/+6
|
* Backfill unit tests for `Bundler::Fetcher::Downloader`James Wen2016-01-251-0/+229
|
* Update dependency fetcher specs for refactoringSamuel Giddins2016-01-251-73/+16
|
* [Fetcher::Base] Update specs for api_available? -> available?Samuel Giddins2016-01-251-4/+2
|