Skip to content

Improve Import/Export logs

What does this MR do and why?

Add logs to the project and group export process in order to help us debug issues.

These logs should add more content when things go wrong.

List of improvements:

  1. Logs when the export starts
  2. Logs when each relation starts to be exported
  3. Logs the number of relations to export when it involves multiple relations
  4. Renames the prefix of the exception's attributes. Renamed from exportable_ to project_ or group_

Related to: #366411 (closed)

Screenshots or screen recordings

logs

Project export log example

"Project export started"
"Gitlab::ImportExport::VersionSaver saver started"
"Gitlab::ImportExport::AvatarSaver saver started"
"Gitlab::ImportExport::Project::TreeSaver saver started"
"Exporting root relation."
"Exporting labels relation. Number of records to export: 5"
"Exporting milestones relation. Number of records to export: 6"
"Exporting issues relation. Number of records to export: 27"
"Exporting snippets relation. Number of records to export: 0"
"Exporting releases relation. Number of records to export: 0"
"Exporting project_members relation. Number of records to export: 7"
"Exporting merge_requests relation. Number of records to export: 14"
"Exporting external_pull_requests relation. Number of records to export: 0"
"Exporting ci_pipelines relation. Number of records to export: 0"
"Exporting auto_devops relation"
"Exporting pipeline_schedules relation. Number of records to export: 0"
"Exporting container_expiration_policy relation"
"Exporting protected_branches relation. Number of records to export: 2"
"Exporting protected_tags relation. Number of records to export: 0"
"Exporting project_feature relation"
"Exporting custom_attributes relation. Number of records to export: 0"
"Exporting prometheus_metrics relation. Number of records to export: 0"
"Exporting project_badges relation. Number of records to export: 0"
"Exporting ci_cd_settings relation"
"Exporting error_tracking_setting relation"
"Exporting metrics_setting relation"
"Exporting boards relation. Number of records to export: 0"
"Exporting service_desk_setting relation"
"Exporting protected_environments relation. Number of records to export: 0"
"Exporting security_setting relation"
"Exporting push_rule relation"
"Gitlab::ImportExport::UploadsSaver saver started"
"Gitlab::ImportExport::RepoSaver saver started"
"Gitlab::ImportExport::WikiRepoSaver saver started"
"Gitlab::ImportExport::LfsSaver saver started"
"Gitlab::ImportExport::SnippetsRepoSaver saver started"
"Gitlab::ImportExport::DesignRepoSaver saver started"
"Export archive saved"
"Export archive uploaded"
"Project successfully exported"

Group export log example

"Group export started"
"Group export started"
"Gitlab::ImportExport::VersionSaver saver started"
"Gitlab::ImportExport::Group::TreeSaver saver started"
"Exporting root relation"
"Exporting milestones relation. Number of records to export: 0"
"Exporting badges relation. Number of records to export: 0"
"Exporting labels relation. Number of records to export: 10"
"Exporting boards relation. Number of records to export: 0"
"Exporting members relation. Number of records to export: 5"
"Exporting namespace_settings relation"
"Exporting epics relation. Number of records to export: 5"
"Gitlab::ImportExport::Group::GroupAndDescendantsRepoSaver saver started"
"Export archive saved"
"Export archive uploaded"
"Group Export succeeded"

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Project

  1. Open a project
  2. Go to Settings -> General -> Advanced -> Export project
  3. Check the log/exporter.log

Group

  1. Open a project
  2. Go to Settings -> General -> Advanced -> Export group
  3. Check the log/exporter.log

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rodrigo Tomonari

Merge request reports