Fix bug of integration render?
What does this MR do and why?
Bug issue: #3853 (closed)
Bug related code:
- https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82616/diffs#8d898265545b598c2274ca22019bcf49db4a52b2_0_9
- https://jihulab.com/gitlab-cn/gitlab/-/blob/f3ccc55369b0163d6b2d1d77dec0b7e40a116d6b/app/services/bulk_create_integration_service.rb#L33-33
Each Project
Object has one ProjectSetting
Object,
which contains some cache fields, such as has_confluence
has_shimo
.
Both Shimo
and Confluence
inherit from BaseThirdPartyWiki
, there is after_commit
ActiveRecord hook to update has_xxx
cache fields .
However, this hook will be skipped, causing the cached fields on the ProjectSetting to not be updated correctly when updating the group integration config
(through BulkCreateIntegrationService
and BulkUpdateIntegrationService
).
after_commit
method:
- Direct from MaoChao's Commit: https://gitlab.com/gitlab-org/gitlab/-/commit/ffc0924b34a4f
- Original from Luke's Commit: https://gitlab.com/gitlab-org/gitlab/-/commit/7273d66765093
How to fix on JH
Ignore the inaccurate field of ProjectSetting and directly take the status of Integration.
Screenshots or screen recordings
groups and projects | integrations table |
---|---|
How to set up and validate locally
- Create groups and projects
└── root-group
├── proj-1
└── sub-group
└── proj-2
- Create shimo integration for root-group, active
- Check shimo in sub projects
- Inactive shimo integration for root-group
- Check shimo in sub projects
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.