-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Change FactoryGirl to FactoryBot in Solidus v2.3 #2835
Conversation
18aba2d
to
becedd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
Personally, I'm against changing this in old versions branch/es. I know they should be maintained still for some time but the maintenance is more for security updates, or at least bugfix. Let's wait for some other opinions on this, thanks anyway. |
I would prefer to leave it as-is as well, so maybe I need to lock it to a pre-name change version? That would be a less invasive change. My goal here is to help extension authors who run CI against older versions. I had trouble getting versions with |
What about locking |
Are we able to kill using |
@kennyadsl the community is providing a valid change to help with backward compatibility. Solidus team members are committed to security patches for older versions. If a community member provides a fix, especially one that may be holding them back, I don't see why the Solidus team cannot merge it if the work has already been paid for. |
We have a policy of very stable branches. Even small changes may have impact on stores. Since this change does not affect the stability I am fine with it, but I am not sure why this change is needed. Do specs fail without that change? The factory_girl is still available. It hasn’t been removed from rubygems AFAIK. Maybe we need to pin the specific version. |
@tvdeyen specs fail because they removed the @BenMorganIO I wasn't aware that this was breaking extension specs on older Solidus versions when I said I was against this PR. Now that this is clear I'm open to merge this change, even if we should make the same thing for the other older versions maybe? |
@kennyadsl but not if we pin the version of @fastjames would you please revert all the Thanks for the contribution |
@tvdeyen I think we could even switch to factory_bot and just use |
@kennyadsl This only produces a lot of deprecation noise, no? This might confuse people and make them think they should upgrade. Are there any notable fixes in 4.10 that we need? I am not opposed to it, just think we should reduce deprecation notices to a minimum. |
@tvdeyen Yes, I was just afraid that 👍 for your proposal |
8fc4c55
to
e742e19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
Glad I could generate some discussion! To answer an earlier question from @tvdeyen I came to this because I had an extension whose specs were failing, and the errors seemed to point to the uphill |
@fastjames are you trying to use factory bot in your current project? |
If so, you may be able to cheat with this initializer: # config/initializers/factory_bot.rb
FactoryBot = FactoryGirl And then as you bump Solidus or try and add factory bot with factory girl (if that's possible :/) it should make the journey somewhat easier on you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
`factory_girl` 4.8.1 is the last version that supports being called as such; newer versions of the gem (now named `factory_bot`) have dropped the backcompat files.
d124cab
to
1c0bcab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming .rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming .rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout .rubocop.yml: Style/VariableNumber has the wrong namespace - should be Naming Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead. (obsolete configuration found in .rubocop.yml, please update it) The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.
I can reproduce the poltergeist timeout error, but not the other one; it seems to be related to the time being taken to compile assets. |
@fastjames yeah, I've ran into that issue before. |
I'm trying to locally run specs on an extension (solidus_auth_devise) using this branch and it does not work. 😢 I'm afraid my suggestion was incorrect and locking I think the only way to handle this is your first attempt which I've wrongly request changes for, sorry!. Do you have that version still available (maybe with |
@kennyadsl what happens if you lock the factory girl version in Solidus Auth Devise? Do they still fail? |
I think this change is still correct. If someone wants to build Solidus 2.3 we want the tests to pass. For extensions though we need to make sure that the extension is using factory girl 4.8.1 if they run specs for Solidus 2.3. |
Yes but currently almost all extensions are built to work with all solidus versions, adding some extra code or branch in all extension is worst than change In terms of the danger of doing that, I think it's just matter of specs so there could not be issues. If stores that still uses |
Extensions already have code that distinguish Solidus versions. See
The change extensions would need to make is not that hard actually. In # Gemfile
...
group :test do
...
if branch < "v2.5"
gem 'factory_bot', '4.10.0' # has both `factory_girl` and `factory_bot` in it.
else
gem 'factory_bot', '> 4.10.0'
end
...
end and remove the We can also update the |
It think we should avoid breaking the builds of people upgrading a minor (or patch version) of Solidus, if we can. |
@kennyadsl I will prepare a PR for |
@tvdeyen ok thanks, let's see how it comes 🙂 |
Actually the fix is even easierJust use |
So the plan is to keep all extension locked to I'm just concerned on how to explain that to users that creates new extension, maybe a big comment in the extension template in |
So the plan is to keep all extension locked to 'factory_bot', '4.10.0' until 2.4 reaches EOL. At that time we'll relax factory_bot in all extensions, right?
Sounds goo to me
I'm just concerned on how to explain that to users that creates new extension, maybe a big comment in the extension template in solidus_cmd?
If I would start a new extension today, I won't care for old Solidus version anyway. Especially not the ones that are EOL soon.
|
It should be mentioned in writing extensions as well. @tvdeyen what about someone who works with a store that is on an older Solidus? They might want to build an extension and would care to support the old versions. |
Yes, do it. But keep in mind that Solidus 2.4 will reach EOL in 6 months anyway 🤷♂️
Easy. Add |
Cough, cough #2835 (comment) 🤣 I'm happy if we all agree that this is a good solution. solidusio/solidus_auth_devise#130 is not needed anymore, right? |
It is. Without that change it would load newer versions of |
Oh right, I keep forgetting that the Solidus dev dependencies are not reflected into extensions. 👍 RE "the plan": Right now:
Once the EOL of 2.4 is reached (2019-05-07):
|
This is needed to aviod incompatibilities between this extension and old versions of solidus (< 2.5). This can be reverted when Solidus 2.4 reaches EOL. See solidusio/solidus#2835
This is needed to avoid incompatibilities between this extension and old versions of solidus (< 2.5). This can be reverted when Solidus 2.4 reaches EOL. See solidusio/solidus#2835
This PR is not needed anymore, right? |
Right, going to close this since we've found a solution that could be applied directly on extensions and there's no need to change core. |
Change FactoryGirl to FactoryBot
We need to backport this change to maintain the branch, since
factory_girl
is no longer available as a gem.I don't know how much interest there is in backporting changes like this, but I figured it would be useful since this branch is still under maintenance until November or so.