Add FeiShu Integration foundation
THIS FEATURE IS IN JH GITLAB ONLY
JH issue link, https://jihulab.com/gitlab-cn/gitlab/-/issues/473, JH MR: https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/640
app/views/admin/application_settings/general.html.haml
use for root admin to turn on/off feishu integration
spec/lib/gitlab/import_export/all_models.yml
add model Integrations::FeiShu which breaks import/export spec, add this to make it pass
app/models/integrations/base_chat_notification.rb
In Integration::Feishu
(introduced by JH GitLab), similar like Integration::Slack
, inherit from Integration::BaseChatNotification
, however it didn't need webhook
field, because the FeiShu endpoint is fixed endpoint, so we skip it on webpage. So in Integration::BaseChatNotification
I extract two methods related with webhook
field, to allow JH override them in Integration::Feishu
.
Migration outout logs
$ scripts/db_tasks db:migrate:down VERSION=20220627061008
main: == 20220627061008 AddFeiShuIntegration: reverting =============================
main: -- remove_column(:application_settings, :encrypted_feishu_app_secret_iv, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0044s
main: -- remove_column(:application_settings, :encrypted_feishu_app_secret, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0011s
main: -- remove_column(:application_settings, :encrypted_feishu_app_key_iv, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0011s
main: -- remove_column(:application_settings, :encrypted_feishu_app_key, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0011s
main: -- remove_column(:application_settings, :feishu_integration_enabled, :boolean, {:null=>false, :default=>false, :comment=>"JiHu-specific column"})
main: -> 0.0015s
main: == 20220627061008 AddFeiShuIntegration: reverted (0.0152s) ====================
$ scripts/db_tasks db:schema:dump
$ git diff master -- db/structure.sql
$ scripts/db_tasks db:migrate
main: == 20220627061008 AddFeiShuIntegration: migrating =============================
main: -- add_column(:application_settings, :feishu_integration_enabled, :boolean, {:null=>false, :default=>false, :comment=>"JiHu-specific column"})
main: -> 0.0051s
main: -- add_column(:application_settings, :encrypted_feishu_app_key, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0017s
main: -- add_column(:application_settings, :encrypted_feishu_app_key_iv, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0016s
main: -- add_column(:application_settings, :encrypted_feishu_app_secret, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0016s
main: -- add_column(:application_settings, :encrypted_feishu_app_secret_iv, :binary, {:comment=>"JiHu-specific column"})
main: -> 0.0025s
main: == 20220627061008 AddFeiShuIntegration: migrated (0.0136s) ====================
/cc @daveliu
Edited by MAO Chao