ERROR
patchutil/patchutil.go
ERROR
patchutil/patchutil.go
Failed to calculate interdiff for this file.
ERROR
patchutil/patchutil_test.go
ERROR
patchutil/patchutil_test.go
Failed to calculate interdiff for this file.
REVERTED
appview/state/pull.go
REVERTED
appview/state/pull.go
···
1839
1839
log.Printf("failed to get primary email: %s", err)
1840
1840
}
1841
1841
1842
-
actor := s.oauth.GetUser(r) // no need to check for nil as this is an authenticated request
1843
-
1844
-
footers := strings.Join([]string{
1845
-
fmt.Sprintf("Pull-id: %s", pull.PullAt()),
1846
-
fmt.Sprintf("Merged-by: %s", actor.Did),
1847
-
}, "\n")
1848
-
1849
-
pullBody := pull.Body + "\n\n" + footers
1850
-
1851
-
patch = patchutil.AddCommitMessageFooters(patch, footers)
1852
-
1853
1842
ksClient, err := knotclient.NewSignedClient(f.Knot, secret, s.config.Core.Dev)
1854
1843
if err != nil {
1855
1844
log.Printf("failed to create signed client for %s: %s", f.Knot, err)
···
1858
1847
}
1859
1848
1860
1849
// Merge the pull request
1850
+
resp, err := ksClient.Merge([]byte(patch), f.OwnerDid(), f.RepoName, pull.TargetBranch, pull.Title, pull.Body, ident.Handle.String(), email.Address)
1861
-
resp, err := ksClient.Merge([]byte(patch), f.OwnerDid(), f.RepoName, pull.TargetBranch, pull.Title, pullBody, ident.Handle.String(), email.Address)
1862
1851
if err != nil {
1863
1852
log.Printf("failed to merge pull request: %s", err)
1864
1853
s.pages.Notice(w, "pull-merge-error", "Failed to merge pull request. Try again later.")
NEW
appview/pulls/pulls.go
NEW
appview/pulls/pulls.go
···
351
351
Submission: pull.Submissions[roundIdInt],
352
352
Diff: &diff,
353
353
})
354
-
355
354
}
356
355
357
356
func (s *Pulls) RepoPullInterdiff(w http.ResponseWriter, r *http.Request) {
···
1748
1747
1749
1748
// resubmit the old pull
1750
1749
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
1751
-
1752
1750
if err != nil {
1753
1751
log.Println("failed to update pull", err, op.PullId)
1754
1752
s.pages.Notice(w, "pull-resubmit-error", "Failed to resubmit pull request. Try again later.")
···
1787
1785
newSubmission.SourceRev,
1788
1786
db.FilterEq("id", origSubmission.ID),
1789
1787
)
1790
-
1791
1788
if err != nil {
1792
1789
log.Println("failed to update pull", err, op.PullId)
1793
1790
s.pages.Notice(w, "pull-resubmit-error", "Failed to resubmit pull request. Try again later.")
···
1818
1815
db.FilterEq("owner_did", p.OwnerDid),
1819
1816
db.FilterEq("change_id", p.ChangeId),
1820
1817
)
1821
-
1822
1818
if err != nil {
1823
1819
log.Println("failed to update pull", err, p.PullId)
1824
1820
s.pages.Notice(w, "pull-resubmit-error", "Failed to resubmit pull request. Try again later.")
···
1915
1911
return
1916
1912
}
1917
1913
1914
+
actor := s.oauth.GetUser(r) // no need to check for nil as this is an authenticated request
1915
+
1916
+
footers := strings.Join([]string{
1917
+
fmt.Sprintf("Pull-id: %s", pull.PullAt()),
1918
+
fmt.Sprintf("Merged-by: %s", actor.Did),
1919
+
}, "\n")
1920
+
1921
+
pullBody := pull.Body + "\n\n" + footers
1922
+
patch = patchutil.AddCommitMessageFooters(patch, footers)
1923
+
1918
1924
// Merge the pull request
1919
-
resp, err := ksClient.Merge([]byte(patch), f.OwnerDid(), f.RepoName, pull.TargetBranch, pull.Title, pull.Body, ident.Handle.String(), email.Address)
1925
+
resp, err := ksClient.Merge([]byte(patch), f.OwnerDid(), f.RepoName, pull.TargetBranch, pull.Title, pullBody, ident.Handle.String(), email.Address)
1920
1926
if err != nil {
1921
1927
log.Printf("failed to merge pull request: %s", err)
1922
1928
s.pages.Notice(w, "pull-merge-error", "Failed to merge pull request. Try again later.")