Log invalid realtions build during Gitlab Project/Group import
What does this MR do?
Some imports are failing without clear reasons. To bring some light on these errors, invalid relations will be logged. With these logs in place we'll be able to check what validations need to be disabled for the import process.
Related to:
Screenshots (strongly suggested)
Example
{"correlation_id":"d9cad86884f7881472d098b10d279d37","error_messages":"Source can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"ProjectMember","relation_index":3,"relation_key":"project_members","severity":"WARN","time":"2020-12-10T14:00:07.209Z"}
{"correlation_id":"d9cad86884f7881472d098b10d279d37","error_messages":"Note can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"Suggestion","relation_index":0,"relation_key":"suggestions","severity":"WARN","time":"2020-12-10T14:00:07.270Z"}
{"correlation_id":"d9cad86884f7881472d098b10d279d37","error_messages":"Exactly one of epic, issue, merge_request is required","message":"[Project/Group Import] Invalid object relation built","relation_class":"ResourceLabelEvent","relation_index":0,"relation_key":"resource_label_events","severity":"WARN","time":"2020-12-10T14:00:07.352Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Label can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"LabelPriority","relation_index":1,"relation_key":"priorities","severity":"WARN","time":"2020-12-10T14:02:15.333Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Label can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"LabelPriority","relation_index":0,"relation_key":"priorities","severity":"WARN","time":"2020-12-10T14:02:15.597Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Exactly one of epic, issue, merge_request is required","message":"[Project/Group Import] Invalid object relation built","relation_class":"ResourceLabelEvent","relation_index":0,"relation_key":"resource_label_events","severity":"WARN","time":"2020-12-10T14:02:15.643Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Issue must exist. Issue must associate the same project","message":"[Project/Group Import] Invalid object relation built","relation_class":"ZoomMeeting","relation_index":0,"relation_key":"zoom_meetings","severity":"WARN","time":"2020-12-10T14:02:17.123Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Issue can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"SentryIssue","relation_index":0,"relation_key":"sentry_issue","severity":"WARN","time":"2020-12-10T14:02:17.136Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Issue or Merge Request ID is required","message":"[Project/Group Import] Invalid object relation built","relation_class":"Timelog","relation_index":9,"relation_key":"timelogs","severity":"WARN","time":"2020-12-10T14:02:20.014Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Password can't be blank. Namespace name can't be blank. Name can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"User","relation_index":0,"relation_key":"user","severity":"WARN","time":"2020-12-10T14:02:20.509Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Source can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"ProjectMember","relation_index":0,"relation_key":"project_members","severity":"WARN","time":"2020-12-10T14:02:20.517Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Password can't be blank. Namespace name can't be blank. Name can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"User","relation_index":1,"relation_key":"user","severity":"WARN","time":"2020-12-10T14:02:20.556Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Source can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"ProjectMember","relation_index":1,"relation_key":"project_members","severity":"WARN","time":"2020-12-10T14:02:20.559Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Password can't be blank. Namespace name can't be blank. Name can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"User","relation_index":2,"relation_key":"user","severity":"WARN","time":"2020-12-10T14:02:20.600Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Source can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"ProjectMember","relation_index":2,"relation_key":"project_members","severity":"WARN","time":"2020-12-10T14:02:20.602Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Password can't be blank. Namespace name can't be blank. Name can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"User","relation_index":3,"relation_key":"user","severity":"WARN","time":"2020-12-10T14:02:20.640Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Source can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"ProjectMember","relation_index":3,"relation_key":"project_members","severity":"WARN","time":"2020-12-10T14:02:20.642Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Note can't be blank","message":"[Project/Group Import] Invalid object relation built","relation_class":"Suggestion","relation_index":0,"relation_key":"suggestions","severity":"WARN","time":"2020-12-10T14:02:20.713Z"}
{"correlation_id":"78d352df1991e45ff54e16f44242f91c","error_messages":"Exactly one of epic, issue, merge_request is required","message":"[Project/Group Import] Invalid object relation built","relation_class":"ResourceLabelEvent","relation_index":0,"relation_key":"resource_label_events","severity":"WARN","time":"2020-12-10T14:02:20.868Z"}
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Kassio Borges