Index project access levels as PRIVATE when missing project_feature
What does this MR do and why?
I kept running into indexing errors in gdk after reseeding my database. I narrowed it down to the GitLab Instance / Monitoring
project (which is created without a project_feature
record). I decided to refactor the project_feature
indexing code and just set everything to private if the project_feature is null and updated the specs.
Screenshots or screen recordings
N/A
How to set up and validate locally
I'm not sure if this is a reliable way to reproduce because the self monitoring project doesn't always fail to index:
- re-seed your database
- make sure gdk is enabled for elasticsearch and that advanced search is enabled for search/indexing
- run
rake gitlab:elastic:index
to create the index from scratch
another way to reproduce this is:
- find a project with a null project_feature (or delete the record for an existing project)
- in rails console call the
as_indexed_json
method:Project.find(19).__elasticsearch__.as_indexed_json
- verify it does not throw an error and sets all of the
*_access_level
keys to PRIVATE (10)
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.
Edited by Terri Chu