···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
-
for _, submission := range pull.Submissions {
-
totalIdents += len(submission.Comments)
-
identsToResolve := make([]string, totalIdents)
-
identsToResolve[0] = pull.OwnerDid
-
for _, submission := range pull.Submissions {
-
for _, comment := range submission.Comments {
-
identsToResolve[idx] = comment.OwnerDid
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
branchDeleteStatus := s.branchDeleteStatus(r, f, pull)
resubmitResult := pages.Unknown
···
-
patch := pull.Submissions[roundIdInt].Patch
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
-
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].Patch)
log.Println("failed to interdiff; current patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; current patch is invalid.")
-
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].Patch)
log.Println("failed to interdiff; previous patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; previous patch is invalid.")
···
createdAt := time.Now().Format(time.RFC3339)
-
pullAt, err := db.GetPullAt(s.db, f.RepoAt(), pull.PullId)
-
log.Println("failed to get pull at", err)
-
s.pages.Notice(w, "pull-comment", "Failed to create comment.")
client, err := s.oauth.AuthorizedClient(r)
log.Println("failed to get authorized client", err)
···
Record: &lexutil.LexiconTypeDecoder{
Val: &tangled.RepoPullComment{
···
sourceRev := comparison.Rev2
-
patch := comparison.Patch
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) handlePatchBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, title, body, targetBranch, patch string, isStacked bool) {
···
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", nil, nil, isStacked)
func (s *Pulls) handleForkBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, forkRepo string, title, body, targetBranch, sourceBranch string, isStacked bool) {
···
sourceRev := comparison.Rev2
-
patch := comparison.Patch
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
-
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) createPullRequest(
···
title, body, targetBranch string,
pullSource *models.PullSource,
recordPullSource *tangled.RepoPull_Source,
···
initialSubmission := models.PullSubmission{
···
patch := r.FormValue("patch")
-
s.resubmitPullHelper(w, r, f, user, pull, patch, "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
-
patch := comparison.Patch
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
func (s *Pulls) resubmitFork(w http.ResponseWriter, r *http.Request) {
···
comparison := forkComparison
sourceRev := comparison.Rev2
-
patch := comparison.Patch
-
s.resubmitPullHelper(w, r, f, user, pull, patch, sourceRev)
// validate a resubmission against a pull request
···
···
-
err = db.ResubmitPull(tx, pull, patch, sourceRev)
log.Println("failed to create pull request", err)
s.pages.Notice(w, "resubmit-error", "Failed to create pull request. Try again later.")
···
submission := np.Submissions[np.LastRoundNumber()]
-
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
log.Println("failed to update pull", err, op.PullId)
···
stack, _ := r.Context().Value("stack").(models.Stack)
abandonedPulls, _ := r.Context().Value("abandonedPulls").([]*models.Pull)
mergeCheckResponse := s.mergeCheck(r, f, pull, stack)
branchDeleteStatus := s.branchDeleteStatus(r, f, pull)
resubmitResult := pages.Unknown
···
+
patch := pull.Submissions[roundIdInt].CombinedPatch()
diff := patchutil.AsNiceDiff(patch, pull.TargetBranch)
s.pages.RepoPullPatchPage(w, pages.RepoPullPatchParams{
···
+
currentPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt].CombinedPatch())
log.Println("failed to interdiff; current patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; current patch is invalid.")
+
previousPatch, err := patchutil.AsDiff(pull.Submissions[roundIdInt-1].CombinedPatch())
log.Println("failed to interdiff; previous patch malformed")
s.pages.Notice(w, fmt.Sprintf("interdiff-error-%d", roundIdInt), "Failed to calculate interdiff; previous patch is invalid.")
···
createdAt := time.Now().Format(time.RFC3339)
client, err := s.oauth.AuthorizedClient(r)
log.Println("failed to get authorized client", err)
···
Record: &lexutil.LexiconTypeDecoder{
Val: &tangled.RepoPullComment{
+
Pull: pull.PullAt().String(),
···
sourceRev := comparison.Rev2
+
patch := comparison.FormatPatchRaw
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, combined, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) handlePatchBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, title, body, targetBranch, patch string, isStacked bool) {
···
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, "", "", nil, nil, isStacked)
func (s *Pulls) handleForkBasedPull(w http.ResponseWriter, r *http.Request, f *reporesolver.ResolvedRepo, user *oauth.User, forkRepo string, title, body, targetBranch, sourceBranch string, isStacked bool) {
···
sourceRev := comparison.Rev2
+
patch := comparison.FormatPatchRaw
+
combined := comparison.CombinedPatchRaw
if !patchutil.IsPatchValid(patch) {
s.pages.Notice(w, "pull", "Invalid patch format. Please provide a valid diff.")
···
+
s.createPullRequest(w, r, f, user, title, body, targetBranch, patch, combined, sourceRev, pullSource, recordPullSource, isStacked)
func (s *Pulls) createPullRequest(
···
title, body, targetBranch string,
pullSource *models.PullSource,
recordPullSource *tangled.RepoPull_Source,
···
initialSubmission := models.PullSubmission{
···
patch := r.FormValue("patch")
+
s.resubmitPullHelper(w, r, f, user, pull, patch, "", "")
func (s *Pulls) resubmitBranch(w http.ResponseWriter, r *http.Request) {
···
sourceRev := comparison.Rev2
+
patch := comparison.FormatPatchRaw
+
combined := comparison.CombinedPatchRaw
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
func (s *Pulls) resubmitFork(w http.ResponseWriter, r *http.Request) {
···
comparison := forkComparison
sourceRev := comparison.Rev2
+
patch := comparison.FormatPatchRaw
+
combined := comparison.CombinedPatchRaw
+
s.resubmitPullHelper(w, r, f, user, pull, patch, combined, sourceRev)
// validate a resubmission against a pull request
···
···
+
err = db.ResubmitPull(tx, pull, patch, combined, sourceRev)
log.Println("failed to create pull request", err)
s.pages.Notice(w, "resubmit-error", "Failed to create pull request. Try again later.")
···
submission := np.Submissions[np.LastRoundNumber()]
+
err := db.ResubmitPull(tx, op, submission.Patch, submission.Combined, submission.SourceRev)
log.Println("failed to update pull", err, op.PullId)