git-pr
created pr with
9.1
added 9.2
-: ------- > 1: 14c87fe lgtm
1: 42e808b = 2: 14c87fe fix: insert repoID with pr creation
changed status to
accepted
cmds
checkout latest patchset:
ssh pr.pico.sh print 9 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 9.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 9set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 9set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 9
Patchset
9.1
fix: insert repoID with pr creation
jolheiser
2024-07-22T15:43:15ZWe 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 { | |
| 54 | 54 | Backend *Backend | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | - | var _ GitPatchRequest = PrCmd{} | |
| 58 | - | var _ GitPatchRequest = (*PrCmd)(nil) | |
| 57 | + | var ( | |
| 58 | + | _ GitPatchRequest = PrCmd{} | |
| 59 | + | _ GitPatchRequest = (*PrCmd)(nil) | |
| 60 | + | ) | |
| 59 | 61 | ||
| 60 | 62 | func (pr PrCmd) IsBanned(pubkey, ipAddress string) error { | |
| 61 | 63 | acl := []*Acl{} |
| ... | ... | @@ -319,7 +321,7 @@ func (cmd PrCmd) UpdatePatchRequestStatus(prID int64, userID int64, status strin | |
| 319 | 321 | ||
| 320 | 322 | err = cmd.CreateEventLog(tx, EventLog{ | |
| 321 | 323 | UserID: userID, | |
| 322 | - | PatchRequestID: sql.NullInt64{Int64: prID}, | |
| 324 | + | PatchRequestID: sql.NullInt64{Int64: prID, Valid: true}, | |
| 323 | 325 | Event: "pr_status_changed", | |
| 324 | 326 | Data: fmt.Sprintf(`{"status":"%s"}`, status), | |
| 325 | 327 | }) |
| ... | ... | @@ -355,7 +357,7 @@ func (cmd PrCmd) UpdatePatchRequestName(prID int64, userID int64, name string) e | |
| 355 | 357 | ||
| 356 | 358 | err = cmd.CreateEventLog(tx, EventLog{ | |
| 357 | 359 | UserID: userID, | |
| 358 | - | PatchRequestID: sql.NullInt64{Int64: prID}, | |
| 360 | + | PatchRequestID: sql.NullInt64{Int64: prID, Valid: true}, | |
| 359 | 361 | Event: "pr_name_changed", | |
| 360 | 362 | Data: fmt.Sprintf(`{"name":"%s"}`, name), | |
| 361 | 363 | }) |
| ... | ... | @@ -509,8 +511,9 @@ func (cmd PrCmd) SubmitPatchRequest(repoID string, userID int64, patchset io.Rea | |
| 509 | 511 | ||
| 510 | 512 | err = cmd.CreateEventLog(tx, EventLog{ | |
| 511 | 513 | 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}, | |
| 514 | 517 | Event: "pr_created", | |
| 515 | 518 | }) | |
| 516 | 519 | if err != nil { |
| ... | ... | @@ -581,8 +584,8 @@ func (cmd PrCmd) SubmitPatchset(prID int64, userID int64, op PatchsetOp, patchse | |
| 581 | 584 | ||
| 582 | 585 | err = cmd.CreateEventLog(tx, EventLog{ | |
| 583 | 586 | 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}, | |
| 586 | 589 | Event: event, | |
| 587 | 590 | }) | |
| 588 | 591 | if err != nil { |