Show warning when running VSA seed on broken repo
What does this MR do and why?
This MR addresses the rarely occurring VSA seeding error mentioned in: #373523 (closed)
Problem: When we seed a project without git repository the seed script errors out. Creating an MR requires a functioning repository.
Fixes:
- When a project doesn't have a repository, show a warning to the user.
- When the
VSA_SEED_PROJECT_ID
parameter is not set, create a project with repository. (this how we ended up "broken" project records without repository) - Additionally: fix possible nil values for
issue
andmerge_request
metrics
records.
How to test it
- Create a project via FactoryBot:
FactoryBot.create(:project).id
- Use the id to seed VSA:
VSA_SEED_PROJECT_ID=1 SEED_CYCLE_ANALYTICS=true SEED_VSA=true FILTER=cycle_analytics rake db:seed_fu
- You should see a warning message.
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.
Related to #373523 (closed)
Edited by Adam Hegyi