Skip to content

Conversation

@PowerKiKi
Copy link
Collaborator

No description provided.

@PowerKiKi
Copy link
Collaborator Author

@alexandermeindl, my very naive attempt to test on Redmine 5 failed miserably for a whole lot of reason. By any chance have you upgraded to Redmine 5 already ? or is it something you might be working on soon-ish ?

@alexandermeindl
Copy link
Collaborator

Hi @PowerKiKi,

no, sorry. I did no work for upgrading to Redmine 5 and currently it is not planned, too.

@tomhub
Copy link

tomhub commented Jun 23, 2022

Hi
It is strange: plugin requires additionals plugin, but additionals seem to require redmine 5. However, redmine_git_hosting is not redmine 5 compatible.. Maybe instructions need to be updated how to pull correct version dependencies for redmine_git_hosting?

@alexandermeindl
Copy link
Collaborator

Hi It is strange: plugin requires additionals plugin, but additionals seem to require redmine 5. However, redmine_git_hosting is not redmine 5 compatible.. Maybe instructions need to be updated how to pull correct version dependencies for redmine_git_hosting?

I fixed documentation for the right version: http://redmine-git-hosting.io/get_started/

@Alwaysin
Copy link

Alwaysin commented Sep 9, 2022

Hi @PowerKiKi , did you by any chance make it work with Redmine 5 with your latest commits?

@alexandermeindl did you change your mind since June? :)

…ents

Ruby 3.0 does not implicitly destructure a Hash into keyword arguments
if it was the last parameter to a method call.

Also handle explicitely delegate keyword arguments.
Seems we only want an optional hash not keyword arguments so
remove the double sprat and set a default empty hash value.
…Cache>::Timezone

Typo Timezone.new instead of Time.zone.now
@dosyfier dosyfier mentioned this pull request Sep 10, 2022
@dosyfier
Copy link

Hi,
I carried on your good work, and I'm think I'm pretty close to something fully functional with Redmine 5.
Please have a look to #815.

This new gitolite-rugged version brings rugged v1.5.x instead of v1.1.x,
which allows gitolite-rugged to specify credentials when pushing to a
git (which is expected for it to work correctly).

By the way:
* pkg-config is necessary to build rugged native C extensions;
* starting from v1.5, rugged expects an explicit setting to build with
  SSH support, which is expected by redmine_git_hosting to work
  correctly (see: https://github.com/libgit2/rugged/tree/v1.5.0#options)
The options hash passed to repository constructor is duplicated.

See lib/redmine_git_hosting/gitolite_handlers/repositories/base.rb#13

Thus, options should be updated by accessing the class' attribute
directly.
@PowerKiKi
Copy link
Collaborator Author

PowerKiKi commented Sep 11, 2022

Superseded by #815

@PowerKiKi PowerKiKi closed this Sep 11, 2022
@PowerKiKi PowerKiKi reopened this Sep 14, 2022
@PowerKiKi
Copy link
Collaborator Author

PowerKiKi commented Sep 14, 2022

@dosyfier on this branch, which also contains your changes, I get the following error when accessing http://localhost:3000/settings/plugin/redmine_git_hosting. Is it working for you ?

Showing /sites/redmine/plugins/redmine_git_hosting/app/views/settings/_redmine_git_hosting.html.slim where line #22 raised:

undefined local variable or method `gitolite_plugin_settings_tabs' for #<ActionView::Base:0x0000000001e910>

@dosyfier
Copy link

@dosyfier on this branch, which also contains your changes, I get the following error when accessing http://localhost:3000/settings/plugin/redmine_git_hosting. Is it working for you ?

Showing /sites/redmine/plugins/redmine_git_hosting/app/views/settings/_redmine_git_hosting.html.slim where line #22 raised:

undefined local variable or method `gitolite_plugin_settings_tabs' for #<ActionView::Base:0x0000000001e910>

No, I didn't get that one (and I was able to go to redmine_git_hosting settings page).

I'll try again next weekend.

@dosyfier
Copy link

dosyfier commented Sep 14, 2022

Something worth noticing though: by upgrading rugged lib to v1.5.0.1, I had to add the following option to bundler before running bundle install:

bundle config build.rugged --with-ssh

Cf. commit b18ebcf.

The block registered by redmine_git_hosting plugin to
Rails.application.config.to_prepare wasn't actually called (at least, in
a test context).

This appears to be due to the fact that the plugin's init.rb file is
already loaded from within a Rails "to_prepare" initialization event
block. Cf. Redmine's PluginLoader class and its "load" method defined in
lib/redmine/plugin_loader.rb file: a Rails "to_prepare" block iterates
over all plugin directory to find and load an "init.rb" file.

As a consequence, there's no need to rewrap some code from the plugin's
init.rb file into a Rails "to_prepare" event handling block.
Maybe due to upgrading to Ruby 3.x, the code of these modules couldn't
be loaded anymore, due to an infinite loading loop.

For instance, for the Commands module:
* Loading of commands.rb is triggered,
  * As its first instruction, the module extends Commands::Base,
  * So the loading of commands/base.rb is triggered,
    * But then, in that file, the Base module is included in the
      Commands module, which has to be loaded first,
      * And so, we're back to the beginning...

To work around this, the "extend Xx::Xx" instructions are moved to the
submodules themselves, so that each submodule can be loaded
independently and add its contributions to the main module (Commands or
Config).
After upgrading to Ruby 3.1, following error raises when running
redmine_git_hosting tests depending on loading a fixture based on a YAML
file:

    Psych::DisallowedClass:
           Tried to load unspecified class: Time
Redmine5 finalization: modules loading
@PowerKiKi PowerKiKi merged commit 7f26e47 into master Sep 29, 2022
@PowerKiKi PowerKiKi deleted the redmine5 branch September 29, 2022 15:59
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.

7 participants