Skip to content

Conversation

@BagToad
Copy link
Member

@BagToad BagToad commented Nov 7, 2025

Updated AddPullRequestReviews and RemovePullRequestReviews to send empty arrays instead of null values for reviewers and team_reviewers when no users or teams are specified, as required by the API.

Fixes #12120

Updated AddPullRequestReviews and RemovePullRequestReviews to send empty arrays instead of null values for reviewers and team_reviewers when no users or teams are specified, as required by the API.
Copilot AI review requested due to automatic review settings November 7, 2025 21:00
@BagToad BagToad requested a review from a team as a code owner November 7, 2025 21:00
@BagToad BagToad requested a review from babakks November 7, 2025 21:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR attempts to fix an issue where the GitHub API requires empty arrays instead of null values for the reviewers and team_reviewers fields when adding or removing pull request reviewers. The changes remove the omitempty JSON tags and add logic to initialize nil slices to empty arrays.

Key Changes:

  • Removed omitempty from JSON struct tags for Reviewers and TeamReviewers fields
  • Added empty array initialization logic for nil users and teams slices
  • Applied changes to both AddPullRequestReviews and RemovePullRequestReviews functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@babakks babakks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a nitpick comment.

@BagToad BagToad merged commit 85d6766 into trunk Nov 10, 2025
11 checks passed
@BagToad BagToad deleted the kw/fix-always-send-reviewer-array branch November 10, 2025 18:26
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 14, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://github.com/cli/cli) | patch | `v2.83.0` -> `v2.83.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.83.1`](https://github.com/cli/cli/releases/tag/v2.83.1): GitHub CLI 2.83.1

[Compare Source](cli/cli@v2.83.0...v2.83.1)

#### What's Changed

##### 🐛 Fixes

- `gh pr edit`: Ensure empty arrays for reviewers in MR API calls by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12122](cli/cli#12122)

##### 📚 Docs & Chores

- Integrate license checks back into lint workflow by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12112](cli/cli#12112)
- Update third-party licenses and dependencies by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12123](cli/cli#12123)

##### :dependabot: Dependencies

- chore(deps): bump golangci/golangci-lint-action from 8.0.0 to 9.0.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12134](cli/cli#12134)

**Full Changelog**: <cli/cli@v2.83.0...v2.83.1>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
BGovertime

This comment was marked as spam.

BGovertime

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to remove team reviewer without specifying regular logins at the same time

4 participants