Commit 881a935
committed
fix(auth): fix connectionData 400 + resolve_reviewer_id for non-creator PRs
Two fixes:
1. connectionData API returns 400 when called with api-version=7.1.
Added Client.get_raw_no_version/2 that builds the URL without
the api-version query parameter. connectionData now returns
the authenticated user's GUID correctly.
2. resolve_reviewer_id now uses a two-tier approach:
a) Match current_user_id() against the reviewer list's
identity.id (handles PRs where the user was explicitly
added as a reviewer)
b) Fall back to createdBy.id (handles PRs the user created
themselves)
This covers both common scenarios: PRs you created, and PRs you
were added to as a reviewer. For PRs where you're neither the
creator nor a reviewer, the error message suggests adding
yourself via the browser first.
Verified against live Azure DevOps:
ado prs approve 'Employee Management' 'Employee Management' 1
-> Voted +10 (approved) on PR #1.
325 tests pass, 0 warnings, credo clean.1 parent b0cb68a commit 881a935
3 files changed
Lines changed: 49 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1091 | 1088 | | |
1092 | 1089 | | |
1093 | 1090 | | |
1094 | | - | |
1095 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1096 | 1113 | | |
1097 | 1114 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
| 1115 | + | |
1102 | 1116 | | |
1103 | 1117 | | |
1104 | 1118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
83 | 104 | | |
84 | 105 | | |
85 | 106 | | |
| |||
0 commit comments