github / github/gh-gei

reclaim-mannequin: CLI rejects valid mannequin due to login string mismatch

Open
#1,586 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
478
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
2

Description

## Summary

`reclaim-mannequin` fails with "User is not a mannequin" even when the GraphQL API successfully returns the mannequin. This affects both email and login-based lookups.

## Reproduction

**Environment:** `ado2gh` CLI v1.29.0 (also confirmed on v1.28.0)
**Org:** EMU enterprise org (geico-private)
**Mannequin:** `IaHamilton` (ID: `M_kgDOEDFJQQ`)

### Attempt 1 — Using email

```
gh ado2gh reclaim-mannequin --github-org geico-private \
--mannequin-user "IaHamilton@geico.com" \
--mannequin-id "M_kgDOEDFJQQ" \
--target-user "IaHamilton_geico"
```

The CLI queries the mannequins GraphQL API with `login: "IaHamilton@geico.com"` and the API **successfully returns** the mannequin:

```json
{"data":{"node":{"mannequins":{"nodes":[{"login":"IaHamilton","id":"M_kgDOEDFJQQ","claimant":null}]}}}}
```

But the CLI then throws:

```
[ERROR] User IaHamilton@geico.com is not a mannequin.
```

**Root cause:** The CLI compares the input string (`IaHamilton@geico.com`) against the returned mannequin login (`IaHamilton`). They do not match, so `ReclaimService.ReclaimMannequin` rejects it despite the API having found the mannequin.

### Attempt 2 — Using login

```
gh ado2gh reclaim-mannequin --github-org geico-private \
--mannequin-user "IaHamilton" \
--mannequin-id "M_kgDOEDFJQQ" \
--target-user "IaHamilton_geico"
```

The CLI queries with `login: "IaHamilton"` and the API returns **empty results**:

```json
{"data":{"node":{"mannequins":{"nodes":[]}}}}
```

This suggests the mannequin API `login` filter matches on the source identity (email) rather than the display login.

**Result:** Neither email nor login works for individual reclaim commands.

## Expected behavior

The CLI should successfully reclaim the mannequin when the API returns a valid match. The validation should use the mannequin ID from the API response rather than re-validating via string comparison against the input.

## Workaround

CSV-based reclaim using mannequin IDs works:

```
gh ado2gh reclaim-mannequin --github-org geico-private --csv mannequins.csv
```

## Impact

This is blocking active migrations for customers who need CLI-based mannequin reclaim. The UI reclaim works for individual mannequins but is not feasible at scale.

## Source

Zendesk ticket 4404972

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.