pico

created pr with 117.1 on 2026-02-26T01:37:49Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 117 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 117.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 117

Patchset 117.1 on 2026-02-26T01:37:49Z · commit 55c06b3

Replaced `--comment` flag which was a string into a bool and now require comment to be provided by stdin for commands `accept`, `close`, and `reopen`.

`echo "lgtm!" | ssh pr.pico.sh pr accept --comment 100`

If no `--comment` flag provided then you don't need to provide stdin.
Semantic diff summary
0 added, 7 modified, 0 signature changed, 0 removed across 2 analyzed files (1 file skipped: unsupported file type)
+9 -2 CHANGELOG.md #
......@@ -6,11 +6,18 @@ Use spec: https://common-changelog.org/
66
77 ### Changed
88
9-- Upgraded to `go1.25`
10-- Removed charm's `wish` with pico's `pssh`
9+## v2026-02-25
10+
11+### Changed
12+
13+- Replaced `--comment` flag which was a string into a bool and now require comment to be provided by stdin for commands `accept`, `close`, and `reopen`
14+ - `echo "lgtm!" | ssh pr.pico.sh pr accept --comment 100`
15+ - If no `--comment` flag provided then you don't need to provide stdin
1116
1217 ## v2026-02-24
1318
1419 ### Changed
1520
1621 - Added `ssh {username}@pr register` command and now require explicit registration to use this service
22+- Upgraded to `go1.25`
23+- Removed charm's `wish` with pico's `pssh`
+35 -9 cli.go #
......@@ -621,9 +621,9 @@ To get started, submit a new patch request:
621621 Args: true,
622622 ArgsUsage: "[prID], [prID]...",
623623 Flags: []cli.Flag{
624- &cli.StringFlag{
624+ &cli.BoolFlag{
625625 Name: "comment",
626- Usage: "add a comment to the patchset(s)",
626+ Usage: "If this flag is provided, pass comment through stdin",
627627 },
628628 },
629629 Action: func(cCtx *cli.Context) error {
......@@ -667,7 +667,16 @@ To get started, submit a new patch request:
667667 return fmt.Errorf("PR has already been accepted")
668668 }
669669
670- err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusAccepted, cCtx.String("comment"))
670+ comment := cCtx.Bool("comment")
671+ var commentTxt []byte
672+ if comment {
673+ commentTxt, err = io.ReadAll(sesh)
674+ if err != nil {
675+ return fmt.Errorf("when comment flag enabled must provide it from stdin")
676+ }
677+ }
678+
679+ err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusAccepted, string(commentTxt))
671680 if err != nil {
672681 return err
673682 }
......@@ -688,9 +697,9 @@ To get started, submit a new patch request:
688697 Args: true,
689698 ArgsUsage: "[prID], [prID]...",
690699 Flags: []cli.Flag{
691- &cli.StringFlag{
700+ &cli.BoolFlag{
692701 Name: "comment",
693- Usage: "add a comment to the patchset(s)",
702+ Usage: "If this flag is provided, pass comment through stdin",
694703 },
695704 },
696705 Action: func(cCtx *cli.Context) error {
......@@ -739,7 +748,16 @@ To get started, submit a new patch request:
739748 return errNotExist(be.Cfg.Host, pubkey)
740749 }
741750
742- err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusClosed, cCtx.String("comment"))
751+ comment := cCtx.Bool("comment")
752+ var commentTxt []byte
753+ if comment {
754+ commentTxt, err = io.ReadAll(sesh)
755+ if err != nil {
756+ return fmt.Errorf("when comment flag enabled must provide it from stdin")
757+ }
758+ }
759+
760+ err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusClosed, string(commentTxt))
743761 if err != nil {
744762 return err
745763 }
......@@ -759,9 +777,9 @@ To get started, submit a new patch request:
759777 Args: true,
760778 ArgsUsage: "[prID]",
761779 Flags: []cli.Flag{
762- &cli.StringFlag{
780+ &cli.BoolFlag{
763781 Name: "comment",
764- Usage: "add a comment to the patchset",
782+ Usage: "If this flag is provided, pass comment through stdin",
765783 },
766784 },
767785 Action: func(cCtx *cli.Context) error {
......@@ -804,7 +822,15 @@ To get started, submit a new patch request:
804822 return errNotExist(be.Cfg.Host, pubkey)
805823 }
806824
807- err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusOpen, cCtx.String("comment"))
825+ comment := cCtx.Bool("comment")
826+ var commentTxt []byte
827+ if comment {
828+ commentTxt, err = io.ReadAll(sesh)
829+ if err != nil {
830+ return fmt.Errorf("when comment flag enabled must provide it from stdin")
831+ }
832+ }
833+ err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusOpen, string(commentTxt))
808834 if err == nil {
809835 sesh.Printf("Reopened PR %s (#%d)\n", prq.Name, prq.ID)
810836 }
+1 -1 e2e_test.go #
......@@ -121,7 +121,7 @@ func testMultiTenantE2E(t *testing.T) {
121121 t.Log("Create pr with admin repo and user can accept with comment")
122122 suite.adminKey.MustCmd(nil, "repo create ai")
123123 suite.userKey.MustCmd(suite.patch, "pr create admin/ai")
124- suite.adminKey.MustCmd(suite.otherPatch, "pr accept --comment 'nice work' 9")
124+ suite.adminKey.MustCmd([]byte("nice work"), "pr accept --comment 9")
125125
126126 t.Log("Create pr with default `bin` repo")
127127 actual, err := suite.userKey.Cmd(suite.patch, "pr create")
Back to top