pico
created pr with
12.1
pr_reviewed
cmds
checkout latest patchset:
ssh pr.pico.sh print 12 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 12.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 12
Patchset
12.1
fix: log admin as closer
jolheiser
2024-07-22T17:56:18ZPreviously 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: | |
| 619 | 619 | return err | |
| 620 | 620 | } | |
| 621 | 621 | ||
| 622 | - | user, err := pr.GetUserByID(patchReq.UserID) | |
| 622 | + | patchUser, err := pr.GetUserByID(patchReq.UserID) | |
| 623 | 623 | if err != nil { | |
| 624 | 624 | return err | |
| 625 | 625 | } | |
| 626 | 626 | ||
| 627 | 627 | pk := sesh.PublicKey() | |
| 628 | - | isContrib := pubkey == user.Pubkey | |
| 628 | + | isContrib := pubkey == patchUser.Pubkey | |
| 629 | 629 | isAdmin := be.IsAdmin(pk) | |
| 630 | 630 | if !isAdmin && !isContrib { | |
| 631 | 631 | return fmt.Errorf("you are not authorized to change PR status") |
| ... | ... | @@ -635,6 +635,11 @@ Here's how it works: | |
| 635 | 635 | return fmt.Errorf("PR has already been closed") | |
| 636 | 636 | } | |
| 637 | 637 | ||
| 638 | + | user, err := pr.UpsertUser(pubkey, userName) | |
| 639 | + | if err != nil { | |
| 640 | + | return err | |
| 641 | + | } | |
| 642 | + | ||
| 638 | 643 | err = pr.UpdatePatchRequestStatus(prID, user.ID, "closed") | |
| 639 | 644 | if err != nil { | |
| 640 | 645 | return err |