プラグインの投稿後投票が、以前の質問回答プラグインと競合しています

Hey there !

Big conflict on my Discourse since the change…

  1. Before i had :
- git clone https://github.com/discourse/discourse-question-answer
  1. Today i wanted to add :
- git clone https://github.com/discourse/discourse-question-answer
- git clone https://github.com/discourse/discourse-post-voting

I obtained a conflict between the two :

Summary
I, [2022-12-09T10:13:26.139287 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
/var/www/discourse/plugins/discourse-question-answer/lib/question_answer/engine.rb:4: warning: already initialized constant QuestionAnswer::CREATE_AS_QA_DEFAULT
/var/www/discourse/plugins/discourse-post-voting/lib/question_answer/engine.rb:4: warning: previous definition of CREATE_AS_QA_DEFAULT was here
/var/www/discourse/plugins/discourse-question-answer/app/controllers/question_answer/votes_controller.rb:75: warning: already initialized constant QuestionAnswer::VotesController::VOTERS_LIMIT
/var/www/discourse/plugins/discourse-post-voting/app/controllers/question_answer/votes_controller.rb:75: warning: previous definition of VOTERS_LIMIT was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_vote.rb:7: warning: already initialized constant QuestionAnswerVote::VOTABLE_TYPES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_vote.rb:7: warning: previous definition of VOTABLE_TYPES was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:7: warning: already initialized constant QuestionAnswerComment::COOKED_VERSION
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:7: warning: previous definition of COOKED_VERSION was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:26: warning: already initialized constant QuestionAnswerComment::MARKDOWN_FEATURES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:26: warning: previous definition of MARKDOWN_FEATURES was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:31: warning: already initialized constant QuestionAnswerComment::MARKDOWN_IT_RULES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:31: warning: previous definition of MARKDOWN_IT_RULES was here
/var/www/discourse/plugins/discourse-question-answer/extensions/topic_extension.rb:9: warning: already initialized constant Topic::QA_SUBTYPE
/var/www/discourse/plugins/discourse-post-voting/extensions/topic_extension.rb:9: warning: previous definition of QA_SUBTYPE was here
rake aborted!
ArgumentError: Invalid route name, already in use: 'question_answer' 
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here: 
https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:587:in `add_route'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1986:in `add_route'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1957:in `decomposed_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1921:in `block in map_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1915:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1915:in `map_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1663:in `match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:642:in `mount'
/var/www/discourse/plugins/discourse-question-answer/config/routes.rb:16:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:427:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:427:in `eval_block'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `block in finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:51:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:51:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:22:in `reload!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:35:in `block in updater'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/file_update_checker.rb:83:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:10:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:195:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:391:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:88:in `register'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:367:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2022-12-09T10:13:36.170591 #1]  INFO -- : gem install rrule -v 0.4.4 -i /var/www/discourse/plugins/discourse-calendar/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed rrule-0.4.4
1 gem installed



FAILED
--------------------
  1. Then i removed the first one. Build is ok but the app is no longer running :
    • I got an HTTP 500
    • nginx error logs give me something like :
    root@slazvmeutp01:/opt/discourse# cat /var/opt/discourse/var-log/nginx/error.log
    2022/12/09 10:47:34 [notice] 537#537: signal process started
    2022/12/09 10:47:37 [error] 554#554: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 18.156.156.214, server: _, request: "POST /message-bus/76e1bd78eedf43a5a337b6f44a8b88d0/poll?dlp=t HTTP/2.0", upstream: "http://127.0.0.1:3000/message-bus/76e1bd78eedf43a5a337b6f44a8b88d0/poll?dlp=t", host: "mydiscourse.domain.com", referrer: "https://mydiscourse.domain.com/admin/plugins"
    2022/12/09 10:59:08 [crit] 554#554: *398 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 212.102.40.218, server: 0.0.0.0:443
    2022/12/09 11:25:50 [notice] 530#530: signal process started
    

I noticed that Git repo https://github.com/discourse/discourse-question-answer now redirects to the second https://github.com/discourse/discourse-post-voting.
So it would explain the conflict on first build today.
But what about now ? It mentions TLS error rather than a plugin error…

Any idea ?

「いいね!」 1

discourse-post-voting だけを持つのが正しい動きです。:+1:

nginxのエラーログについてはよくわかりませんが、discourse-feature-voting もプラグインに入っているということはないですよね?

「いいね!」 2

OMG、あなたの言う通りでした!
私もそれを持っていて、Gitリポジトリもhttps://github.com/discourse/discourse-post-votingにリダイレクトされるのがわかります!! :scream_cat:

しかし、待ってください… topic-votingとq&aがpost-votingにマージされたのですか?機能は累積されるのでしょうか?

これが私の最新のプラグインリストです:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-openid-connect
          - git clone https://github.com/discourse/discourse-solved
          - git clone https://github.com/discourse/discourse-yearly-review
          - git clone https://github.com/discourse/discourse-checklist
          - git clone https://github.com/discourse/discourse-docs
          - git clone https://github.com/discourse/discourse-reactions
            #- git clone https://github.com/discourse/discourse-feature-voting
          - git clone https://github.com/discourse/discourse-calendar
            #- git clone https://github.com/discourse/discourse-gamification
          - git clone https://github.com/discourse/discourse-gamification && cd discourse-gamification && git checkout 6a399b4c220f31de62049504d27ff6e50611fbef
          - git clone https://github.com/discourse/discourse-follow
          - git clone https://github.com/discourse/discourse-spoiler-alert
          - git clone https://github.com/paviliondev/discourse-news
          - git clone https://github.com/cfstras/discourse-konami.git
            #- git clone https://github.com/discourse/discourse-question-answer
          - git clone https://github.com/discourse/discourse-post-voting

Discourseがついに応答しました。
しかし、今度は他の問題が発生しました:

  1. プラグイン管理者は「質問と回答」を表示します…
    image
  2. トピックを作成すると、メニュー項目が正しくありません:
  3. カテゴリ設定の設定は常にq&aを表示します
    image

どうやらq&aは常に存在しているようです…

「いいね!」 1

いいえ、私が間違っていました!
これらは別々のプロジェクトです。申し訳ありません。

「いいね!」 2

discourse-feature-votingDiscourse Topic Voting の古い名前であり、古い名前がそこに含まれていると、post-voting も含まれている場合にロードの競合が発生します。新しい discourse-topic-voting を追加すると、両方を再度使用できるようになります。:+1:

なぜ古いQ&A形式がまだ残っているのか分かりません。特定のGamificationバージョンを確認しているようですが、それは特定の互換性に制限されているからでしょうか?

「いいね!」 1

はい!
私はDiscourseの「stable」バージョンを追跡しています :sweat_smile:
これは私がここで言及した回避策です : Database migrate fails in "stable" version - #2 by gmoirod

わかりました、今テストしてみます。

私もです :sob:

「いいね!」 1

公式の post-voting プラグインは最近「post-voting」にリネームされ、UIなどがしばらくQ&Aになっていました。おそらく、お使いのインストール環境がStableを追跡しているため、これらの変更を認識できていないのかもしれません。

「いいね!」 1

プラグインを適切に「アンインストール」する方法はありますか?
q&aとpost-votingをアンインストールしてから、post-votingを再インストールするために使用できます…

「いいね!」 1

/admin/upgrade ページを確認した際、post-voting の横に表示されるバージョン番号は何ですか?

私のテストが成功し、最新の状態になっているものは次のとおりです: 5ea4dccf

編集: ページのアドレスを修正しました :slight_smile:

「いいね!」 1

Seems ok to have topic-voting now.

I do not have a /plugins page :thinking:
But on the /admin/upgrade page I got :

  1. post-voting がない
  2. q&a が緑のチェックなしで表示される
「いいね!」 1

September の質問と回答形式だった頃のこのコミットでロックされているようです。

Stable バージョンに更新されていますか?現在どのバージョンを使用していますか?

「いいね!」 1


うまくいっているようです。



新しい問題が発生しました…

  1. post-votingとtopic-votingを削除し、クリーンな状態から始めようとしてアプリを再構築しました(q&aも何度も試しましたがリストに表示されません):OK、プラグインはもうありません
  2. post-votingとtopic-votingを元に戻したところ、再構築が失敗しました…
概要
I, [2022-12-09T14:27:32.724323 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle exec rake themes:update assets:precompile'
'Discourse Loading Slider' の更新に失敗しました: Timeout::Error
rake aborted!
Timeout::Error: Timeout::Error
/var/www/discourse/lib/final_destination/resolver.rb:28:in `block in lookup'
/var/www/discourse/lib/final_destination/resolver.rb:7:in `synchronize'
/var/www/discourse/lib/final_destination/resolver.rb:7:in `lookup'
/var/www/discourse/lib/final_destination/ssrf_detector.rb:84:in `lookup_ips'
/var/www/discourse/lib/final_destination/ssrf_detector.rb:64:in `lookup_and_filter_ips'
/var/www/discourse/lib/theme_store/git_importer.rb:139:in `block in clone_http!'
/var/www/discourse/lib/theme_store/git_importer.rb:131:in `each'
/var/www/discourse/lib/theme_store/git_importer.rb:131:in `clone_http!'
/var/www/discourse/lib/theme_store/git_importer.rb:93:in `clone!'
/var/www/discourse/lib/theme_store/git_importer.rb:18:in `import!'
/var/www/discourse/app/models/remote_theme.rb:126:in `update_remote_version'
/var/www/discourse/lib/tasks/themes.rake:62:in `block in update_themes'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block (2 levels) in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `loop'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:137:in `find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:70:in `find_each'
/var/www/discourse/lib/tasks/themes.rake:56:in `update_themes'
/var/www/discourse/lib/tasks/themes.rake:87:in `block (2 levels) in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:90:in `each_connection'
/var/www/discourse/lib/tasks/themes.rake:86:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => themes:update
(See full trace by running task with --trace)
I, [2022-12-09T14:27:49.987988 #1]  INFO -- : 'Modern Category + Group Boxes' for 'default'... up to date
'Dark-Light Toggle' for 'default'... updating from cd221006 to 3f72c88f
'Discourse Loading Slider' for 'default'... 

FAILED
--------------------
「いいね!」 1

もう一度再構築したら、うまくいきました。
したがって、'Discourse Loading Slider' の最後の問題は単なる不具合でした。
それは忘れてください。

私の主な問題は、投稿投票の代わりに質疑応答が残っていることです。

「いいね!」 2

お使いのビルドと互換性の問題が原因である可能性があります。ページに表示されている discourse-topic-voting が、まだ discourse-voting となっている点もご確認ください。

「いいね!」 1

「tests-passed」バージョンのディスコースを使用すればよいということですか?

「いいね!」 1

最新バージョンをご希望の場合 :slightly_smiling_face:

「いいね!」 1

実際には「動作する」バージョンの方がいいのですが :sweat_smile:
「テストに合格した」ものがすぐに使えるというバージョンに関するトピックがあることは知っています。
でも、私は「Debian guy」のようなものなので、本番環境では安定性を重視します!

「いいね!」 2

それも良い選択だと思います。:+1: :slightly_smiling_face: 裏を返せば、これらの最新アップデートをStableで利用するには、新年発売のバージョン3.0を待つ必要があるということです。

「いいね!」 1

わかりました…

プラグイン管理に、指定されたgit refをフォローする方法が提供されていないのは少し残念です。
そして、プラグインがDiscourseのライフサイクルに従うことです。
これにより、Discourseとプラグインの両方をグローバルに「安定版」でフォローできます。

実際、すべての再構築、またはプラグインの採用は、ルーレットのようになります。

「いいね!」 1

Stableブランチに関する私の知識はかなり限られていますが、それはあまり頻繁に変更を加えないように設計されていると思います。そのため、Stableリリースウィンドウ外での新しいプラグインや追加機能の追加は、それに反するのではないかと思いますか?

また、ほとんどのDiscourseサイトはtests-passedを使用しており、特に問題がないことも言っておく価値があります。tests-passedに従っても、毎日更新する必要があるわけではなく、最新バージョンである必要もありません。そのため、あなたが考えているほど頻繁に変更されるわけではありません。これらの変更をサイトに取り込むには、/upgradeページから手動で更新ボタンを押すか、再構築を実行する必要があります。

マネージドホスティングも、コミュニティに集中できるように、技術的なことはすべて処理してくれるため、このプロセスをより簡単にします。:+1:

「いいね!」 1