Track gitea and github self hosted events

What does this MR do and why?

Adds source_hosting ('cloud' vs 'self_hosted') to the five project import lifecycle internal events for GitHub and Gitea imports:

  • start_project_import
  • finish_project_import
  • fail_project_import
  • cancel_project_import
  • timeout_project_import

This lets us distinguish SaaS (github.com, gitea.com) from self-hosted (GitHub Enterprise, self-hosted Gitea) migrations when analysing import volumes.

Implementation

  • Project#source_hosting returns 'cloud' / 'self_hosted' for github/gitea imports, nil otherwise. It reuses the existing Project#github_enterprise_import? and a new Project#gitea_self_hosted_import? (mirrors the GitHub helper, compares against gitea.com).
  • ProjectImportState#track_project_import_event includes source_hosting in additional_properties; the existing .compact drops it for other importers.
  • Each of the five event YAMLs declares the new source_hosting additional property.

Scope

How to validate locally

  1. Enable Snowplow Micro:
gdk config set snowplow_micro.enabled true
gdk reconfigure
gdk restart
  1. Monitor http://gdk.test:9091/micro/good.
  2. Trigger a GitHub or Gitea import (cloud and self-hosted). Confirm each of the five *_project_import events carries source_hosting: cloud or source_hosting: self_hosted, and that other importers (e.g. Bitbucket) do not carry the field.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #627874 (closed)

Merge request reports

Loading
Loading