MCPcopy
hub / github.com/the-open-agent/openagent / resolveStoreCommentTarget

Function resolveStoreCommentTarget

controllers/comment.go:231–246  ·  view source on GitHub ↗
(targetKey string)

Source from the content-addressed store, hash-verified

229}
230
231func resolveStoreCommentTarget(targetKey string) (*commentTarget, error) {
232 owner, name, err := util.GetOwnerAndNameFromIdWithError(targetKey)
233 if err != nil {
234 return nil, err
235 }
236
237 store, err := object.GetStore(util.GetIdFromOwnerAndName(owner, name))
238 if err != nil {
239 return nil, err
240 }
241 if store == nil || store.PublishState != "Published" {
242 return nil, fmt.Errorf("Comment target does not exist")
243 }
244
245 return &commentTarget{Owner: store.Owner}, nil
246}
247
248// resolveIssueCommentTarget validates that the issue exists and resolves the
249// owner allowed to moderate its comments (the issue's store owner).

Callers 1

resolveCommentTargetFunction · 0.85

Calls 3

GetStoreFunction · 0.92
GetIdFromOwnerAndNameFunction · 0.92

Tested by

no test coverage detected