Bug: Migration Reporting does not work

Summary

Reporting Issues are not created due to wrong matching between staged projects and migration results.

Background

There is a feature to create sign-off Issues in the destination instance for each project. See here.

I wanted to make that available also for direct transfer, as it is currently only available for cli based migrations (export/import), see #1384.

There I realized, that the feature is currently broken and does not work for cli either.

Analysis

The log is showing

[20 Nov 2025 10:15:55][INFO]|base_migrate.check_reporting_requirements:100| Successfully got reporting config from congregate.conf. Proceeding to make our issues.
[20 Nov 2025 10:15:55][WARNING]|reporting.create_users_map_from_data:336| 
                    Unable to add user to map due to malformed project found.
                    Check project_migration_results.json or staged_projects.json
                
[20 Nov 2025 10:15:56][WARNING]|reporting.create_issues_from_data:234| Malformed project data for project 'None'. Skipping.
[20 Nov 2025 10:15:56][INFO]|api.list_all:326| Total count for http://gitlab-dest:80 endpoint projects/1/issues: 0

In the code we can see, that the migration result is being matched with the staged projects: https://gitlab.com/gitlab-org/professional-services-automation/tools/migration/congregate/-/blob/master/congregate/helpers/reporting.py?ref_type=heads#L193

clean_data['projects'] = self.check_import_results(import_results)

reads the result file, reads the entries of the list, splits them at \ (so the project path remains) and puts them in a dict (with None Value)

so it basically converts "vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz" to "gitlab-testbcilbsbuznuilfppjlnz"

then the next function https://gitlab.com/gitlab-org/professional-services-automation/tools/migration/congregate/-/blob/master/congregate/helpers/reporting.py?ref_type=heads#L196 takes these and tries to match them with the project NAMES from the staged projects, which fails as the first function gets the paths.

migration result:

[
    {
        "vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz": {
            "id": 7,
            "shared_with_groups": true,
            "environments": null,
            "cicd_variables": true,
            "pipeline_schedule_variables": true,
            "deploy_keys": true,
            "package_registry": [],
            "terraform_states": {
                "total_states": 0,
                "successful_migrations": 0,
                "failed_migrations": 0,
                "migrated_states": [],
                "failed_states": []
            },
            "project_hooks": true,
            "project_feature_flags_users_lists": null,
            "project_feature_flags": true,
            "src_id": 6,
            "src_path": "vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz",
            "src_url": "http://gitlab-src.local/vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz.git"
        }
    },
    {
        "Total": 1,
        "Successful": 1
    }
]

staged projects:

[
    {
        "id": 6,
        "name": "Gitlab TestBCILBSbUZnuiLfppJlnz",
        "namespace": "vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx",
        "path": "gitlab-testbcilbsbuznuilfppjlnz",
        "path_with_namespace": "vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz",
        "visibility": "private",
        "description": "zKJhYdJerlWAfJtiIAnz",
        "jobs_enabled": true,
        "packages_enabled": true,
        "project_type": "group",
        "members": [],
        "http_url_to_repo": "http://gitlab-src.local/vAxAyQFINtVtBgxeyTCr/MZkanOvRqVxYuaWMLSEx/gitlab-testbcilbsbuznuilfppjlnz.git",
        "shared_runners_enabled": true,
        "archived": false,
        "shared_with_groups": [],
        "default_branch": "master"
    }
]

Fix

it works when using the path instead of the name from staged projects

I will provide a MR