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

[Spree 2.1] Prepare and estimate upgrade to Spree 2.1 #3565

Closed
luisramos0 opened this issue Mar 1, 2019 · 11 comments
Closed

[Spree 2.1] Prepare and estimate upgrade to Spree 2.1 #3565

luisramos0 opened this issue Mar 1, 2019 · 11 comments
Assignees

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Mar 1, 2019

What we should change and why (this is tech debt)

We will upgrade to spree 2.1 at some point probably soon. v2.1 brings rails 4.

See discourse thread for context:
https://community.openfoodnetwork.org/t/spree-upgrade-go-live-on-v2-0-4-or-move-further-to-2-1-0/1534/4

We need to make the spree 2-1-0-stable branch work (bundle install is broken) and then branch ofn 2-1-stable (from ofn 2-0-stable) and make it use this spree 2-1-0-stable.

The objective of this issue is to have bundle install working on both spree and ofn 2-1 and we see a build in semaphore for it.

The state of the build will help us estimate the effort involved in getting 2-1 live.

Impact and timeline

Rails 4 ❤️

@luisramos0
Copy link
Contributor Author

Current status:
I have this OFN 2-1-stable branch: https://github.com/luisramos0/openfoodnetwork/commits/2-1-stable

It's only one commit updating to spree 2-1-0-stable, rails 4 and a few others.

Currently, trying to run
bundle update rails sass-rails rails-i18n

I am stuck with errors like this. I dont know how to fix these:

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (~> 4.0.0)

    db2fog was resolved to 0.9.0, which depends on
      rails (< 5.0, >= 3.2.0)

    deface (= 1.0.0) was resolved to 1.0.0, which depends on
      rails (>= 3.1)

Bundler could not find compatible versions for gem "rails-i18n":
  In Gemfile:
    rails-i18n (~> 4.0.0)

    spree_i18n was resolved to 1.0.0, which depends on
      rails-i18n

@sauloperez sauloperez pinned this issue Mar 4, 2019
@sauloperez sauloperez unpinned this issue Mar 5, 2019
@sauloperez
Copy link
Contributor

sauloperez commented Mar 12, 2019

these need to be solved by carefully investigating each case and appending the gems to the bundle update. It happened with v2 as well. I'm taking a look right now.

@sauloperez
Copy link
Contributor

sauloperez commented Mar 12, 2019

After a few tries, I decided to give a plain bundle update a go. https://gist.github.com/sauloperez/5aee4b6339f9d3e214560a805f76de04 is the output that I got. It will tell us what are the gems stopping us from upgrading.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Mar 16, 2019

I have just learned that:
~> 2.2 equals ['>= 2.2.0', '< 3.0']
while
~> 2.2.0 equals ['>= 2.2.0', '< 2.3.0']

@luisramos0
Copy link
Contributor Author

Nice, thanks for the gist!

A possible todo list from it:

  • upgrade simple_form from 2.0.2 so that it works with actionpack 4.0.0
  • updagre byebug to 9.1
  • upgrade sass-rails from 4.0.0 to a version that uses sass (~> 3.3)

But for the most part of it, I must be missing something, for example, in the last one, spring. Why is spring (= 1.7.2) a problem for spring-commands-rspec that requires spring (>= 0.9.1)? 1.7.2 is greater than 0.9.1.
This question applies to the following errors in your gist: activerecord, activesupport, i18n, listen, nokogiri, roo, rails-i18n and sass-rails.

I dont really understand this error either:

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (~> 4.0.0)
Could not find gem 'rails (~> 4.0.0)' in any of the sources.

@sauloperez
Copy link
Contributor

sauloperez commented Mar 20, 2019

I managed to get to a working Gemfile by commenting out a bunch of gems in #3627. We can start from there by investigating each of the conflicting ones.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Mar 21, 2019

thank you! I made some progress today on top of your work :-D

Branch state

I merged my initial effort (was 2-1-stable) and your PR #3627 plus more things I did today. It's now all in one single commit in the ofn/2-1-stable branch:
https://github.com/openfoodfoundation/openfoodnetwork/compare/2-0-stable...luisramos0:2-1-stable?expand=1

Run Local Server

I am currently able to create the DB and start the server locally. if I try to load the website I get a segmentationfault on pg adapter....
logs: https://gist.github.com/luisramos0/10d7195fdfbf91b0c07e4b4e550a459a

@luisramos0
Copy link
Contributor Author

luisramos0 commented Mar 21, 2019

re testing, I locked factory_bot to 4.8.2 and the tests are now running 🎉

shall we start the broken specs count down again? 🤣
1051 examples, 866 failures, 5 pending
979 examples, 772 failures, 1 pending

It's all broken in the same error, I'll have a look now.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Mar 21, 2019

to improve the build, I put some fixes to adapt to rails 4. they are all in ofn/2-1-stable

Now the build is breaking with foreign keys errors that I do not see when running the specs locally. any idea?

@luisramos0 luisramos0 changed the title Prepare and estimate upgrade to Spree 2.1 [Spree 2.1] Prepare and estimate upgrade to Spree 2.1 Apr 6, 2019
@luisramos0 luisramos0 self-assigned this Feb 21, 2020
@luisramos0
Copy link
Contributor Author

We now have a branch with the app and the tests running.
I'll close this issue after #4621 is merged (master without spree_backend) and the branch 3-0-stable is rebased.

@luisramos0
Copy link
Contributor Author

ok, 3-0-stable is rebased, we are ready to go. With all pending PRs we have 278 broken specs in this branch. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants