MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetProjectReleaseIDFile

Function GetProjectReleaseIDFile

backend/common/resource_name.go:480–498  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

478}
479
480func GetProjectReleaseIDFile(name string) (string, string, string, error) {
481 // Find the "files/" segment - everything after it is the encoded file path
482 parentPart, encodedFileID, found := strings.Cut(name, "/"+FileNamePrefix)
483 if !found {
484 return "", "", "", errors.Errorf("invalid release file name %q: missing files/ segment", name)
485 }
486
487 tokens, err := GetNameParentTokens(parentPart, ProjectNamePrefix, ReleaseNamePrefix)
488 if err != nil {
489 return "", "", "", errors.Errorf("invalid release file name %q", name)
490 }
491
492 fileID, err := url.PathUnescape(encodedFileID)
493 if err != nil {
494 return "", "", "", errors.Errorf("invalid release file name %q: failed to decode file ID", name)
495 }
496
497 return tokens[0], tokens[1], fileID, nil
498}
499
500// GetGroupEmail returns the group email.
501func GetGroupEmail(name string) (string, error) {

Callers 2

createRevisionsMethod · 0.92
convertRevisionFunction · 0.92

Calls 2

ErrorfMethod · 0.80
GetNameParentTokensFunction · 0.70

Tested by

no test coverage detected