···58035803 fieldCount--
58045804 }
5805580558065806+ if t.Labels == nil {
58075807+ fieldCount--
58085808+ }
58095809+58065810 if t.Source == nil {
58075811 fieldCount--
58085812 }
···58805884 return err
58815885 }
5882588658835883- // t.Owner (string) (string)
58845884- if len("owner") > 1000000 {
58855885- return xerrors.Errorf("Value in field \"owner\" was too long")
58865886- }
58875887+ // t.Labels ([]string) (slice)
58885888+ if t.Labels != nil {
58895889+58905890+ if len("labels") > 1000000 {
58915891+ return xerrors.Errorf("Value in field \"labels\" was too long")
58925892+ }
58935893+58945894+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil {
58955895+ return err
58965896+ }
58975897+ if _, err := cw.WriteString(string("labels")); err != nil {
58985898+ return err
58995899+ }
5887590058885888- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil {
58895889- return err
58905890- }
58915891- if _, err := cw.WriteString(string("owner")); err != nil {
58925892- return err
58935893- }
59015901+ if len(t.Labels) > 8192 {
59025902+ return xerrors.Errorf("Slice value in field t.Labels was too long")
59035903+ }
59045904+59055905+ if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Labels))); err != nil {
59065906+ return err
59075907+ }
59085908+ for _, v := range t.Labels {
59095909+ if len(v) > 1000000 {
59105910+ return xerrors.Errorf("Value in field v was too long")
59115911+ }
5894591258955895- if len(t.Owner) > 1000000 {
58965896- return xerrors.Errorf("Value in field t.Owner was too long")
58975897- }
59135913+ if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil {
59145914+ return err
59155915+ }
59165916+ if _, err := cw.WriteString(string(v)); err != nil {
59175917+ return err
59185918+ }
5898591958995899- if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil {
59005900- return err
59015901- }
59025902- if _, err := cw.WriteString(string(t.Owner)); err != nil {
59035903- return err
59205920+ }
59045921 }
5905592259065923 // t.Source (string) (string)
···6098611560996116 t.LexiconTypeID = string(sval)
61006117 }
61016101- // t.Owner (string) (string)
61026102- case "owner":
61186118+ // t.Labels ([]string) (slice)
61196119+ case "labels":
61206120+61216121+ maj, extra, err = cr.ReadHeader()
61226122+ if err != nil {
61236123+ return err
61246124+ }
61256125+61266126+ if extra > 8192 {
61276127+ return fmt.Errorf("t.Labels: array too large (%d)", extra)
61286128+ }
61296129+61306130+ if maj != cbg.MajArray {
61316131+ return fmt.Errorf("expected cbor array")
61326132+ }
61336133+61346134+ if extra > 0 {
61356135+ t.Labels = make([]string, extra)
61366136+ }
61376137+61386138+ for i := 0; i < int(extra); i++ {
61396139+ {
61406140+ var maj byte
61416141+ var extra uint64
61426142+ var err error
61436143+ _ = maj
61446144+ _ = extra
61456145+ _ = err
6103614661046104- {
61056105- sval, err := cbg.ReadStringWithMax(cr, 1000000)
61066106- if err != nil {
61076107- return err
61476147+ {
61486148+ sval, err := cbg.ReadStringWithMax(cr, 1000000)
61496149+ if err != nil {
61506150+ return err
61516151+ }
61526152+61536153+ t.Labels[i] = string(sval)
61546154+ }
61556155+61086156 }
61096109-61106110- t.Owner = string(sval)
61116157 }
61126158 // t.Source (string) (string)
61136159 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