| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2726,11 +2726,13 @@ type createIssueMutation struct { | |||
| 2726 | 2726 | ||
| 2727 | 2727 | type createIssueParentMetadataQuery struct { | |
| 2728 | 2728 | ChildRepository struct { | |
| 2729 | - ID githubv4.ID | ||
| 2729 | + ID githubv4.ID | ||
| 2730 | + NameWithOwner githubv4.String | ||
| 2730 | 2731 | } `graphql:"childRepository: repository(owner: $owner, name: $repo)"` | |
| 2731 | 2732 | ParentRepository struct { | |
| 2732 | 2733 | Issue struct { | |
| 2733 | - ID githubv4.ID | ||
| 2734 | + ID githubv4.ID | ||
| 2735 | + Number githubv4.Int | ||
| 2734 | 2736 | } `graphql:"issue(number: $parentIssueNumber)"` | |
| 2735 | 2737 | } `graphql:"parentRepository: repository(owner: $parentOwner, name: $parentRepo)"` | |
| 2736 | 2738 | } | |
@@ -2817,6 +2819,9 @@ func createIssueWithParent( | |||
| 2817 | 2819 | if err := gqlClient.Mutate(ctx, &mutation, input, nil); err != nil { | |
| 2818 | 2820 | return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to create issue", err), nil | |
| 2819 | 2821 | } | |
| 2822 | + if mutation.CreateIssue.Issue.FullDatabaseID == "" || mutation.CreateIssue.Issue.URL.URL == nil { | ||
| 2823 | + return utils.NewToolResultError("failed to create issue: response did not include the created issue"), nil | ||
| 2824 | + } | ||
| 2820 | 2825 | ||
| 2821 | 2826 | response := MinimalResponse{ | |
| 2822 | 2827 | ID: string(mutation.CreateIssue.Issue.FullDatabaseID), | |
@@ -2861,10 +2866,10 @@ func resolveCreateIssueParent(ctx context.Context, gqlClient *githubv4.Client, o | |||
| 2861 | 2866 | if err := gqlClient.Query(ctx, &query, variables); err != nil { | |
| 2862 | 2867 | return "", "", err | |
| 2863 | 2868 | } | |
| 2864 | - if query.ChildRepository.ID == "" { | ||
| 2869 | + if query.ChildRepository.NameWithOwner == "" { | ||
| 2865 | 2870 | return "", "", fmt.Errorf("repository %s/%s was not found", owner, repo) | |
| 2866 | 2871 | } | |
| 2867 | - if query.ParentRepository.Issue.ID == "" { | ||
| 2872 | + if query.ParentRepository.Issue.Number == 0 { | ||
| 2868 | 2873 | return "", "", fmt.Errorf("parent issue #%d was not found in %s/%s", parentIssueNumber, parentOwner, parentRepo) | |
| 2869 | 2874 | } | |
| 2870 | 2875 | return query.ChildRepository.ID, query.ParentRepository.Issue.ID, nil | |
@@ -2880,7 +2885,7 @@ func resolveUserID(ctx context.Context, gqlClient *githubv4.Client, login string | |||
| 2880 | 2885 | if err := gqlClient.Query(ctx, &query, map[string]any{"login": githubv4.String(login)}); err != nil { | |
| 2881 | 2886 | return "", err | |
| 2882 | 2887 | } | |
| 2883 | - if query.User.ID == "" { | ||
| 2888 | + if query.User.Login == "" { | ||
| 2884 | 2889 | return "", fmt.Errorf("user %q was not found", login) | |
| 2885 | 2890 | } | |
| 2886 | 2891 | return query.User.ID, nil | |
@@ -2890,7 +2895,8 @@ func resolveMilestoneID(ctx context.Context, gqlClient *githubv4.Client, owner, | |||
| 2890 | 2895 | var query struct { | |
| 2891 | 2896 | Repository struct { | |
| 2892 | 2897 | Milestone struct { | |
| 2893 | - ID githubv4.ID | ||
| 2898 | + ID githubv4.ID | ||
| 2899 | + Number githubv4.Int | ||
| 2894 | 2900 | } `graphql:"milestone(number: $milestoneNumber)"` | |
| 2895 | 2901 | } `graphql:"repository(owner: $owner, name: $repo)"` | |
| 2896 | 2902 | } | |
@@ -2902,7 +2908,7 @@ func resolveMilestoneID(ctx context.Context, gqlClient *githubv4.Client, owner, | |||
| 2902 | 2908 | if err := gqlClient.Query(ctx, &query, variables); err != nil { | |
| 2903 | 2909 | return "", err | |
| 2904 | 2910 | } | |
| 2905 | - if query.Repository.Milestone.ID == "" { | ||
| 2911 | + if query.Repository.Milestone.Number == 0 { | ||
| 2906 | 2912 | return "", fmt.Errorf("milestone #%d was not found in %s/%s", milestoneNumber, owner, repo) | |
| 2907 | 2913 | } | |
| 2908 | 2914 | return query.Repository.Milestone.ID, nil | |
| Back | FazBrowse Home | New Git URL |
0 commit comments