-
Dylan Griffith authored
Since `system` notes have different permissions to normal notes on issues we do not want to include them in the ElasticSearch index. The reason being that the authorization logic we have in place for searching for notes is only accounting for the non-system notes. We have been under the impression that `system` notes have not been getting indexed already because we were filtering them out in 2 different places already: 1. When new notes are created https://gitlab.com/gitlab-org/gitlab/blob/2b607f0916c880a6c947ebfe4f4ee32f43fba551/ee/app/models/concerns/elastic/application_versioned_search.rb#L37 2. When indexing a whole project https://gitlab.com/gitlab-org/gitlab/blob/2b607f0916c880a6c947ebfe4f4ee32f43fba551/ee/app/models/concerns/elastic/projects_search.rb#L29 But there is a 3rd way in which notes get updated in the index which was added in https://gitlab.com/gitlab-org/gitlab/commit/db6a45ec17b2d165e85979dd7357e967d4346faa . This is triggered when some auth related settings of an Issue are updated as this changes who will be able to read notes in the issue so it is updating all the notes for that issue. This third piece of logic was now inserting all the system notes and should have been skipping them like all other places where notes are added. Also ignore Rubocop since this was like this before and we're fixing a security vulnerability.
ab14e1a8