Handle null owner when indexing projects
What does this MR do and why?
context (internal): #428079 (comment 1832554037)
Some project records do not have an owner set. This is causing failures during indexing those records into Elasticsearch in the ProjectInstanceProxy
.
undefined method `id' for nil:NilClass data['owner_id'] = target.owner.id ^^^
This MR handles null owner when indexing projects and adds a spec to check it
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
N/A
How to set up and validate locally
I used specs because I am trying to get this fix in quickly. I'm not sure how to create a project without an owner but ideally you could verify by:
- create project without an owner (or manually cause owner to return nil)
- call
project.as_indexed_json
method and verify it does not throw an error
Merge request reports
Activity
assigned to @terrichu
Reviewer roulette
Category Reviewer Maintainer backend @jhyson
(UTC+13, 17 hours ahead of author)
@eugielimpin
(UTC+8, 12 hours ahead of author)
Please check reviewer's status!
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangerchanged milestone to %16.11
added groupglobal search label
added devopsdata stores sectioncore platform labels
- Resolved by Dmitry Gruzd
@sdungarwal would you mind the initial backend review? I didn't see any other errors in the logs but wanted another set of
Can you send to@dgruzd
or@maddievn
for maintainer?
requested review from @sdungarwal
mentioned in issue #428079 (closed)
added pipeline:mr-approved label
- Resolved by Dmitry Gruzd
@sdungarwal
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
requested review from @dgruzd and removed review request for @sdungarwal
added workflowin review label
enabled an automatic merge when the pipeline for 09155f39 succeeds
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 059908f5expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Create | 77 | 0 | 9 | 0 | 86 | ✅ | | Monitor | 7 | 0 | 0 | 0 | 7 | ✅ | | Verify | 35 | 0 | 1 | 0 | 36 | ✅ | | Plan | 51 | 0 | 2 | 0 | 53 | ✅ | | Data Stores | 31 | 0 | 0 | 0 | 31 | ✅ | | Govern | 62 | 0 | 4 | 0 | 66 | ✅ | | Package | 23 | 0 | 6 | 0 | 29 | ✅ | | Release | 5 | 0 | 0 | 0 | 5 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 293 | 0 | 23 | 0 | 316 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for 059908f5expand test summary
+---------------------------------------------------------------------+ | suites summary | +----------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +----------------+--------+--------+---------+-------+-------+--------+ | Create | 564 | 0 | 74 | 10 | 638 | ✅ | | Govern | 257 | 0 | 31 | 0 | 288 | ✅ | | Package | 205 | 0 | 37 | 18 | 242 | ✅ | | Manage | 39 | 0 | 11 | 0 | 50 | ✅ | | Systems | 10 | 0 | 0 | 0 | 10 | ✅ | | Plan | 245 | 0 | 19 | 0 | 264 | ✅ | | Monitor | 32 | 0 | 13 | 0 | 45 | ✅ | | GitLab Metrics | 2 | 0 | 1 | 0 | 3 | ✅ | | Data Stores | 117 | 0 | 28 | 0 | 145 | ✅ | | Fulfillment | 8 | 0 | 75 | 1 | 83 | ✅ | | Analytics | 7 | 0 | 0 | 0 | 7 | ✅ | | Verify | 147 | 0 | 30 | 3 | 177 | ✅ | | Configure | 1 | 0 | 9 | 0 | 10 | ✅ | | Release | 15 | 0 | 3 | 0 | 18 | ✅ | | Secure | 6 | 0 | 3 | 0 | 9 | ✅ | | ModelOps | 0 | 0 | 3 | 0 | 3 | ➖ | | Ai-powered | 0 | 0 | 3 | 0 | 3 | ➖ | | Growth | 0 | 0 | 6 | 0 | 6 | ➖ | +----------------+--------+--------+---------+-------+-------+--------+ | Total | 1655 | 0 | 346 | 32 | 2001 | ✅ | +----------------+--------+--------+---------+-------+-------+--------+
mentioned in commit c8d5e0e2
added workflowstaging-canary label and removed workflowin review label
added workflowcanary label and removed workflowstaging-canary label
mentioned in merge request gitlab-com/runbooks!7025 (merged)
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
picked the changes into the branch
cherry-pick-c8d5e0e2
with commit 79f2bc5cmentioned in commit 79f2bc5c
mentioned in merge request !148417 (merged)
added severity3 label
added releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!2945 (merged)
added releasedpublished label and removed releasedcandidate label
added pipelinetier-3 label