Monorepo for Tangled tangled.org

lexicons: update repo and spindle.member lexicons

- add spindle to repo
- fix spindle.member lexicon field name

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 463ab401 aaf94e57

verified
Changed files
+87 -48
api
lexicons
+78 -45
api/tangled/cbor_gen.go
··· 7184 7184 } 7185 7185 7186 7186 cw := cbg.NewCborWriter(w) 7187 - fieldCount := 7 7187 + fieldCount := 8 7188 7188 7189 7189 if t.Description == nil { 7190 7190 fieldCount-- 7191 7191 } 7192 7192 7193 7193 if t.Source == nil { 7194 + fieldCount-- 7195 + } 7196 + 7197 + if t.Spindle == nil { 7194 7198 fieldCount-- 7195 7199 } 7196 7200 ··· 7318 7322 } 7319 7323 } 7320 7324 7325 + // t.Spindle (string) (string) 7326 + if t.Spindle != nil { 7327 + 7328 + if len("spindle") > 1000000 { 7329 + return xerrors.Errorf("Value in field \"spindle\" was too long") 7330 + } 7331 + 7332 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil { 7333 + return err 7334 + } 7335 + if _, err := cw.WriteString(string("spindle")); err != nil { 7336 + return err 7337 + } 7338 + 7339 + if t.Spindle == nil { 7340 + if _, err := cw.Write(cbg.CborNull); err != nil { 7341 + return err 7342 + } 7343 + } else { 7344 + if len(*t.Spindle) > 1000000 { 7345 + return xerrors.Errorf("Value in field t.Spindle was too long") 7346 + } 7347 + 7348 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil { 7349 + return err 7350 + } 7351 + if _, err := cw.WriteString(string(*t.Spindle)); err != nil { 7352 + return err 7353 + } 7354 + } 7355 + } 7356 + 7321 7357 // t.CreatedAt (string) (string) 7322 7358 if len("createdAt") > 1000000 { 7323 7359 return xerrors.Errorf("Value in field \"createdAt\" was too long") ··· 7481 7517 t.Source = (*string)(&sval) 7482 7518 } 7483 7519 } 7520 + // t.Spindle (string) (string) 7521 + case "spindle": 7522 + 7523 + { 7524 + b, err := cr.ReadByte() 7525 + if err != nil { 7526 + return err 7527 + } 7528 + if b != cbg.CborNull[0] { 7529 + if err := cr.UnreadByte(); err != nil { 7530 + return err 7531 + } 7532 + 7533 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7534 + if err != nil { 7535 + return err 7536 + } 7537 + 7538 + t.Spindle = (*string)(&sval) 7539 + } 7540 + } 7484 7541 // t.CreatedAt (string) (string) 7485 7542 case "createdAt": 7486 7543 ··· 7531 7588 } 7532 7589 7533 7590 cw := cbg.NewCborWriter(w) 7534 - fieldCount := 4 7535 7591 7536 - if t.Instance == nil { 7537 - fieldCount-- 7538 - } 7539 - 7540 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 7592 + if _, err := cw.Write([]byte{164}); err != nil { 7541 7593 return err 7542 7594 } 7543 7595 ··· 7584 7636 } 7585 7637 7586 7638 // t.Instance (string) (string) 7587 - if t.Instance != nil { 7639 + if len("instance") > 1000000 { 7640 + return xerrors.Errorf("Value in field \"instance\" was too long") 7641 + } 7588 7642 7589 - if len("instance") > 1000000 { 7590 - return xerrors.Errorf("Value in field \"instance\" was too long") 7591 - } 7643 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("instance"))); err != nil { 7644 + return err 7645 + } 7646 + if _, err := cw.WriteString(string("instance")); err != nil { 7647 + return err 7648 + } 7592 7649 7593 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("instance"))); err != nil { 7594 - return err 7595 - } 7596 - if _, err := cw.WriteString(string("instance")); err != nil { 7597 - return err 7598 - } 7650 + if len(t.Instance) > 1000000 { 7651 + return xerrors.Errorf("Value in field t.Instance was too long") 7652 + } 7599 7653 7600 - if t.Instance == nil { 7601 - if _, err := cw.Write(cbg.CborNull); err != nil { 7602 - return err 7603 - } 7604 - } else { 7605 - if len(*t.Instance) > 1000000 { 7606 - return xerrors.Errorf("Value in field t.Instance was too long") 7607 - } 7608 - 7609 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Instance))); err != nil { 7610 - return err 7611 - } 7612 - if _, err := cw.WriteString(string(*t.Instance)); err != nil { 7613 - return err 7614 - } 7615 - } 7654 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Instance))); err != nil { 7655 + return err 7656 + } 7657 + if _, err := cw.WriteString(string(t.Instance)); err != nil { 7658 + return err 7616 7659 } 7617 7660 7618 7661 // t.CreatedAt (string) (string) ··· 7707 7750 case "instance": 7708 7751 7709 7752 { 7710 - b, err := cr.ReadByte() 7753 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7711 7754 if err != nil { 7712 7755 return err 7713 7756 } 7714 - if b != cbg.CborNull[0] { 7715 - if err := cr.UnreadByte(); err != nil { 7716 - return err 7717 - } 7718 7757 7719 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7720 - if err != nil { 7721 - return err 7722 - } 7723 - 7724 - t.Instance = (*string)(&sval) 7725 - } 7758 + t.Instance = string(sval) 7726 7759 } 7727 7760 // t.CreatedAt (string) (string) 7728 7761 case "createdAt":
+2 -2
api/tangled/spindlemember.go
··· 20 20 LexiconTypeID string `json:"$type,const=sh.tangled.spindle.member" cborgen:"$type,const=sh.tangled.spindle.member"` 21 21 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 22 // instance: spindle instance that the subject is now a member of 23 - Instance *string `json:"instance,omitempty" cborgen:"instance,omitempty"` 24 - Subject string `json:"subject" cborgen:"subject"` 23 + Instance string `json:"instance" cborgen:"instance"` 24 + Subject string `json:"subject" cborgen:"subject"` 25 25 }
+2
api/tangled/tangledrepo.go
··· 27 27 Owner string `json:"owner" cborgen:"owner"` 28 28 // source: source of the repo 29 29 Source *string `json:"source,omitempty" cborgen:"source,omitempty"` 30 + // spindle: CI runner to send jobs to and receive results from 31 + Spindle *string `json:"spindle,omitempty" cborgen:"spindle,omitempty"` 30 32 }
+4
lexicons/repo.json
··· 28 28 "type": "string", 29 29 "description": "knot where the repo was created" 30 30 }, 31 + "spindle": { 32 + "type": "string", 33 + "description": "CI runner to send jobs to and receive results from" 34 + }, 31 35 "description": { 32 36 "type": "string", 33 37 "format": "datetime",
+1 -1
lexicons/spindle/member.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "subject", 14 - "domain", 14 + "instance", 15 15 "createdAt" 16 16 ], 17 17 "properties": {