PowerKiKi
Repos
214
Followers
158
Following
16

Events

Redmine5 finalization: modules loading

This is great, thank you !

Is there anything else you would like to do before we cut a release ?

Created at 13 hours ago

Correct loading of Redmine Git Hosting patches

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.

Correct loading of RedmineGitHosting::Commands & Config modules

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).

Correct a Psych::DisallowedClass error in tests

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
                                

Merge pull request #816 from dosyfier/redmine5

Redmine5 finalization: modules loading

Created at 13 hours ago
pull request closed
Redmine5 finalization: modules loading

This pull request is an appendix to #815 (which was prematurely merged).

It concludes the plugin migration towards Redmine 5 initiated by #813.

It corrects:

  • the loading of all Redmine Git Hosting classes, triggered by RedmineGitHosting.load_plugin!, which wasn't called anymore;
  • the loading of Redmine Git Hosting's Commands and Config modules, which failed in an infinite loading loop.
Created at 13 hours ago
pull request closed
#234: added migration to fix older ActiveRecord serialization of plugin settings

This fixes #234

Created at 16 hours ago
closed issue
Migrating from Redmine 3.3.0 (Ruby 2.3) (redmine_tags 3.2.2) to Redmine 4.1.7 (Ruby 2.6) (redmine_tags master branch) breaks plugin settings

We're in the process of updating Redmine.

Before: Redmine 3.3.0 on Ruby 2.3 using redmine_tags 3.2.2 After: Redmine 4.1.7 on Ruby 2.6 using redmine_tags commit 2c0c66c73c36dfa53f6e6b2decf8828f49054d1d

What happens: Before the upgrade, the redmine_tags settings are stored this way:

--- !ruby/hash-with-ivars:ActionController::Parameters
elements:
  issues_sidebar: cloud
  issues_show_count: '1'
  issues_open_only: '1'
  issues_sort_by: name
  issues_sort_order: asc
ivars:
  :@permitted: false

After the update the plugin settings should (!) be stored this way:

--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
issues_sidebar: none
issues_sort_by: name
issues_sort_order: asc

When changing from Rails 4 to Rails 5, somewhere down the line ActiveRecord is updated so that this happens:

Caused by:
NoMethodError: undefined method `with_indifferent_access' for #<ActionController::Parameters:0x0ba909d8>
/app/tools/redmine/4.1.7/.appgems/ruby/2.6.0/gems/actionpack-5.2.6.3/lib/action_controller/metal/strong_parameters.rb:236:in `initialize'
/app/tools/redmine_tags/2c0c66c73c36dfa53f6e6b2decf8828f49054d1d/lib/redmine_tags.rb:3:in `new'
/app/tools/redmine_tags/2c0c66c73c36dfa53f6e6b2decf8828f49054d1d/lib/redmine_tags.rb:3:in `settings'

ActiveRecord wants to load the settings, expects a method called with_indifferent_access, but the old hash-with-ivars:ActionController::Parameters (if it even exists anymore), doesn't have one.

One solution is to add a migration step that loads the settings field avoiding ActiveRecord, transform it to a HashWithIndifferentAccess and store the settings again.

Like so:

class Testmigrate < ActiveRecord::Migration[4.2]
  def up
    new_settings = ActiveSupport::HashWithIndifferentAccess.new
    old_settings = Setting.plugin_redmine_tags
    old_settings.each do |key, value|
      new_settings[key] = value
    end
    Setting.send "plugin_redmine_tags=", new_settings
  end
end

This fixes the stored settings. I'll open a PR for this...

Created at 16 hours ago

#234: added migration to fix older ActiveRecord serialization of plugin settings

Merge pull request #235 from danowar2k/#234-fix-settings-class

#234: added migration to fix older ActiveRecord serialization of plugin settings

Created at 16 hours ago
issue comment
Fix Redmine 5.0 / Rails 6.1 / Zeitwerk

I merged the migration to GitHub Actions in #236. It is failing for now, but if you rebase this PR on top of master, then the tests should eventually pass.

Created at 16 hours ago
delete branch
PowerKiKi delete branch github-actions
Created at 16 hours ago
pull request closed
Migrate to GitHub Actions
Created at 16 hours ago

Migrate to GitHub Actions

Created at 16 hours ago

Migrate to GitHub Actions

Created at 16 hours ago

Migrate to GitHub Actions

Created at 16 hours ago

Migrate to GitHub Actions

Created at 16 hours ago

Migrate to GitHub Actions

Created at 16 hours ago
pull request opened
Migrate to GitHub Actions
Created at 16 hours ago
create branch
PowerKiKi create branch github-actions
Created at 16 hours ago
issue comment
Fix Redmine 5.0 / Rails 6.1 / Zeitwerk

I get the following error when navigating to /settings/plugin/redmine_tags. Do you have the same one ? Are you able to fix it ?

Started GET "/settings/plugin/redmine_tags" for 127.0.0.1 at 2022-09-26 14:49:38 +0200
Processing by SettingsController#plugin as HTML
  Parameters: {"id"=>"redmine_tags"}
   (0.8ms)  SELECT MAX(`tokens`.`updated_on`) FROM `tokens` WHERE `tokens`.`user_id` = 1 AND `tokens`.`value` = '5997798e9477f8416a08486a447021869079a300' AND `tokens`.`action` = 'session'
  ↳ app/models/user.rb:479:in `verify_session_token'
  Token Update All (8.6ms)  UPDATE `tokens` SET `tokens`.`updated_on` = '2022-09-26 14:49:38' WHERE `tokens`.`user_id` = 1 AND `tokens`.`value` = '5997798e9477f8416a08486a447021869079a300' AND `tokens`.`action` = 'session'
  ↳ app/models/user.rb:483:in `verify_session_token'
   (0.7ms)  SELECT MAX(`settings`.`updated_on`) FROM `settings`
  ↳ app/models/setting.rb:280:in `check_cache'
  User Load (0.7ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` = 'User' AND `users`.`status` = 1 AND `users`.`id` = 1 LIMIT 1
  ↳ app/controllers/application_controller.rb:117:in `find_current_user'
  Current user: admin (id=1)
  Rendering layout layouts/admin.html.erb
  Rendering settings/plugin.html.erb within layouts/admin
  Rendered plugins/redmine_tags/app/views/tags/_general.html.erb (Duration: 2.6ms | Allocations: 1036)
  Rendered plugins/redmine_tags/app/views/tags/_manage_tags.html.erb (Duration: 17.8ms | Allocations: 3811)
  Rendered common/_tabs.html.erb (Duration: 22.4ms | Allocations: 5278)
  Rendered plugins/redmine_tags/app/views/tags/_settings.html.erb (Duration: 23.0ms | Allocations: 5410)
  Rendered settings/plugin.html.erb within layouts/admin (Duration: 24.7ms | Allocations: 5729)
  Rendered layout layouts/admin.html.erb (Duration: 25.0ms | Allocations: 5798)
Completed 500 Internal Server Error in 53ms (ActiveRecord: 10.8ms | Allocations: 8895)


  
ActionView::Template::Error (undefined method `available_tags' for Issue:Class):
    1: <% tags = Issue.available_tags %>
    2: <% unless tags.empty? %>
    3:   <table class="list issues">
    4:     <thead>
  
plugins/redmine_tags/app/views/tags/_manage_tags.html.erb:1
app/views/common/_tabs.html.erb:21
app/views/common/_tabs.html.erb:20:in `each'
app/views/common/_tabs.html.erb:20
app/helpers/application_helper.rb:498:in `render_tabs'
plugins/redmine_tags/app/views/tags/_settings.html.erb:17
app/views/settings/plugin.html.erb:6
app/views/settings/plugin.html.erb:4
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
127.0.0.1 - - [26/Sep/2022:14:49:38 CEST] "GET /settings/plugin/redmine_tags HTTP/1.1" 500 244533
http://localhost:3000/admin/plugins -> /settings/plugin/redmine_tags
Created at 16 hours ago
delete branch
PowerKiKi delete branch patch-1
Created at 23 hours ago

Must disable plugins when running as root with the latest composer

Created at 3 days ago
issue comment
Make methods strongly typed instead of using string input parameters

Nothing matter more than your health. Take all the time you need.

And if you find out that you're not so much interested in this anymore, that's totally fine too. Just let us know, so someone else might be picking it up later on...

Created at 3 days ago

Minor code style

Created at 4 days ago

Minor typo

Created at 4 days ago
ng build cause warnings with pseudo-selectors in :is/:where

@developit, you've been active recently on this issue, and there is a very similar issue with possible solution in https://github.com/GoogleChromeLabs/critters/issues/103#issuecomment-1208236366. Could you have a look and offer guidance on how to move forward please ?

Created at 6 days ago
Warning when using :host-context that is subselects_1.subselects[name] is not a function

This is very likely to have the same root cause as #103, and IMHO should be close as duplicate.

Created at 6 days ago
rules skipped due to selector errors: legend+* -> Cannot read property 'type' of undefined

@alan-agius4 were you able to discuss this with Angular team and/or Critters team ?

I'd be willing to create a PR, but since this would be a large change I need to be sure there is a chance of merging it before doing anything...

Created at 6 days ago
issue comment
Bug: ng build cause warnings with pseudo-selectors in :is/:where

Also see https://github.com/GoogleChromeLabs/critters/issues/103#issuecomment-1208236366 which suggests a solution, but is awaiting an input from either Angular team or Critters team.

Created at 6 days ago
issue comment
[TemplateProcessor] Clean up temp files

Reverted in 2b7b4ddc5f537389e626e887ccecca8a759dc180

Created at 6 days ago

Configure actions/stale

Created at 6 days ago
closed issue
PHPUnit broken under PHP 8

I want to run the tests under PHP 8.

[franz@franz-820 PHPWord ((0.18.3))]$ composer test-no-coverage
> phpunit --color=always --no-coverage
PHP Fatal error:  Uncaught Error: Call to undefined function each() in /home/franz/Github/PHPWord/vendor/phpunit/phpunit/src/Util/Getopt.php:38
Stack trace:
#0 /home/franz/Github/PHPWord/vendor/phpunit/phpunit/src/TextUI/Command.php(240): PHPUnit_Util_Getopt::getopt()
#1 /home/franz/Github/PHPWord/vendor/phpunit/phpunit/src/TextUI/Command.php(111): PHPUnit_TextUI_Command->handleArguments()
#2 /home/franz/Github/PHPWord/vendor/phpunit/phpunit/src/TextUI/Command.php(100): PHPUnit_TextUI_Command->run()
#3 /home/franz/Github/PHPWord/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#4 /home/franz/Github/PHPWord/vendor/bin/phpunit(110): include('/home/franz/Git...')
#5 {main}
  thrown in /home/franz/Github/PHPWord/vendor/phpunit/phpunit/src/Util/Getopt.php on line 38
Script phpunit --color=always --no-coverage handling the test-no-coverage event returned with error code 255

  • PHP Version: 8.0.16
  • PHPWord Version: 0.18.3
Created at 6 days ago
issue comment
Make methods strongly typed instead of using string input parameters

This looks like a super interesting thing PR. Would you be willing to rebase on develop ?

My plan would be to merge this, and release as a major version, and do nothing to help migration (!). The community might come up with a Rector rule for that...

Created at 6 days ago