btey / openproject-gitlab-integration

OpenProject module for integration with Gitlab
GNU General Public License v3.0
84 stars 18 forks source link

Upgraded to 13.1.0, cannot compile gitlab_integration with 13.1.0 #54

Open crankedguy opened 9 months ago

crankedguy commented 9 months ago

Hello,

today I upgraded to OP 13.1.0, and was not able to recompile it with gitlab_integration anymore, which I need importantly. As there is no possibility to downgrade OP I ask for help here. I saw you release a new version 2 weeks ago, so maybe this is because 13.1.0, maybe it is also because of the new version, this I can't tell from here.

I described the error in detail here : https://community.openproject.org/projects/openproject/work_packages/51625/activity

Would be nice if you could help asap. Many thanks!

This is what I get when I want to compile with gitlab_integration, without it the compile ran through :

ArgumentError: missing keyword: :permissible_on (ArgumentError)
/opt/openproject/lib/open_project/access_control/permission.rb:42:in `initialize'
/opt/openproject/lib/open_project/access_control/mapper.rb:33:in `new'
/opt/openproject/lib/open_project/access_control/mapper.rb:33:in `permission'
/opt/openproject/lib/redmine/plugin.rb:325:in `block (2 levels) in permission'
/opt/openproject/lib/open_project/access_control/mapper.rb:42:in `project_module'
/opt/openproject/lib/redmine/plugin.rb:324:in `block in permission'
/opt/openproject/lib/open_project/access_control.rb:36:in `map'
/opt/openproject/lib/redmine/plugin.rb:323:in `permission'
/opt/openproject/vendor/bundle/ruby/3.2.0/bundler/gems/openproject-gitlab-integration-54cfe5dd4931/lib/open_project/gitlab_integration/engine.rb:47:in `block (2 levels) in <class:Engine>'
/opt/openproject/lib/redmine/plugin.rb:344:in `instance_eval'
/opt/openproject/lib/redmine/plugin.rb:344:in `block in project_module'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in `instance_exec'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:445:in `block in make_lambda'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in `catch'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:686:in `block in default_terminator'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:200:in `block in halting'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in `block in invoke_before'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in `each'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:595:in `invoke_before'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:106:in `run_callbacks'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/reloader.rb:88:in `prepare!'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:68:in `block in <module:Finisher>'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/railtie.rb:226:in `public_send'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/railtie.rb:226:in `method_missing'
/opt/openproject/config/environment.rb:32:in `<top (required)>'
<internal:/opt/openproject/vendor/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/openproject/vendor/ruby-3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/railties-7.0.8/lib/rails/application.rb:506:in `block in run_tasks_blocks'
/opt/openproject/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
/opt/openproject/bin/bundle:110:in `load'
/opt/openproject/bin/bundle:110:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
crankedguy commented 9 months ago

I tried to compile in 2.0.8 which results in the same error, so there seems to be some defunct together with 13.1. With 13.0.8 everything was working fine It seems to be related to this : https://github.com/opf/openproject/pull/13532 and this https://community.openproject.org/topics/17911

crankedguy commented 9 months ago

After implementing this manually it worked https://github.com/opf/openproject/pull/13532/commits/c6705401a489d82dc4513799625bd8fc35ebed4a

btey commented 9 months ago

@crankedguy Yes, there is a new parameter required in the permission method from v13.1.0. I created a hotfix branch for you to test. If works I will merge it in the master.

Branch: Hotfix-for-OP-v13.1.0

Let me know if works.

Thanks, Ben

crankedguy commented 9 months ago

@btey Many thanks for your quick reaction. Now, I won't test your branch specifically in terms of downloading and installing it, because 13.1.0 was kinda a mess upgrade. I am happy that it is running now, nearly without any quirks but spamming my email every 5 minutes with Rails warnings.

But I can happily tell you that this is exactly what I implemented, and it seems to work so far regarding the gitlab integration. So I think you can integrate it into your main.

Thanks, Thomas

crankedguy commented 9 months ago

Works so far means : I was able to compile it via Gemfile and the Gitlab information is also showing up. I sadly have no time to test the new functionality you provided in your last releases right now as I am in the middle of a project. Came at the right time :( But all the information in the tasks was there, there were no compilation issues and I checked that the Gitlab tab is showing up

btey commented 9 months ago

@crankedguy Ok, thank you so much. Tomorrow I will merge the patch into the main branch.

crankedguy commented 9 months ago

@btey : There seem to be other issues though, I get this on a regular basis after I change the status of only a few work packages, after that OP is dead, I have to restart it and after change of status of another 5-10 packages I have to do the same again

2023-12-16T07:18:57.453398+01:00 riot openproject-web-1.service[285131]: F, [2023-12-16T07:18:57.453143 #285131] FATAL -- : [2b54cc03-de87-4df5-a75b-e0523195550d]
2023-12-16T07:18:57.453443+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] SystemStackError (stack level too deep):
2023-12-16T07:18:57.453457+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d]
2023-12-16T07:18:57.453470+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/open_project/deprecation.rb:49:in `deprecate_method'
2023-12-16T07:18:57.453489+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] app/models/users/permission_checks.rb:150:in `allowed_to?'
2023-12-16T07:18:57.453508+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] openproject-gitlab-integration (54cfe5dd4931) lib/open_project/gitlab_integration/patches/api/work_package_representer.rb:38:in `block (2 levels) in extension'
2023-12-16T07:18:57.453535+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/caching/cached_representer.rb:98:in `instance_exec'
2023-12-16T07:18:57.453554+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/caching/cached_representer.rb:98:in `block in apply_link_cache_ifs'
2023-12-16T07:18:57.453573+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/caching/cached_representer.rb:96:in `each'
2023-12-16T07:18:57.453591+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/caching/cached_representer.rb:96:in `apply_link_cache_ifs'
2023-12-16T07:18:57.453610+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/caching/cached_representer.rb:56:in `to_json'
2023-12-16T07:18:57.453628+01:00 riot openproject-web-1.service[285131]: [2b54cc03-de87-4df5-a75b-e0523195550d] lib/api/formatter.rb:35:in `call'
2023-12-16T07:18:57.468222+01:00 riot openproject-web-1.service[285131]: E, [2023-12-16T07:18:57.468174 #285131] ERROR -- : [2b54cc03-de87-4df5-a75b-e0523195550d] user=5 stack level too deep: stack level too deep
xkvnn commented 9 months ago

Same here with the latest branch, APIs return status code 500 when loading work packages.

F, [2023-12-17T02:46:08.179641 #205] FATAL -- : [96a10f70-5d70-457d-93e2-b495f1c25177]   
[96a10f70-5d70-457d-93e2-b495f1c25177] SystemStackError (stack level too deep):
[96a10f70-5d70-457d-93e2-b495f1c25177]   
[96a10f70-5d70-457d-93e2-b495f1c25177] openproject-gitlab-integration (a0b293db2ffd) lib/open_project/gitlab_integration/patches/api/work_package_representer.rb:38:in `block (2 levels) in extension'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/caching/cached_representer.rb:98:in `instance_exec'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/caching/cached_representer.rb:98:in `block in apply_link_cache_ifs'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/caching/cached_representer.rb:96:in `each'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/caching/cached_representer.rb:96:in `apply_link_cache_ifs'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/caching/cached_representer.rb:56:in `to_json'
[96a10f70-5d70-457d-93e2-b495f1c25177] lib/api/formatter.rb:35:in `call'
crankedguy commented 9 months ago

Yep there seems to be definitely a more severe issue, it occurs time and again, luckily everything still "works" after a restart for the time being, but you can not call it being able to work properly

btey commented 9 months ago

Hi @crankedguy @xkvnn

There is a new version v2.1.4 fixing these other errors.

crankedguy commented 9 months ago

Sorry that I did not respond until now, I am in the middle of something else, but will recompile in the next days and get back to you. Thanks for acting so quick!

crankedguy commented 9 months ago

I recompiled it now. I don't know why but I had to insert the tag 2.1.4 manually in the Gemfile, otherwise it pulled stil 2.1.2. Anyway will give info if something is coming up,