Skip to content

Test support for Rails 5.1#4882

Merged
Fivell merged 7 commits intomasterfrom
rails-5-1
Apr 14, 2017
Merged

Test support for Rails 5.1#4882
Fivell merged 7 commits intomasterfrom
rails-5-1

Conversation

@varyonic
Copy link
Contributor

Waiting for database_cleaner 1.6.0 with deprecation warning fixed.


# Force deprecations to raise an exception.
ActiveSupport::Deprecation.behavior = :raise
ActiveSupport::Deprecation.behavior = ActiveAdmin::Dependency.rails?('< 5.1.x') ? :raise : :stderr # FIXME: need database_cleaner 1.6.0.
Copy link
Member

Choose a reason for hiding this comment

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

@varyonic , can we change Gemfile to use database_cleaner 1.6.0. from github ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1.6.0 is not released yet. We can revert Gemfile to gem 'database_cleaner', github: 'DatabaseCleaner/database_cleaner' as it was last summer after Rails 5.0.

Copy link
Member

Choose a reason for hiding this comment

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

@varyonic , basically I'm ok with both options, but we should somehow not forget to return ActiveSupport::Deprecation.behavior

@Fivell Fivell self-requested a review March 26, 2017 19:18
When I am on the index page for posts
Then I should see the css file "active_admin.css"
Then I should see the js file "active_admin.js"
Then I should see the css file "active_admin"
Copy link
Member

Choose a reason for hiding this comment

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

@varyonic , would you please explain why we remove file extension here?

Copy link
Contributor Author

@varyonic varyonic Mar 27, 2017

Choose a reason for hiding this comment

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

Because I removed asset.digest = false, so the css file is now something like active_admin.87a9...98ef.css As of 5.1 I believe digesting is done by Webpack and digest = false seems ignored.

Copy link
Member

Choose a reason for hiding this comment

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

Since our rough conclusion was that webpacker is opt-in and we're not using it, I have the feeling that the old setup might actually work. Should we double check this?

s.add_dependency 'railties', '>= 4.0', '< 5.1'
s.add_dependency 'ransack', '~> 1.3'
s.add_dependency 'sass-rails'
s.add_dependency 'thor', '0.19.1', '!=0.19.2', '!=0.19.3', '!=0.19.4' # http://stackoverflow.com/questions/41207432/
Copy link
Member

Choose a reason for hiding this comment

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

'0.19.1', '!=0.19.2', '!=0.19.3', '!=0.19.4' doesn't make sense.
'~>0.19.1', '!=0.19.2', '!=0.19.3', '!=0.19.4', would make sense.
Be in general I think we should not fix third party bugs. We only should limiting version if our code has a problem with this version, not if JBuilder has a problem with this version.

Copy link
Member

Choose a reason for hiding this comment

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

Is jbuilder a direct runtime dependency of AA or does this fix only a problem in our tests? If the latter, the dependency should be added to the Gemfile, or even better, to lock files committed to version control.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only impacts rake:setup and is an unclear warning rather than an error. I'm inclined to omit this.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's do that. I need to find time to propose the addition of lock files to the repo, but it definitely doesn't belong here.

@varyonic
Copy link
Contributor Author

varyonic commented Apr 3, 2017

Rebased and updated for review.

Copy link
Member

@Fivell Fivell left a comment

Choose a reason for hiding this comment

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

@varyonic, I'm ok with this

@varyonic
Copy link
Contributor Author

varyonic commented Apr 4, 2017

@timoschilling Shall I add to CHANGELOG?

.travis.yml Outdated

before_install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install 4
- npm install -g yarn
Copy link
Member

Choose a reason for hiding this comment

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

Do we need nvm and yarn in CI now?

Copy link
Contributor Author

@varyonic varyonic Apr 7, 2017

Choose a reason for hiding this comment

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

Yes, asset compilation will fail without it as they are prerequistes for webpacker.

Copy link
Member

@deivid-rodriguez deivid-rodriguez Apr 7, 2017

Choose a reason for hiding this comment

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

But I thought this was an opt-in feature and I don't see the webpacker gem specified anywhere...

In any case, I still don't understand why we need nvm and why we use it to install... nodejs v4 (apparently webpacker prerrequiste is nodejs v6.4.0+).

Copy link
Contributor Author

@varyonic varyonic Apr 7, 2017

Choose a reason for hiding this comment

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

The beta release note is not entirely clear, it states webpack is optional but yarn is required. I ran out of time to dig into why. The (0.12?) nvm pre-installed by Travis is too old. I copied the workaround from a blog post. Feel free to offer a better solution.

Copy link
Member

Choose a reason for hiding this comment

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

My try would be to remove those two lines, since I don't think they are needed. It's very surprising to me that the build fails without them.

Copy link
Member

Choose a reason for hiding this comment

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

I believe you, I just don't understand why. Anybody?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Appears I was wrong. They appeared necessary before but no longer. Will push an update.

.gitignore Outdated
.rbenv-version
.localeapp/*
lib/bug_report_templates/tmp
gemfiles/bin
Copy link
Member

Choose a reason for hiding this comment

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

What about this? I wouldn't expect any binstubs generated here. Maybe it's related to the old setup with yarn and nvm?

@Fivell Fivell merged commit d4473e9 into master Apr 14, 2017
@Fivell Fivell deleted the rails-5-1 branch April 14, 2017 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants