···58125812 fieldCount--
58135813 }
5814581458155815+ if t.Labels == nil {
58165816+ fieldCount--
58175817+ }
58185818+58155819 if t.Source == nil {
58165820 fieldCount--
58175821 }
···58895893 return err
58905894 }
5891589558925892- // t.Owner (string) (string)
58935893- if len("owner") > 1000000 {
58945894- return xerrors.Errorf("Value in field \"owner\" was too long")
58955895- }
58965896+ // t.Labels ([]string) (slice)
58975897+ if t.Labels != nil {
58985898+58995899+ if len("labels") > 1000000 {
59005900+ return xerrors.Errorf("Value in field \"labels\" was too long")
59015901+ }
59025902+59035903+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil {
59045904+ return err
59055905+ }
59065906+ if _, err := cw.WriteString(string("labels")); err != nil {
59075907+ return err
59085908+ }
5896590958975897- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
58985898- return err
58995899- }
59005900- if _, err := cw.WriteString(string("owner")); err != nil {
59015901- return err
59025902- }
59105910+ if len(t.Labels) > 8192 {
59115911+ return xerrors.Errorf("Slice value in field t.Labels was too long")
59125912+ }
59135913+59145914+ if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Labels))); err != nil {
59155915+ return err
59165916+ }
59175917+ for _, v := range t.Labels {
59185918+ if len(v) > 1000000 {
59195919+ return xerrors.Errorf("Value in field v was too long")
59205920+ }
5903592159045904- if len(t.Owner) > 1000000 {
59055905- return xerrors.Errorf("Value in field t.Owner was too long")
59065906- }
59225922+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
59235923+ return err
59245924+ }
59255925+ if _, err := cw.WriteString(string(v)); err != nil {
59265926+ return err
59275927+ }
5907592859085908- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
59095909- return err
59105910- }
59115911- if _, err := cw.WriteString(string(t.Owner)); err != nil {
59125912- return err
59295929+ }
59135930 }
5914593159155932 // t.Source (string) (string)
···6107612461086125 t.LexiconTypeID = string(sval)
61096126 }
61106110- // t.Owner (string) (string)
61116111- case "owner":
61276127+ // t.Labels ([]string) (slice)
61286128+ case "labels":
61296129+61306130+ maj, extra, err = cr.ReadHeader()
61316131+ if err != nil {
61326132+ return err
61336133+ }
61346134+61356135+ if extra > 8192 {
61366136+ return fmt.Errorf("t.Labels: array too large (%d)", extra)
61376137+ }
61386138+61396139+ if maj != cbg.MajArray {
61406140+ return fmt.Errorf("expected cbor array")
61416141+ }
61426142+61436143+ if extra > 0 {
61446144+ t.Labels = make([]string, extra)
61456145+ }
61466146+61476147+ for i := 0; i < int(extra); i++ {
61486148+ {
61496149+ var maj byte
61506150+ var extra uint64
61516151+ var err error
61526152+ _ = maj
61536153+ _ = extra
61546154+ _ = err
6112615561136113- {
61146114- sval, err := cbg.ReadStringWithMax(cr, 1000000)
61156115- if err != nil {
61166116- return err
61566156+ {
61576157+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
61586158+ if err != nil {
61596159+ return err
61606160+ }
61616161+61626162+ t.Labels[i] = string(sval)
61636163+ }
61646164+61176165 }
61186118-61196119- t.Owner = string(sval)
61206166 }
61216167 // t.Source (string) (string)
61226168 case "source":
+3-2
api/tangled/tangledrepo.go
···2222 Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
2323 // knot: knot where the repo was created
2424 Knot string `json:"knot" cborgen:"knot"`
2525+ // labels: List of labels that this repo subscribes to
2626+ Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"`
2527 // name: name of the repo
2626- Name string `json:"name" cborgen:"name"`
2727- Owner string `json:"owner" cborgen:"owner"`
2828+ Name string `json:"name" cborgen:"name"`
2829 // source: source of the repo
2930 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
3031 // spindle: CI runner to send jobs to and receive results from