MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / CreateComment

Method CreateComment

internal/cli/client.go:1183–1196  ·  view source on GitHub ↗
(wsSlug, itemSlug string, input models.CommentCreate)

Source from the content-addressed store, hash-verified

1181}
1182
1183func (c *Client) CreateComment(wsSlug, itemSlug string, input models.CommentCreate) (*models.Comment, error) {
1184 // BUG-4119: the shared response type retains additive item_ref; an older
1185 // server leaves it empty so callers can fall back to the input spelling.
1186 var result models.Comment
1187 path := "/workspaces/" + url.PathEscape(wsSlug) + "/items/" + url.PathEscape(itemSlug) + "/comments"
1188 err := c.post(path, input, &result)
1189 // TASK-3585: the same single keyed retry as CreateItem, behind the same
1190 // capability gate.
1191 if err != nil && input.OpKey != "" && retryableWithKey(err) && c.serverHonorsKeys() {
1192 result = models.Comment{}
1193 err = c.post(path, input, &result)
1194 }
1195 return &result, wrapItemNotFound(err, itemSlug, wsSlug)
1196}
1197
1198// UpdateComment replaces a comment's body through the item-scoped route
1199// (TASK-2695), which refuses a comment that is not on itemRef. The server's

Calls 4

postMethod · 0.95
serverHonorsKeysMethod · 0.95
retryableWithKeyFunction · 0.85
wrapItemNotFoundFunction · 0.85