@@ -257,7 +257,6 @@ func IssueList(client *Client, repo ghrepo.Interface, state string, labels []str
257257
258258 for i := range milestones {
259259 if strings .EqualFold (milestones [i ].Title , milestoneString ) {
260- // The query for milestones requires the use of the milestone's database ID (see #1441)
261260 id , err := milestoneNodeIdToDatabaseId (milestones [i ].ID )
262261 if err != nil {
263262 return nil , err
@@ -439,18 +438,18 @@ func IssueReopen(client *Client, repo ghrepo.Interface, issue Issue) error {
439438}
440439
441440// milestoneNodeIdToDatabaseId extracts the REST Database ID from the GraphQL Node ID
442- func milestoneNodeIdToDatabaseId (id string ) (string , error ) {
443- // The node id is base64 obfuscated
444- decoded , err := base64 .StdEncoding .DecodeString (id )
441+ // This conversion is necessary since the GraphQL API requires the use of the milestone's database ID
442+ // for querying the related issues.
443+ func milestoneNodeIdToDatabaseId (nodeId string ) (string , error ) {
444+ // The Node ID is Base64 obfuscated, with an underlying pattern:
445+ // "09:Milestone12345", where "12345" is the database ID
446+ decoded , err := base64 .StdEncoding .DecodeString (nodeId )
445447 if err != nil {
446448 return "" , err
447449 }
448-
449- // The decoded node ID has a pattern like '09:Milestone12345'
450450 splitted := strings .Split (string (decoded ), "Milestone" )
451451 if len (splitted ) != 2 {
452452 return "" , fmt .Errorf ("couldn't get database id from node id" )
453453 }
454-
455454 return splitted [1 ], nil
456455}
0 commit comments