Add permission for indexed notes and update when permissions change
requested to merge 300351-remove-joins-from-the-elasticsearch-query-for-project-group-scoped-notes-comments-search-3 into master
What does this MR do?
Related to #300351 (closed)
Re-adding the new permission fields to the Notes document for indexing. Including all updates that must occur to notes documents if the permissions are updated.
- Original MR: !52837 (merged)
- Revert MR: !53388 (merged)
- Incident Issue: gitlab-com/gl-infra/production#3509 (closed)
Changes from that MR:
- split work into three MRs:
- this one with new data fields for indexing
- a migration to cleanup permission data from the previous migration attempt: !53525 (merged)
- a migration to back fill the permission data !53406 (merged)
- Use
noteable
object to determine what project feature access_level is required. Sometimes thenoteable_id
field is null so I added a spec to make sure it handles that case. - Add new specs + refactor existing specs
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Terri Chu