MCPcopy Index your code
hub / github.com/apache/devlake / GetBlueprint

Function GetBlueprint

backend/server/services/blueprint.go:101–115  ·  view source on GitHub ↗

GetBlueprint returns the detail of a given Blueprint ID

(blueprintId uint64, shouldSanitize bool)

Source from the content-addressed store, hash-verified

99
100// GetBlueprint returns the detail of a given Blueprint ID
101func GetBlueprint(blueprintId uint64, shouldSanitize bool) (*models.Blueprint, errors.Error) {
102 blueprint, err := bpManager.GetDbBlueprint(blueprintId)
103 if err != nil {
104 if db.IsErrorNotFound(err) {
105 return nil, errors.NotFound.New("blueprint not found")
106 }
107 return nil, errors.Internal.Wrap(err, "error getting the blueprint from database")
108 }
109 if shouldSanitize {
110 if err := SanitizeBlueprint(blueprint); err != nil {
111 return nil, errors.Convert(err)
112 }
113 }
114 return blueprint, nil
115}
116
117// GetBlueprintByProjectName returns the detail of a given ProjectName
118func GetBlueprintByProjectName(projectName string) (*models.Blueprint, errors.Error) {

Callers 2

PatchBlueprintFunction · 0.85
TriggerBlueprintFunction · 0.85

Calls 6

SanitizeBlueprintFunction · 0.85
GetDbBlueprintMethod · 0.80
WrapMethod · 0.80
IsErrorNotFoundMethod · 0.65
NewMethod · 0.65
ConvertMethod · 0.45

Tested by

no test coverage detected