Monorepo for Tangled tangled.org
2

Configure Feed

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

lexicons/git: add `changedFiles` in `git.refUpdate`

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
date (Jun 20, 2026, 7:50 PM +0900) commit 235548f6 parent 8bbfaced change-id ytswxnop
+186 -2
+161 -1
api/tangled/cbor_gen.go
··· 1611 1611 } 1612 1612 1613 1613 cw := cbg.NewCborWriter(w) 1614 - fieldCount := 8 1614 + fieldCount := 10 1615 + 1616 + if t.ChangedFiles == nil { 1617 + fieldCount-- 1618 + } 1615 1619 1616 1620 if t.OwnerDid == nil { 1621 + fieldCount-- 1622 + } 1623 + 1624 + if t.PushOptions == nil { 1617 1625 fieldCount-- 1618 1626 } 1619 1627 ··· 1780 1788 } 1781 1789 } 1782 1790 1791 + // t.PushOptions ([]string) (slice) 1792 + if t.PushOptions != nil { 1793 + 1794 + if len("pushOptions") > 1000000 { 1795 + return xerrors.Errorf("Value in field \"pushOptions\" was too long") 1796 + } 1797 + 1798 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pushOptions"))); err != nil { 1799 + return err 1800 + } 1801 + if _, err := cw.WriteString(string("pushOptions")); err != nil { 1802 + return err 1803 + } 1804 + 1805 + if len(t.PushOptions) > 8192 { 1806 + return xerrors.Errorf("Slice value in field t.PushOptions was too long") 1807 + } 1808 + 1809 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.PushOptions))); err != nil { 1810 + return err 1811 + } 1812 + for _, v := range t.PushOptions { 1813 + if len(v) > 1000000 { 1814 + return xerrors.Errorf("Value in field v was too long") 1815 + } 1816 + 1817 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { 1818 + return err 1819 + } 1820 + if _, err := cw.WriteString(string(v)); err != nil { 1821 + return err 1822 + } 1823 + 1824 + } 1825 + } 1826 + 1827 + // t.ChangedFiles ([]string) (slice) 1828 + if t.ChangedFiles != nil { 1829 + 1830 + if len("changedFiles") > 1000000 { 1831 + return xerrors.Errorf("Value in field \"changedFiles\" was too long") 1832 + } 1833 + 1834 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("changedFiles"))); err != nil { 1835 + return err 1836 + } 1837 + if _, err := cw.WriteString(string("changedFiles")); err != nil { 1838 + return err 1839 + } 1840 + 1841 + if len(t.ChangedFiles) > 8192 { 1842 + return xerrors.Errorf("Slice value in field t.ChangedFiles was too long") 1843 + } 1844 + 1845 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.ChangedFiles))); err != nil { 1846 + return err 1847 + } 1848 + for _, v := range t.ChangedFiles { 1849 + if len(v) > 1000000 { 1850 + return xerrors.Errorf("Value in field v was too long") 1851 + } 1852 + 1853 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { 1854 + return err 1855 + } 1856 + if _, err := cw.WriteString(string(v)); err != nil { 1857 + return err 1858 + } 1859 + 1860 + } 1861 + } 1862 + 1783 1863 // t.CommitterDid (string) (string) 1784 1864 if len("committerDid") > 1000000 { 1785 1865 return xerrors.Errorf("Value in field \"committerDid\" was too long") ··· 1940 2020 } 1941 2021 1942 2022 t.OwnerDid = (*string)(&sval) 2023 + } 2024 + } 2025 + // t.PushOptions ([]string) (slice) 2026 + case "pushOptions": 2027 + 2028 + maj, extra, err = cr.ReadHeader() 2029 + if err != nil { 2030 + return err 2031 + } 2032 + 2033 + if extra > 8192 { 2034 + return fmt.Errorf("t.PushOptions: array too large (%d)", extra) 2035 + } 2036 + 2037 + if maj != cbg.MajArray { 2038 + return fmt.Errorf("expected cbor array") 2039 + } 2040 + 2041 + if extra > 0 { 2042 + t.PushOptions = make([]string, extra) 2043 + } 2044 + 2045 + for i := 0; i < int(extra); i++ { 2046 + { 2047 + var maj byte 2048 + var extra uint64 2049 + var err error 2050 + _ = maj 2051 + _ = extra 2052 + _ = err 2053 + 2054 + { 2055 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2056 + if err != nil { 2057 + return err 2058 + } 2059 + 2060 + t.PushOptions[i] = string(sval) 2061 + } 2062 + 2063 + } 2064 + } 2065 + // t.ChangedFiles ([]string) (slice) 2066 + case "changedFiles": 2067 + 2068 + maj, extra, err = cr.ReadHeader() 2069 + if err != nil { 2070 + return err 2071 + } 2072 + 2073 + if extra > 8192 { 2074 + return fmt.Errorf("t.ChangedFiles: array too large (%d)", extra) 2075 + } 2076 + 2077 + if maj != cbg.MajArray { 2078 + return fmt.Errorf("expected cbor array") 2079 + } 2080 + 2081 + if extra > 0 { 2082 + t.ChangedFiles = make([]string, extra) 2083 + } 2084 + 2085 + for i := 0; i < int(extra); i++ { 2086 + { 2087 + var maj byte 2088 + var extra uint64 2089 + var err error 2090 + _ = maj 2091 + _ = extra 2092 + _ = err 2093 + 2094 + { 2095 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2096 + if err != nil { 2097 + return err 2098 + } 2099 + 2100 + t.ChangedFiles[i] = string(sval) 2101 + } 2102 + 1943 2103 } 1944 2104 } 1945 2105 // t.CommitterDid (string) (string)
+4
api/tangled/gitrefUpdate.go
··· 18 18 // RECORDTYPE: GitRefUpdate 19 19 type GitRefUpdate struct { 20 20 LexiconTypeID string `json:"$type,const=sh.tangled.git.refUpdate" cborgen:"$type,const=sh.tangled.git.refUpdate"` 21 + // changedFiles: files changed between commits 22 + ChangedFiles []string `json:"changedFiles,omitempty" cborgen:"changedFiles,omitempty"` 21 23 // committerDid: did of the user that pushed this ref 22 24 CommitterDid string `json:"committerDid" cborgen:"committerDid"` 23 25 Meta *GitRefUpdate_Meta `json:"meta" cborgen:"meta"` ··· 27 29 OldSha string `json:"oldSha" cborgen:"oldSha"` 28 30 // ownerDid: did of the owner of the repo 29 31 OwnerDid *string `json:"ownerDid,omitempty" cborgen:"ownerDid,omitempty"` 32 + // pushOptions: push options passed on git-push 33 + PushOptions []string `json:"pushOptions,omitempty" cborgen:"pushOptions,omitempty"` 30 34 // ref: Ref being updated 31 35 Ref string `json:"ref" cborgen:"ref"` 32 36 // repo: DID of the repo itself
+21 -1
lexicons/git/refUpdate.json
··· 4 4 "defs": { 5 5 "main": { 6 6 "type": "record", 7 - "description": "An update to a git repository, emitted by knots.", 7 + "description": "An event record representing git-push operation to git repository, emitted by knots.", 8 8 "key": "tid", 9 9 "record": { 10 10 "type": "object", ··· 49 49 "description": "new SHA of this ref", 50 50 "minLength": 40, 51 51 "maxLength": 40 52 + }, 53 + "changedFiles": { 54 + "type": "array", 55 + "description": "files changed between commits", 56 + "items": { "type": "string" } 57 + }, 58 + "pushOptions": { 59 + "type": "array", 60 + "description": "push options passed on git-push", 61 + "maxLength": 50, 62 + "items": { 63 + "type": "string", 64 + "maxLength": 1024, 65 + "knownValues": [ 66 + "ci-skip", 67 + "ci-verbose", 68 + "skip-ci", 69 + "verbose-ci" 70 + ] 71 + } 52 72 }, 53 73 "meta": { 54 74 "type": "ref",