MCPcopy Create free account
hub / github.com/cli/cli / ResolveCommentNodeID

Method ResolveCommentNodeID

pkg/cmd/discussion/client/client.go:1290–1297  ·  view source on GitHub ↗

ResolveCommentNodeID constructs a discussion comment node ID from a repository and a comment database ID. It fetches the repository's database ID via the API, then encodes the data into a "DC_" prefixed node ID.

(repo ghrepo.Interface, commentDatabaseID int64)

Source from the content-addressed store, hash-verified

1288// repository and a comment database ID. It fetches the repository's database
1289// ID via the API, then encodes the data into a "DC_" prefixed node ID.
1290func (c *discussionClient) ResolveCommentNodeID(repo ghrepo.Interface, commentDatabaseID int64) (string, error) {
1291 meta, err := c.getRepositoryMeta(repo)
1292 if err != nil {
1293 return "", err
1294 }
1295
1296 return "DC_" + api.EncodeNodeID(0, meta.DatabaseId, commentDatabaseID), nil
1297}

Callers

nothing calls this directly

Calls 2

getRepositoryMetaMethod · 0.95
EncodeNodeIDFunction · 0.92

Tested by

no test coverage detected