maxrossello / redmine_extended_watchers

Grant additional issue and project view permissions to watcher users
GNU General Public License v3.0
44 stars 20 forks source link

Redmine 5.0 #38

Closed misilot closed 2 years ago

misilot commented 2 years ago

When I have this plugin enabled, redmine 5.0 refuses to start

Here is the stack trace from the container that fails

redmine_1  | Your Gemfile lists the gem puma (>= 0) more than once.
redmine_1  | You should probably keep only one of them.
redmine_1  | Remove any duplicate entries and specify the gem only once.
redmine_1  | While it's not a problem now, it could cause errors if you change the version of one of them later.
redmine_1  | The Gemfile's dependencies are satisfied
redmine_1  | rake aborted!
redmine_1  | LoadError: cannot load such file -- extended_watchers_issue_patch
redmine_1  | /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
redmine_1  | /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies/zeitwerk_integration.rb:51:in `require_dependency'
redmine_1  | /usr/src/redmine/plugins/redmine_extended_watchers/init.rb:22:in `<top (required)>'
redmine_1  | /usr/src/redmine/lib/redmine/plugin_loader.rb:31:in `load'
redmine_1  | /usr/src/redmine/lib/redmine/plugin_loader.rb:31:in `run_initializer'
redmine_1  | /usr/src/redmine/lib/redmine/plugin_loader.rb:108:in `each'
redmine_1  | /usr/src/redmine/lib/redmine/plugin_loader.rb:108:in `block in load'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:427:in `instance_exec'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:603:in `catch'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:199:in `block in halting'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `each'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `invoke_before'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/reloader.rb:88:in `prepare!'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `instance_exec'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `run'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/initializable.rb:61:in `block in run_initializers'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/initializable.rb:60:in `run_initializers'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/application.rb:391:in `initialize!'
redmine_1  | /usr/src/redmine/config/environment.rb:19:in `<top (required)>'
redmine_1  | /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
redmine_1  | /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
redmine_1  | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/application.rb:367:in `require_environment!'
redmine_1  | /usr/local/bundle/gems/railties-6.1.4.7/lib/rails/application.rb:533:in `block in run_tasks_blocks'
redmine_1  | Tasks: TOP => db:migrate => db:load_config => environment
redmine_1  | (See full trace by running task with --trace)
redmine_1  | I, [2022-04-12T16:10:58.239943 #23]  INFO -- : Starting Extended Watchers plugin for Redmine
misilot commented 2 years ago

If I remove the plugin, redmine starts right up and runs its migrations as expected.

maxrossello commented 2 years ago

There's no branch supporting 5.0 yet

misilot commented 2 years ago

Ok, wasn't sure if it would just work or not with 5.x, and since it didn't I just wanted to report my findings. Thanks!

maxrossello commented 2 years ago

Thanks for reporting!

JanB97 commented 2 years ago

Hi! First of all thanks for the plugin, it works great with my Redmine 4.2.4 test install. Do you have any idea when this might work with Redmine 5?

maxrossello commented 2 years ago

To be honest, no. I am currently very short of spare time. However I believe that most of the needed changes are about Zeitwerk autoloading https://guides.rubyonrails.org/classic_to_zeitwerk_howto.html Any patch solving this issue would be very appreciated, it would let me just do the automated tests in the backgrounds via https://github.com/maxrossello/redmine_testsuites.

Lesson learned. For the future I should prepare the master branch against the current Redmine trunk

JanB97 commented 2 years ago

I honestly have absolutly no experience with ruby but i will see what I can do. Thanks for the info on what might be the problem.

JanB97 commented 2 years ago

So I got it to work for me. I had to remove require_dependency at first. It then complaint about an uninitialized Constant "ExtendedWatchersIssuePatch". I could not find where this was coming from and decided to just put a initialization in the "extended_watchers_issue_path". This seems like quite a hack and I would prefer to have this fixed the right way, maybe you know the problem here.

Anyways it seems to work for me atleast with Redmine 5.0 with this: #39

maxrossello commented 2 years ago

Yeah, Ruby components often use some magic, and probably this one looks for ExtendedWatchersIssuePatch into extended_watchers_issue_patch.rb. I believe that it's possible to just rename ExtendedWatchersIssueInstancePatch to ExtendedWatchersIssuePatch all through the file. Anyways I'll setup the test environment ASAP. Thanks for the contribution

TomasZmuda commented 2 years ago

Hi, we updated to RM 5.0.2 version with RM extended watchers plugin #39. Plugin is working properly, but Redmine feature https://www.redmine.org/issues/13919 is not working. No autocomplete window, no error in console. Could someone please try it?

maxrossello commented 2 years ago

Candidate version is available on master branch. It passes with all Redmine tests as adapted for plugins by redmine_testsuites plugin. The use case of Redmine issue 13919 may not be covered by Redmine tests, so I will try to reproduce it. Official release of plugin version 5.0 will be deployed after all plugins supported by redmine_testsuites had been ported.

maxrossello commented 2 years ago

immagine

@TomasZmuda version on master seems to work for me. Tested also that a non watcher get enabled to mentioning when assigned as watcher (at least in extended mode). Please report your feedback. I'll close this issue when an official release done, i.e. when compatibility with all redmine_testsuite plugins is assured.

maxrossello commented 2 years ago

Release 5.0.2 deployed upon new branch for 5.0. Enjoy!