Monorepo for Tangled tangled.org
859
fork

Configure Feed

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

lexicons: add evidences to vouch record #342

open opened by oppi.li targeting master from op/ryxxuwzqyuuu
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mlb3um4cq322
+92 -1
Diff #1
+81 -1
api/tangled/cbor_gen.go
··· 2467 2467 } 2468 2468 2469 2469 cw := cbg.NewCborWriter(w) 2470 - fieldCount := 4 2470 + fieldCount := 5 2471 + 2472 + if t.Evidences == nil { 2473 + fieldCount-- 2474 + } 2471 2475 2472 2476 if t.Reason == nil { 2473 2477 fieldCount-- ··· 2573 2577 if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 2574 2578 return err 2575 2579 } 2580 + 2581 + // t.Evidences ([]string) (slice) 2582 + if t.Evidences != nil { 2583 + 2584 + if len("evidences") > 1000000 { 2585 + return xerrors.Errorf("Value in field \"evidences\" was too long") 2586 + } 2587 + 2588 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("evidences"))); err != nil { 2589 + return err 2590 + } 2591 + if _, err := cw.WriteString(string("evidences")); err != nil { 2592 + return err 2593 + } 2594 + 2595 + if len(t.Evidences) > 8192 { 2596 + return xerrors.Errorf("Slice value in field t.Evidences was too long") 2597 + } 2598 + 2599 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Evidences))); err != nil { 2600 + return err 2601 + } 2602 + for _, v := range t.Evidences { 2603 + if len(v) > 1000000 { 2604 + return xerrors.Errorf("Value in field v was too long") 2605 + } 2606 + 2607 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { 2608 + return err 2609 + } 2610 + if _, err := cw.WriteString(string(v)); err != nil { 2611 + return err 2612 + } 2613 + 2614 + } 2615 + } 2576 2616 return nil 2577 2617 } 2578 2618 ··· 2671 2711 2672 2712 t.CreatedAt = string(sval) 2673 2713 } 2714 + // t.Evidences ([]string) (slice) 2715 + case "evidences": 2716 + 2717 + maj, extra, err = cr.ReadHeader() 2718 + if err != nil { 2719 + return err 2720 + } 2721 + 2722 + if extra > 8192 { 2723 + return fmt.Errorf("t.Evidences: array too large (%d)", extra) 2724 + } 2725 + 2726 + if maj != cbg.MajArray { 2727 + return fmt.Errorf("expected cbor array") 2728 + } 2729 + 2730 + if extra > 0 { 2731 + t.Evidences = make([]string, extra) 2732 + } 2733 + 2734 + for i := 0; i < int(extra); i++ { 2735 + { 2736 + var maj byte 2737 + var extra uint64 2738 + var err error 2739 + _ = maj 2740 + _ = extra 2741 + _ = err 2742 + 2743 + { 2744 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2745 + if err != nil { 2746 + return err 2747 + } 2748 + 2749 + t.Evidences[i] = string(sval) 2750 + } 2751 + 2752 + } 2753 + } 2674 2754 2675 2755 default: 2676 2756 // Field doesn't exist on this type, so ignore it
+2
api/tangled/graphvouch.go
··· 19 19 type GraphVouch struct { 20 20 LexiconTypeID string `json:"$type,const=sh.tangled.graph.vouch" cborgen:"$type,const=sh.tangled.graph.vouch"` 21 21 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 + // evidences: Optional list of ATURIs serving as evidence for this vouch (ex. issues, PRs) 23 + Evidences []string `json:"evidences,omitempty" cborgen:"evidences,omitempty"` 22 24 // kind: Whether this user is being vouched for or denounced 23 25 Kind string `json:"kind" cborgen:"kind"` 24 26 // reason: The reason for this vouch/denouncement
+9
lexicons/graph/vouch.json
··· 29 29 "createdAt": { 30 30 "type": "string", 31 31 "format": "datetime" 32 + }, 33 + "evidences": { 34 + "type": "array", 35 + "description": "Optional list of ATURIs serving as evidence for this vouch (ex. issues, PRs)", 36 + "maxLength": 10, 37 + "items": { 38 + "type": "string", 39 + "format": "at-uri" 40 + } 32 41 } 33 42 } 34 43 }

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
lexicons: add evidences to vouch record
merge conflicts detected
expand
  • api/tangled/cbor_gen.go:2467
  • api/tangled/graphvouch.go:19
  • lexicons/graph/vouch.json:29
expand 0 comments
oppi.li submitted #0
1 commit
expand
lexicons: add evidences to vouch record
expand 0 comments