This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

lexicons: add blobs field to `repo.{issue,pull}`

Ideally both `body` and `blobs` should be wrapped as single `body` field
with `sh.tangled.markup.markdown` type like `sh.tangled.feed.comment`
records, but that breaking change is deferred for later `org.tangled.*`
migration.

Signed-off-by: Wilhelm Berggren <wilhelmberggren@gmail.com>
Signed-off-by: Seongmin Lee <git@boltless.me>

author
Wilhelm Berggren
committer
Seongmin Lee
date (Jul 29, 2026, 1:37 AM +0900) commit 5c6eb63a parent 2df65b74 change-id rortzopy
+191 -9
+166 -2
api/tangled/cbor_gen.go
··· 11386 11386 } 11387 11387 11388 11388 cw := cbg.NewCborWriter(w) 11389 - fieldCount := 7 11389 + fieldCount := 8 11390 + 11391 + if t.Blobs == nil { 11392 + fieldCount-- 11393 + } 11390 11394 11391 11395 if t.Body == nil { 11392 11396 fieldCount-- ··· 11476 11480 } 11477 11481 if _, err := cw.WriteString(string("sh.tangled.repo.issue")); err != nil { 11478 11482 return err 11483 + } 11484 + 11485 + // t.Blobs ([]*util.LexBlob) (slice) 11486 + if t.Blobs != nil { 11487 + 11488 + if len("blobs") > 1000000 { 11489 + return xerrors.Errorf("Value in field \"blobs\" was too long") 11490 + } 11491 + 11492 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("blobs"))); err != nil { 11493 + return err 11494 + } 11495 + if _, err := cw.WriteString(string("blobs")); err != nil { 11496 + return err 11497 + } 11498 + 11499 + if len(t.Blobs) > 8192 { 11500 + return xerrors.Errorf("Slice value in field t.Blobs was too long") 11501 + } 11502 + 11503 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Blobs))); err != nil { 11504 + return err 11505 + } 11506 + for _, v := range t.Blobs { 11507 + if err := v.MarshalCBOR(cw); err != nil { 11508 + return err 11509 + } 11510 + 11511 + } 11479 11512 } 11480 11513 11481 11514 // t.Title (string) (string) ··· 11681 11714 } 11682 11715 11683 11716 t.LexiconTypeID = string(sval) 11717 + } 11718 + // t.Blobs ([]*util.LexBlob) (slice) 11719 + case "blobs": 11720 + 11721 + maj, extra, err = cr.ReadHeader() 11722 + if err != nil { 11723 + return err 11724 + } 11725 + 11726 + if extra > 8192 { 11727 + return fmt.Errorf("t.Blobs: array too large (%d)", extra) 11728 + } 11729 + 11730 + if maj != cbg.MajArray { 11731 + return fmt.Errorf("expected cbor array") 11732 + } 11733 + 11734 + if extra > 0 { 11735 + t.Blobs = make([]*util.LexBlob, extra) 11736 + } 11737 + 11738 + for i := 0; i < int(extra); i++ { 11739 + { 11740 + var maj byte 11741 + var extra uint64 11742 + var err error 11743 + _ = maj 11744 + _ = extra 11745 + _ = err 11746 + 11747 + { 11748 + 11749 + b, err := cr.ReadByte() 11750 + if err != nil { 11751 + return err 11752 + } 11753 + if b != cbg.CborNull[0] { 11754 + if err := cr.UnreadByte(); err != nil { 11755 + return err 11756 + } 11757 + t.Blobs[i] = new(util.LexBlob) 11758 + if err := t.Blobs[i].UnmarshalCBOR(cr); err != nil { 11759 + return xerrors.Errorf("unmarshaling t.Blobs[i] pointer: %w", err) 11760 + } 11761 + } 11762 + 11763 + } 11764 + 11765 + } 11684 11766 } 11685 11767 // t.Title (string) (string) 11686 11768 case "title": ··· 12416 12498 } 12417 12499 12418 12500 cw := cbg.NewCborWriter(w) 12419 - fieldCount := 10 12501 + fieldCount := 11 12502 + 12503 + if t.Blobs == nil { 12504 + fieldCount-- 12505 + } 12420 12506 12421 12507 if t.Body == nil { 12422 12508 fieldCount-- ··· 12491 12577 } 12492 12578 if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil { 12493 12579 return err 12580 + } 12581 + 12582 + // t.Blobs ([]*util.LexBlob) (slice) 12583 + if t.Blobs != nil { 12584 + 12585 + if len("blobs") > 1000000 { 12586 + return xerrors.Errorf("Value in field \"blobs\" was too long") 12587 + } 12588 + 12589 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("blobs"))); err != nil { 12590 + return err 12591 + } 12592 + if _, err := cw.WriteString(string("blobs")); err != nil { 12593 + return err 12594 + } 12595 + 12596 + if len(t.Blobs) > 8192 { 12597 + return xerrors.Errorf("Slice value in field t.Blobs was too long") 12598 + } 12599 + 12600 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Blobs))); err != nil { 12601 + return err 12602 + } 12603 + for _, v := range t.Blobs { 12604 + if err := v.MarshalCBOR(cw); err != nil { 12605 + return err 12606 + } 12607 + 12608 + } 12494 12609 } 12495 12610 12496 12611 // t.Title (string) (string) ··· 12778 12893 } 12779 12894 12780 12895 t.LexiconTypeID = string(sval) 12896 + } 12897 + // t.Blobs ([]*util.LexBlob) (slice) 12898 + case "blobs": 12899 + 12900 + maj, extra, err = cr.ReadHeader() 12901 + if err != nil { 12902 + return err 12903 + } 12904 + 12905 + if extra > 8192 { 12906 + return fmt.Errorf("t.Blobs: array too large (%d)", extra) 12907 + } 12908 + 12909 + if maj != cbg.MajArray { 12910 + return fmt.Errorf("expected cbor array") 12911 + } 12912 + 12913 + if extra > 0 { 12914 + t.Blobs = make([]*util.LexBlob, extra) 12915 + } 12916 + 12917 + for i := 0; i < int(extra); i++ { 12918 + { 12919 + var maj byte 12920 + var extra uint64 12921 + var err error 12922 + _ = maj 12923 + _ = extra 12924 + _ = err 12925 + 12926 + { 12927 + 12928 + b, err := cr.ReadByte() 12929 + if err != nil { 12930 + return err 12931 + } 12932 + if b != cbg.CborNull[0] { 12933 + if err := cr.UnreadByte(); err != nil { 12934 + return err 12935 + } 12936 + t.Blobs[i] = new(util.LexBlob) 12937 + if err := t.Blobs[i].UnmarshalCBOR(cr); err != nil { 12938 + return xerrors.Errorf("unmarshaling t.Blobs[i] pointer: %w", err) 12939 + } 12940 + } 12941 + 12942 + } 12943 + 12944 + } 12781 12945 } 12782 12946 // t.Title (string) (string) 12783 12947 case "title":
+8 -7
api/tangled/repoissue.go
··· 17 17 } // 18 18 // RECORDTYPE: RepoIssue 19 19 type RepoIssue struct { 20 - LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"` 21 - Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 - Mentions []string `json:"mentions,omitempty" cborgen:"mentions,omitempty"` 24 - References []string `json:"references,omitempty" cborgen:"references,omitempty"` 25 - Repo string `json:"repo" cborgen:"repo"` 26 - Title string `json:"title" cborgen:"title"` 20 + LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"` 21 + Blobs []*util.LexBlob `json:"blobs,omitempty" cborgen:"blobs,omitempty"` 22 + Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 23 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 24 + Mentions []string `json:"mentions,omitempty" cborgen:"mentions,omitempty"` 25 + References []string `json:"references,omitempty" cborgen:"references,omitempty"` 26 + Repo string `json:"repo" cborgen:"repo"` 27 + Title string `json:"title" cborgen:"title"` 27 28 }
+1
api/tangled/repopull.go
··· 18 18 // RECORDTYPE: RepoPull 19 19 type RepoPull struct { 20 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull" cborgen:"$type,const=sh.tangled.repo.pull"` 21 + Blobs []*util.LexBlob `json:"blobs,omitempty" cborgen:"blobs,omitempty"` 21 22 Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 23 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 24 DependentOn *string `json:"dependentOn,omitempty" cborgen:"dependentOn,omitempty"`
+8
lexicons/issue/issue.json
··· 38 38 "type": "string", 39 39 "format": "at-uri" 40 40 } 41 + }, 42 + "blobs": { 43 + "type": "array", 44 + "items": { 45 + "type": "blob", 46 + "accept": ["image/*"], 47 + "maxSize": 1000000 48 + } 41 49 } 42 50 } 43 51 }
+8
lexicons/pulls/pull.json
··· 58 58 "dependentOn": { 59 59 "type": "string", 60 60 "format": "at-uri" 61 + }, 62 + "blobs": { 63 + "type": "array", 64 + "items": { 65 + "type": "blob", 66 + "accept": ["image/*"], 67 + "maxSize": 1000000 68 + } 61 69 } 62 70 } 63 71 }