git-pr

created pr with 9.1 on 2024-07-22T16:00:20Z · by 964fa508
added 9.2 on 2024-07-22T17:56:33Z · by c8ef7d19
-: ------- > 1: 14c87fe lgtm
1: 42e808b = 2: 14c87fe fix: insert repoID with pr creation
changed status to accepted on 2024-07-22T17:56:33Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 9 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 9.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 9
set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 9
set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 9

Patchset 9.2 on 2024-07-22T17:56:33Z · commit 14c87fe

fix: insert repoID with pr creation
jolheiser 2024-07-22T15:43:15Z
We need to add the repoID when a new pr is created.
As well, all NullXXX when inserting should be set to Valid.

Signed-off-by: jolheiser <git@jolheiser.com>
Semantic diff summary
0 added, 5 modified, 0 signature changed, 0 removed across 1 analyzed file
+11 -8 pr.go #
......@@ -54,8 +54,10 @@ type PrCmd struct {
5454 Backend *Backend
5555 }
5656
57-var _ GitPatchRequest = PrCmd{}
58-var _ GitPatchRequest = (*PrCmd)(nil)
57+var (
58+ _ GitPatchRequest = PrCmd{}
59+ _ GitPatchRequest = (*PrCmd)(nil)
60+)
5961
6062 func (pr PrCmd) IsBanned(pubkey, ipAddress string) error {
6163 acl := []*Acl{}
......@@ -319,7 +321,7 @@ func (cmd PrCmd) UpdatePatchRequestStatus(prID int64, userID int64, status strin
319321
320322 err = cmd.CreateEventLog(tx, EventLog{
321323 UserID: userID,
322- PatchRequestID: sql.NullInt64{Int64: prID},
324+ PatchRequestID: sql.NullInt64{Int64: prID, Valid: true},
323325 Event: "pr_status_changed",
324326 Data: fmt.Sprintf(`{"status":"%s"}`, status),
325327 })
......@@ -355,7 +357,7 @@ func (cmd PrCmd) UpdatePatchRequestName(prID int64, userID int64, name string) e
355357
356358 err = cmd.CreateEventLog(tx, EventLog{
357359 UserID: userID,
358- PatchRequestID: sql.NullInt64{Int64: prID},
360+ PatchRequestID: sql.NullInt64{Int64: prID, Valid: true},
359361 Event: "pr_name_changed",
360362 Data: fmt.Sprintf(`{"name":"%s"}`, name),
361363 })
......@@ -509,8 +511,9 @@ func (cmd PrCmd) SubmitPatchRequest(repoID string, userID int64, patchset io.Rea
509511
510512 err = cmd.CreateEventLog(tx, EventLog{
511513 UserID: userID,
512- PatchRequestID: sql.NullInt64{Int64: prID},
513- PatchsetID: sql.NullInt64{Int64: patchsetID},
514+ RepoID: repoID,
515+ PatchRequestID: sql.NullInt64{Int64: prID, Valid: true},
516+ PatchsetID: sql.NullInt64{Int64: patchsetID, Valid: true},
514517 Event: "pr_created",
515518 })
516519 if err != nil {
......@@ -581,8 +584,8 @@ func (cmd PrCmd) SubmitPatchset(prID int64, userID int64, op PatchsetOp, patchse
581584
582585 err = cmd.CreateEventLog(tx, EventLog{
583586 UserID: userID,
584- PatchRequestID: sql.NullInt64{Int64: prID},
585- PatchsetID: sql.NullInt64{Int64: patchsetID},
587+ PatchRequestID: sql.NullInt64{Int64: prID, Valid: true},
588+ PatchsetID: sql.NullInt64{Int64: patchsetID, Valid: true},
586589 Event: event,
587590 })
588591 if err != nil {
Back to top