jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
587 stars 228 forks source link

Is the project using Semantic Versioning? - an API is changed between 1.2.0 and 1.3.0 - defined method `configure' for AjaxDatatablesRails:Module (NoMethodError) for 1.3.0 #383

Closed thebravoman closed 3 years ago

thebravoman commented 3 years ago

Hi, 1.3.0 I am trying to upgrade from 1.2.0 to 1.3.0

diff --git a/Gemfile.lock b/Gemfile.lock
index f062f232a..e41fe73e0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -307,24 +307,23 @@ GEM
       device_detector
       geocoder (>= 1.4.5)
       safely_block (>= 0.2.1)
-    ajax-datatables-rails (1.2.0)
-      railties (>= 5.0)
+    ajax-datatables-rails (1.3.0)

I see in the Changelog that you have

AjaxDatatablesRails.config is removed with no replacement. The gem is now configless :)

The following error occurs

/home/user/axles/code/fllcasts/gems/fc_subscriptions/config/initializers/ajax_datatables_rails.rb:1:in `<top (required)>': undefined method `configure' for AjaxDatatablesRails:Module (NoMethodError)
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/engine.rb:666:in `block in load_config_initializer'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:182:in `instrument'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/engine.rb:665:in `load_config_initializer'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/engine.rb:625:in `block (2 levels) in <class:Engine>'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/engine.rb:624:in `each'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/engine.rb:624:in `block in <class:Engine>'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `instance_exec'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `run'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:50:in `each'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:50:in `tsort_each_child'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:415:in `call'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:60:in `run_initializers'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/application.rb:363:in `initialize!'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `public_send'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `method_missing'
  from /home/user/axles/code/fllcasts/config/environment.rb:10:in `<top (required)>'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
  from /home/user/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

Isn't this considered an API changed between 1.2.0 and 1.3.0? Shouldn't this be version 2.0.0. I think 'bundle update' with a change from 1.2.0 to 1.3.0 should still keep the code working.

The project is using Semantic Versioning, but is it adhering to it? I could not find it in the README.md and that's why I am asking

martingjaldbaek commented 3 years ago

Seconded, a breaking change should have been a major revision. I understand not wanting to make a 2.0.0 release if it doesn't come with new features, but in that case, maybe just deprecate the config and make it optional, and then fully remove it sometime later when a 2.0.0 release seems appropriate?

n-rodriguez commented 3 years ago

The project is using Semantic Versioning, but is it adhering to it?

Yes it does. But I thought a deprecation cycle for a simple remove was too much.

n-rodriguez commented 3 years ago

BTW doing blind updates without even checking the changelog is just... not a serious work.

thebravoman commented 3 years ago

That's the purpose of a deprecation - to make a simple remove of an API method.

You can't have both Semantic Versioning and breaking API changes that do not increase the major number. These are incompatible.

How is this a blind update? You update, run specs and see if anything is broken. If there is, you investigate. If nothing is broken and the specs pass you can go to see what has changed between two releases. If everything is ok you can merge. You certainly don't go an follow each and every commit on each and every dependency that was pushed to its master.

Here the issue is 1.2 is changed to 1.3 with a breaking change. No problem with breaking. It is fixed in a minute. But if the project is using Semantic Versioning this breaking change could be properly communicated with version 2.0. No need to save the numbers. They are infinite.

n-rodriguez commented 3 years ago

You certainly don't go an follow each and every commit on each and every dependency that was pushed to its master.

Believe it or not, I check the changelog of every gems I update even before running the spec. It's a discipline I impose to myself so I can keep open dependencies on my project. I run a bundle update every week so I have time to read all changelogs because of the very few updates I have to do each time.

That said I'll do my best next time to not introduce breakages.

thebravoman commented 3 years ago

Thanks. Much appreciate. Thank you also for the good work on the gem. It is really helping us.