// GerritBuildSet returns a buildset representation of c,
// e.g. "patch/gerrit/chromium-review.googlesource.com/677784/5"
548639
func GerritBuildSet(c *pb.GerritChange) string {
	return fmt.Sprintf("patch/gerrit/%s/%d/%d", c.Host, c.Change, c.Patchset)
}
121081
func (s *DescribeConfigurationSetOutput) SetConfigurationSet(v *ConfigurationSet) *DescribeConfigurationSetOutput {
	s.ConfigurationSet = v
	return s
}
933601
func (r *SourceRepository) AddBuildSecrets(secrets []string) error {
	injections := s2iapi.VolumeList{}
	r.secrets = []buildv1.SecretBuildSource{}
	for _, in := range secrets {
		if err := injections.Set(in); err != nil {
			return err
		}
	}
	secretExists := func(name string) bool {
		for _, s := range r.secrets {
			if s.Secret.Name == name {
				return true
			}
		}
		return false
	}
	for _, in := range injections {
		if r.GetStrategy() == newapp.StrategyDocker && filepath.IsAbs(in.Destination) {
			return fmt.Errorf("for the docker strategy, the secret destination directory %q must be a relative path", in.Destination)
		}
		if len(validation.ValidateSecretName(in.Source, false)) != 0 {
			return fmt.Errorf("the %q must be valid secret name", in.Source)
		}
		if secretExists(in.Source) {
			return fmt.Errorf("the %q secret can be used just once", in.Source)
		}
		r.secrets = append(r.secrets, buildv1.SecretBuildSource{
			Secret:         corev1.LocalObjectReference{Name: in.Source},
			DestinationDir: in.Destination,
		})
	}
	return nil
}
1265056
func autobuild(p *build.Package) error {
	if p.Dir == "" {
		return fmt.Errorf("no files to build")
	}
	ps, err := os.Stat(p.PkgObj)
	if err != nil {
		// Assume package file does not exist and build for the first time.
		return build_package(p)
	}
	pt := ps.ModTime()
	fs, err := readdir_lstat(p.Dir)
	if err != nil {
		return err
	}
	for _, f := range fs {
		if f.IsDir() {
			continue
		}
		if f.ModTime().After(pt) {
			// Source file is newer than package file; rebuild.
			return build_package(p)
		}
	}
	return nil
}
91249
func (s *CreateBranchInput) SetBuildSpec(v string) *CreateBranchInput {
	s.BuildSpec = &v
	return s
}
618101
func NewUpdateGSetCommandBuilder() *UpdateGSetCommandBuilder {
	return &UpdateGSetCommandBuilder{
		protobuf: &rpbRiakDT.DtUpdateReq{
			Op: &rpbRiakDT.DtOp{
				GsetOp: &rpbRiakDT.GSetOp{},
			},
		},
	}
}
725894
func GitilesBuildSet(c *pb.GitilesCommit) string {
	return fmt.Sprintf("commit/gitiles/%s/%s/+/%s", c.Host, c.Project, c.Id)
}
878312
func (b *GCSBuilder) Build() (*gcs.Filter, error) {
	// Do nothing if the builder's already errored out.
	if b.err != nil {
		return nil, b.err
	}

	// We'll ensure that all the parmaters we need to actually build the
	// filter properly are set.
	if b.p == 0 {
		return nil, fmt.Errorf("p value is not set, cannot build")
	}
	if b.m == 0 {
		return nil, fmt.Errorf("m value is not set, cannot build")
	}

	dataSlice := make([][]byte, 0, len(b.data))
	for item := range b.data {
		dataSlice = append(dataSlice, []byte(item))
	}

	return gcs.BuildGCSFilter(b.p, b.m, b.key, dataSlice)
}
47990
func (s *App) SetBuildSpec(v string) *App {
	s.BuildSpec = &v
	return s
}
14249
func (g *BuildGenerator) createBuild(ctx context.Context, build *buildv1.Build) (*buildv1.Build, error) {
	if !rest.ValidNamespace(ctx, &build.ObjectMeta) {
		return nil, errors.NewConflict(buildv1.Resource("build"), build.Namespace, fmt.Errorf("Build.Namespace does not match the provided context"))
	}
	rest.FillObjectMetaSystemFields(&build.ObjectMeta)
	err := g.Client.CreateBuild(ctx, build)
	if err != nil {
		return nil, err
	}
	return g.Client.GetBuild(ctx, build.Name, &metav1.GetOptions{})
}
822769
func (v *Container) ChildSet(w IWidget, propName string, value interface{}) {

	ptr := C.CString(propName)
	defer cfree(ptr)

	switch value.(type) {
	case bool:
		C._gtk_container_child_set_bool(CONTAINER(v), ToNative(w), gstring(ptr), gbool(value.(bool)))
	case int:
		C._gtk_container_child_set_int(CONTAINER(v), ToNative(w), gstring(ptr), gint(value.(int)))
	}
}
667384
func (c *ControllerAPI) ConfigSet(args params.ControllerConfigSet) error {
	if err := c.checkHasAdmin(); err != nil {
		return errors.Trace(err)
	}
	if err := c.state.UpdateControllerConfig(args.Config, nil); err != nil {
		return errors.Trace(err)
	}
	// TODO(thumper): add a version to controller config to allow for
	// simultaneous updates and races in publishing, potentially across
	// HA servers.
	cfg, err := c.state.ControllerConfig()
	if err != nil {
		return errors.Trace(err)
	}
	if _, err := c.hub.Publish(
		controller.ConfigChanged,
		controller.ConfigChangedMessage{cfg}); err != nil {
		return errors.Trace(err)
	}
	return nil
}
51646
func (s *ApplicationVersionDescription) SetSourceBuildInformation(v *SourceBuildInformation) *ApplicationVersionDescription {
	s.SourceBuildInformation = v
	return s
}
165795
func (c *GetMappingCall) ConfigSet(configSet string) *GetMappingCall {
	c.urlParams_.Set("config_set", configSet)
	return c
}
1325334
func (c *ApiController) GetBuildsAll() {
	log.Info("Get all builds")

	builds := models.GetAllBuilds()

	c.Data["json"] = builds
	c.ServeJson()
}
793945
func buildFromBuildbucket(c context.Context, master string, b *deprecated.Build, fetchAnnotations bool) (*buildbot.Build, error) {
	num, err := buildNumber(b)
	if err != nil {
		return nil, err
	}

	res := &buildbot.Build{
		Emulated:    true,
		ViewPath:    (&model.BuildSummary{BuildID: "buildbucket/" + b.Address()}).SelfLink(),
		Master:      master,
		Buildername: b.Builder,
		Number:      num,
		Results:     statusResult(b.Status),
		TimeStamp:   buildbot.Time{b.UpdateTime},
		Times: buildbot.TimeRange{
			Start:  buildbot.Time{b.StartTime},
			Finish: buildbot.Time{b.CompletionTime},
		},
		// TODO(nodir): use buildbucket access API when it is ready,
		// or, perhaps, just delete this code.
		// Note that this function should not be called on builds
		// that the requester does not have access to, in the first place.
		Internal:    b.Bucket != "luci.chromium.try",
		Finished:    protoutil.IsEnded(b.Status),
		Sourcestamp: &buildbot.SourceStamp{},

		// non-nil slice because we want an array, not null,
		// when converted to JSON
		Steps: []buildbot.Step{},
	}

	for _, bs := range b.Tags[bbv1.TagBuildSet] {
		commit, ok := protoutil.ParseBuildSet(bs).(*buildbucketpb.GitilesCommit)
		if ok {
			res.Sourcestamp.Repository = protoutil.GitilesRepoURL(commit)
			res.Sourcestamp.Revision = commit.Id
			break
		}
	}

	if fetchAnnotations && b.Status != buildbucketpb.Status_SCHEDULED {
		addr, err := logLocation(b)
		if err != nil {
			return nil, grpcutil.NotFound
		}

		ann, err := fetchAnnotationProto(c, addr)
		switch {
		case err == errAnnotationNotFound:
		case err != nil:
			return nil, errors.Annotate(err, "could not load annotation proto").Err()
		default:
			res.Properties = extractProperties(ann)

			prefix, _ := addr.Path.Split()
			conv := annotationConverter{
				logdogServer:       addr.Host,
				logdogPrefix:       fmt.Sprintf("%s/%s", addr.Project, prefix),
				buildCompletedTime: b.CompletionTime,
			}
			convCtx := logging.SetField(c, "build_id", b.ID)
			conv.addSteps(convCtx, &res.Steps, ann.Substep, "")
			for i := range res.Steps {
				s := &res.Steps[i]
				s.StepNumber = i + 1
				res.Logs = append(res.Logs, s.Logs...)
				if !s.IsFinished {
					res.Currentstep = s.Name
				}
				if s.Results.Result != buildbot.Success {
					res.Text = append(res.Text, fmt.Sprintf("%s %s", s.Results.Result, s.Name))
				}
			}
		}
	}

	if len(res.Text) == 0 && b.Status == buildbucketpb.Status_SUCCESS {
		res.Text = []string{"Build successful"}
	}

	return res, nil
}
116371
func (b TestToBuildData) GetDataPerBuild(job, build, test, node string) *DataPerBuild {
	if _, ok := b[test]; !ok {
		b[test] = &DataPerTest{
			Job:  job,
			Data: map[string]DataPerNode{},
		}
	}
	if _, ok := b[test].Data[node]; !ok {
		b[test].Data[node] = DataPerNode{}
	}
	if _, ok := b[test].Data[node][build]; !ok {
		b[test].Data[node][build] = &DataPerBuild{}
	}
	return b[test].Data[node][build]
}