(parent string, projectID string, revision *store.RevisionMessage)
| 302 | } |
| 303 | |
| 304 | func convertToRevision(parent string, projectID string, revision *store.RevisionMessage) *v1pb.Revision { |
| 305 | taskRunName := revision.Payload.TaskRun |
| 306 | file := revision.Payload.File |
| 307 | if file != "" && revision.Payload.Release != "" { |
| 308 | file = common.FormatReleaseFile(revision.Payload.Release, file) |
| 309 | } |
| 310 | r := &v1pb.Revision{ |
| 311 | Name: fmt.Sprintf("%s/%s%s", parent, common.RevisionNamePrefix, revision.ResourceID), |
| 312 | Release: revision.Payload.Release, |
| 313 | CreateTime: timestamppb.New(revision.CreatedAt), |
| 314 | Sheet: common.FormatSheet(projectID, revision.Payload.SheetSha256), |
| 315 | SheetSha256: revision.Payload.SheetSha256, |
| 316 | Version: revision.Version, |
| 317 | File: file, |
| 318 | TaskRun: taskRunName, |
| 319 | Type: convertToRevisionType(revision.Payload.Type), |
| 320 | } |
| 321 | |
| 322 | if revision.Deleter != nil { |
| 323 | r.Deleter = common.FormatUserEmail(*revision.Deleter) |
| 324 | } |
| 325 | if revision.DeletedAt != nil { |
| 326 | r.DeleteTime = timestamppb.New(*revision.DeletedAt) |
| 327 | } |
| 328 | |
| 329 | return r |
| 330 | } |
| 331 | |
| 332 | func convertToRevisionType(t storepb.SchemaChangeType) v1pb.Revision_Type { |
| 333 | //exhaustive:enforce |
no test coverage detected