sigs.k8s.io/prow@v0.0.0-20240503223140-c5e374dc7eb1/pkg/pod-utils/clone/types.go (about) 1 /* 2 Copyright 2018 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package clone 18 19 import ( 20 "time" 21 22 prowapi "sigs.k8s.io/prow/pkg/apis/prowjobs/v1" 23 ) 24 25 // Record is a trace of what the desired 26 // git state was, what steps we took to get there, 27 // what our final state ended up being, and 28 // whether or not we were successful. 29 type Record struct { 30 Refs prowapi.Refs `json:"refs"` 31 Commands []Command `json:"commands,omitempty"` 32 Failed bool `json:"failed,omitempty"` 33 34 // FinalSHA is the SHA from ultimate state of a cloned ref 35 // This is used to populate RepoCommit in started.json properly 36 FinalSHA string `json:"final_sha,omitempty"` 37 38 // Duration is the total runtime for the clone. 39 Duration time.Duration `json:"duration,omitempty"` 40 } 41 42 // Command is a trace of a command executed 43 // while achieving the desired git state. 44 type Command struct { 45 Command string `json:"command"` 46 Output string `json:"output,omitempty"` 47 Error string `json:"error,omitempty"` 48 // Duration is the runtime for the command. 49 Duration time.Duration `json:"duration,omitempty"` 50 }