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

[2.0] Update the specs to pass under Bundler 2#5800

Merged
bundlerbot merged 16 commits intomasterfrom
seg-bundler-2-specs
Jun 23, 2017
Merged

[2.0] Update the specs to pass under Bundler 2#5800
bundlerbot merged 16 commits intomasterfrom
seg-bundler-2-specs

Conversation

@segiddins
Copy link
Copy Markdown
Contributor

@segiddins segiddins commented Jun 20, 2017

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

The problem was we have all these amazing Bundler 2.0 features hidden behind feature flags. But we weren't testing all of bundler in that 2.0 mode.

Was was your diagnosis of the problem?

My diagnosis was we needed to get the bundler 2 specs running, and passing!

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

My fix is to add a travis build entry to change version.rb to a 2.0 version and run the tests!

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

I chose this fix because it will completely imitate what happens once we change the version on master, and by keeping the test suite passing on both 1.0 and 2.0 modes, we'll be in a position to release a 1.16 to which we'll be able to (relatively easily) backport fixes that land after master switches to completely target 2.0.

@segiddins segiddins force-pushed the seg-bundler-2-specs branch 2 times, most recently from 17a1ebc to a666ae4 Compare June 21, 2017 22:43
@bundlerbot
Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #5804) made this pull request unmergeable. Please resolve the merge conflicts.

@segiddins segiddins force-pushed the seg-bundler-2-specs branch 2 times, most recently from be4d8c9 to df105d8 Compare June 22, 2017 17:03
@segiddins
Copy link
Copy Markdown
Contributor Author

If this now passes, I'll restore all the other build matrix entries. Please review?

@segiddins
Copy link
Copy Markdown
Contributor Author

Only thing failing on 2.0 are the real world specs 🎆

@segiddins
Copy link
Copy Markdown
Contributor Author

Blocked by #5788

@bundlerbot
Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #5806) made this pull request unmergeable. Please resolve the merge conflicts.

@segiddins segiddins force-pushed the seg-bundler-2-specs branch from df105d8 to fe6e03e Compare June 23, 2017 17:14
- 2.3.4
- 2.2.7
- 2.1.10
- 2.0.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the version that ships with Mac, would it make sense to keep this right now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please see the PR description

Don't worry, I'll rebase out the deletion of all the build entries once this is ready to merge.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

woops


@dependencies = dependencies
@dependencies = dependencies
@dependencies_by_name = dependencies.group_by(&:name)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a little concerned if this would introduce a boot time regression. I can take a look in a bit and test it out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree it's not ideal, but I can't think of how else to fix the only_update_to_newer_versions bug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess I could move this to additional_base_requirements_for_resolve so that we don't hit it in Bundler.setup ?

dep = Gem::Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
requirements[locked_spec.name] = DepProxy.new(dep, locked_spec.platform)
name = locked_spec.name
next requirements if @locked_deps[name] != @dependencies_by_name[name]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

next statements are my favourite statements, only superseded by break since these mean less work ;P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

but break here would have entirely different semantics, as this is a reduce

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@segiddins I was just making a statement that next statements are one of my favourite because they mean less work == often more boot time perf. Was a stupid joke :)

@segiddins segiddins force-pushed the seg-bundler-2-specs branch from fe6e03e to ca4b6f6 Compare June 23, 2017 17:44
@segiddins segiddins changed the title [WIP] Update the specs to pass under Bundler 2 [2.0] Update the specs to pass under Bundler 2 Jun 23, 2017
@unlocking = unlock == true || !unlock.empty?

@dependencies = dependencies
@dependencies = dependencies
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you fix the alignment here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ugh yeah, rubocop should've caught that :/ (came from reverting another change)

rescue GitError => e
raise unless Bundler.feature_flag.allow_offline_install?
Bundler.ui.warn "Using cached git data because of network errors"
Bundler.ui.warn "Using cached git data because of network errors\n#{e}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe add a colon after errors to suggest the exception error contains details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@out = Thread.new { stdout.read }.value.strip
@err = Thread.new { stderr.read }.value.strip
command_execution.exitstatus = wait_thr && wait_thr.value.exitstatus
command_execution.stdout = Thread.new { stdout.read }.value.strip
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't we want to .join the threads here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

value joins the thread

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TIL

@andremedeiros
Copy link
Copy Markdown
Member

@bundlerbot r+

@bundlerbot
Copy link
Copy Markdown
Collaborator

📌 Commit 63359d7 has been approved by andremedeiros

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 63359d7 with merge 8558fac...

bundlerbot added a commit that referenced this pull request Jun 23, 2017
[2.0] Update the specs to pass under Bundler 2

I'm opening this up as a WIP because I want travis to run. Don't worry, I'll rebase out the deletion of all the build entries once this is ready to merge.
@segiddins
Copy link
Copy Markdown
Contributor Author

@andremedeiros I haven't addressed your comments yet... (It's also failing on 1.8.7 because it doesn't seem to support \h)

@bundlerbot
Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@andremedeiros
Copy link
Copy Markdown
Member

@segiddins my bad. Sorry 😢

@segiddins
Copy link
Copy Markdown
Contributor Author

Rebased, added a PR description.

@segiddins segiddins force-pushed the seg-bundler-2-specs branch from 63359d7 to 717d194 Compare June 23, 2017 18:41
@segiddins
Copy link
Copy Markdown
Contributor Author

No worries, just paranoid about pegging our travis VMs (earlier last week stuff was taking half a day to run)

Copy link
Copy Markdown

@indirect indirect left a comment

Choose a reason for hiding this comment

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

lgtm too 👍🏻

@segiddins
Copy link
Copy Markdown
Contributor Author

Its. 🍏. 🎆

@bundlerbot r+

@bundlerbot
Copy link
Copy Markdown
Collaborator

📌 Commit 717d194 has been approved by segiddins

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 717d194 with merge a14b5c0...

bundlerbot added a commit that referenced this pull request Jun 23, 2017
[2.0] Update the specs to pass under Bundler 2

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

The problem was we have all these _amazing_ Bundler 2.0 features hidden behind feature flags. But we weren't testing all of bundler in that 2.0 mode.

### Was was your diagnosis of the problem?

My diagnosis was we needed to get the bundler 2 specs running, and passing!

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

My fix is to add a travis build entry to change `version.rb` to a 2.0 version and run the tests!

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

I chose this fix because it will completely imitate what happens once we change the version on `master`, and by keeping the test suite passing on both 1.0 and 2.0 modes, we'll be in a position to release a 1.16 to which we'll be able to (relatively easily) backport fixes that land after master switches to completely target 2.0.
@bundlerbot
Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-travis
Approved by: segiddins
Pushing a14b5c0 to master...

@bundlerbot bundlerbot merged commit 717d194 into master Jun 23, 2017
@segiddins segiddins deleted the seg-bundler-2-specs branch June 23, 2017 22:34
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.

5 participants