MCPcopy
hub / github.com/apache/devlake / extractStatus

Function extractStatus

backend/plugins/tapd/tasks/shared.go:339–358  ·  view source on GitHub ↗

extractStatus extracts the status from the given blob and returns a map of status names to status values.

(blob []byte)

Source from the content-addressed store, hash-verified

337
338// extractStatus extracts the status from the given blob and returns a map of status names to status values.
339func extractStatus(blob []byte) (map[string]string, errors.Error) {
340 var statusRes struct {
341 Data interface{} `json:"data"`
342 }
343 err := errors.Convert(json.Unmarshal(blob, &statusRes))
344 if err != nil {
345 return nil, err
346 }
347 data, ok := statusRes.Data.(map[string]interface{})
348 if !ok {
349 return nil, nil
350 }
351 results := make(map[string]string)
352 for k, v := range data {
353 if value, ok := v.(string); ok {
354 results[k] = value
355 }
356 }
357 return results, nil
358}
359
360// getRepoNamespaceFromUrlPath
361// returns the namespace of a repository from the given URL path,

Callers 3

ExtractBugStatusFunction · 0.85
Test_extractStatusFunction · 0.85
ExtractStoryStatusFunction · 0.85

Calls 1

ConvertMethod · 0.45

Tested by 1

Test_extractStatusFunction · 0.68