Draft: Adds backfill for Ci Catalog on project
What does this MR do and why?
Backfills the ci_catalog
and readme_content
fields for Project
Screenshots or screen recordings
Coming soon to a screen near you
How to set up and validate locally
Using a project that has readme content, do the following in rails c
:
project = Project.find(23)
client = Gitlab::Search::Client.new
client.update(index: Project.__elasticsearch__.index_name, id: project.es_id,
body: { doc: { readme_content: project.repository.readme&.data } })
This will update the readme_content
for that project.
Verify that the project shows up in the search:
# where `readme content` is the search query
Gitlab::Elastic::SearchResults.new(user, 'readme content', Project.pluck(:id)).objects('projects')
=> [#<Project id:23 root/ci-componentss>>]
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.
Resolves: #411609 (closed)
Edited by Laura Montemayor