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

Function GetBlueprintByProjectName

backend/server/services/blueprint.go:118–131  ·  view source on GitHub ↗

GetBlueprintByProjectName returns the detail of a given ProjectName

(projectName string)

Source from the content-addressed store, hash-verified

116
117// GetBlueprintByProjectName returns the detail of a given ProjectName
118func GetBlueprintByProjectName(projectName string) (*models.Blueprint, errors.Error) {
119 if projectName == "" {
120 return nil, errors.Internal.New("can not use the empty projectName to search the unique blueprint")
121 }
122 blueprint, err := bpManager.GetDbBlueprintByProjectName(projectName)
123 if err != nil {
124 // Allow specific projectName to fail to find the corresponding blueprint
125 if db.IsErrorNotFound(err) {
126 return nil, nil
127 }
128 return nil, errors.Internal.Wrap(err, fmt.Sprintf("error getting the blueprint from database with project %s", projectName))
129 }
130 return blueprint, nil
131}
132
133func validateBlueprintAndMakePlan(blueprint *models.Blueprint) errors.Error {
134 // validation

Callers 3

makeProjectOutputFunction · 0.85

Calls 4

WrapMethod · 0.80
NewMethod · 0.65
IsErrorNotFoundMethod · 0.65

Tested by

no test coverage detected