pico

created pr with 12.1 on 2024-07-22T17:56:38Z · by 964fa508
pr_reviewed on 2024-07-22T18:28:48Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 12 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 12.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 12

Patchset 12.1 on 2024-07-22T17:56:38Z · commit 1743c59

fix: log admin as closer
jolheiser 2024-07-22T17:56:18Z
Previously the contributor was logged as the closer, even when an admin closed a pr

Signed-off-by: jolheiser <git@jolheiser.com>
Semantic diff summary
0 added, 2 modified, 0 signature changed, 0 removed across 1 analyzed file
+7 -2 cli.go #
......@@ -619,13 +619,13 @@ Here's how it works:
619619 return err
620620 }
621621
622- user, err := pr.GetUserByID(patchReq.UserID)
622+ patchUser, err := pr.GetUserByID(patchReq.UserID)
623623 if err != nil {
624624 return err
625625 }
626626
627627 pk := sesh.PublicKey()
628- isContrib := pubkey == user.Pubkey
628+ isContrib := pubkey == patchUser.Pubkey
629629 isAdmin := be.IsAdmin(pk)
630630 if !isAdmin && !isContrib {
631631 return fmt.Errorf("you are not authorized to change PR status")
......@@ -635,6 +635,11 @@ Here's how it works:
635635 return fmt.Errorf("PR has already been closed")
636636 }
637637
638+ user, err := pr.UpsertUser(pubkey, userName)
639+ if err != nil {
640+ return err
641+ }
642+
638643 err = pr.UpdatePatchRequestStatus(prID, user.ID, "closed")
639644 if err != nil {
640645 return err
Back to top