[github] Fix 'fragment on Bot can't be spread' exceptions (IJPL-175710)

#IJPL-175710 Fixed

This is caused by `... on Bot` not being allowed for `PullRequestReviewers` before GitHub 3.11.

The newly added tests can confirm this mistake.

(cherry picked from commit 87015863c0c8c0cd581f98eeefa5ae45adad34e8)

IJ-CR-154633


(cherry picked from commit 93d7bbd449b714c9a2f35c04aaf8e7168d73afcf)

IJ-CR-154633

GitOrigin-RevId: bc130a8de2e50e0faca7e1c1e89ec5063fc2b3cb
This commit is contained in:
Chris Lemaire
2025-02-03 22:55:57 +01:00
committed by intellij-monorepo-bot
parent 19f631779c
commit 3135a1e828
16 changed files with 20 additions and 30 deletions

View File

@@ -1,13 +1,9 @@
fragment actor on Actor {
...actorInfo
... on User {
...userInfo
}
... on Bot {
...botInfo
}
... on Mannequin {
...mannequinInfo
}
... on EnterpriseUserAccount {
...enterpriseUserAccountInfo
}

View File

@@ -1,3 +0,0 @@
fragment botInfo on Bot {
...actorInfo
}

View File

@@ -1,4 +1,3 @@
fragment enterpriseUserAccountInfo on EnterpriseUserAccount {
...actorInfo
name
}

View File

@@ -4,6 +4,6 @@ fragment gitActorInfo on GitActor {
avatarUrl
date
user {
...userInfo
...user
}
}

View File

@@ -1,3 +0,0 @@
fragment mannequinInfo on Mannequin {
...actorInfo
}

View File

@@ -1,4 +1,3 @@
fragment organizationInfo on Organization {
...actorInfo
name
}

View File

@@ -17,7 +17,7 @@ fragment pullRequestInfoShort on PullRequest {
assignees(first: 100) {
nodes {
...userInfo
...user
}
}
labels(first: 100) {

View File

@@ -1,14 +1,13 @@
fragment pullRequestReviewer on RequestedReviewer {
... on Actor {
...actorInfo
}
... on User {
...userInfo
}
... on Team {
...teamInfo
}
... on Mannequin {
...mannequinInfo
}
... on Bot {
...botInfo
}
# For future enthusiasts: be careful with adding ... on Bot, as it's been added only in GHE 3.11
}

View File

@@ -1,6 +1,6 @@
fragment reaction on Reaction {
content
user {
...userInfo
...user
}
}

View File

@@ -0,0 +1,4 @@
fragment user on User {
...actorInfo
...userInfo
}

View File

@@ -1,4 +1,3 @@
fragment userInfo on User {
...actorInfo
name
}

View File

@@ -1,6 +1,6 @@
query($login: String!) {
user(login: $login) {
__typename
...userInfo
...user
}
}

View File

@@ -80,7 +80,7 @@ fragment assignedEvent on AssignedEvent {
}
createdAt
user {
...userInfo
...user
}
}
@@ -90,7 +90,7 @@ fragment unassignedEvent on UnassignedEvent {
}
createdAt
user {
...userInfo
...user
}
}

View File

@@ -4,7 +4,7 @@ package org.jetbrains.plugins.github.api.data
import com.intellij.collaboration.api.dto.GraphQLFragment
import org.jetbrains.plugins.github.api.data.pullrequest.GHPullRequestRequestedReviewer
@GraphQLFragment("/graphql/fragment/botInfo.graphql")
@GraphQLFragment("/graphql/fragment/actorInfo.graphql")
class GHBot(
id: String,
override val login: String,

View File

@@ -4,7 +4,7 @@ package org.jetbrains.plugins.github.api.data
import com.intellij.collaboration.api.dto.GraphQLFragment
import org.jetbrains.plugins.github.api.data.pullrequest.GHPullRequestRequestedReviewer
@GraphQLFragment("/graphql/fragment/mannequinInfo.graphql")
@GraphQLFragment("/graphql/fragment/actorInfo.graphql")
class GHMannequin(
id: String,
override val login: String,

View File

@@ -5,7 +5,7 @@ import com.intellij.collaboration.api.dto.GraphQLFragment
import com.intellij.openapi.util.NlsSafe
import org.jetbrains.plugins.github.api.data.pullrequest.GHPullRequestRequestedReviewer
@GraphQLFragment("/graphql/fragment/userInfo.graphql")
@GraphQLFragment("/graphql/fragment/user.graphql")
class GHUser(id: String,
@NlsSafe override val login: String,
override val url: String,