loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[gitea] week 2024-43 cherry pick (gitea/main -> forgejo)' (#5621) from algernon/wcp/2024-43 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5621
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>

+167 -85
+8 -1
models/actions/artifact.go
··· 69 69 OwnerID: t.OwnerID, 70 70 CommitSHA: t.CommitSHA, 71 71 Status: int64(ArtifactStatusUploadPending), 72 - ExpiredUnix: timeutil.TimeStamp(time.Now().Unix() + 3600*24*expiredDays), 72 + ExpiredUnix: timeutil.TimeStamp(time.Now().Unix() + timeutil.Day*expiredDays), 73 73 } 74 74 if _, err := db.GetEngine(ctx).Insert(artifact); err != nil { 75 75 return nil, err ··· 78 78 } else if err != nil { 79 79 return nil, err 80 80 } 81 + 82 + if _, err := db.GetEngine(ctx).ID(artifact.ID).Cols("expired_unix").Update(&ActionArtifact{ 83 + ExpiredUnix: timeutil.TimeStamp(time.Now().Unix() + timeutil.Day*expiredDays), 84 + }); err != nil { 85 + return nil, err 86 + } 87 + 81 88 return artifact, nil 82 89 } 83 90
+1
modules/migration/pullrequest.go
··· 37 37 ForeignIndex int64 38 38 Context DownloaderContext `yaml:"-"` 39 39 EnsuredSafe bool `yaml:"ensured_safe"` 40 + IsDraft bool `yaml:"is_draft"` 40 41 } 41 42 42 43 func (p *PullRequest) GetLocalIndex() int64 { return p.Number }
+8 -7
modules/structs/hook.go
··· 221 221 222 222 // IssueCommentPayload represents a payload information of issue comment event. 223 223 type IssueCommentPayload struct { 224 - Action HookIssueCommentAction `json:"action"` 225 - Issue *Issue `json:"issue"` 226 - Comment *Comment `json:"comment"` 227 - Changes *ChangesPayload `json:"changes,omitempty"` 228 - Repository *Repository `json:"repository"` 229 - Sender *User `json:"sender"` 230 - IsPull bool `json:"is_pull"` 224 + Action HookIssueCommentAction `json:"action"` 225 + Issue *Issue `json:"issue"` 226 + PullRequest *PullRequest `json:"pull_request,omitempty"` 227 + Comment *Comment `json:"comment"` 228 + Changes *ChangesPayload `json:"changes,omitempty"` 229 + Repository *Repository `json:"repository"` 230 + Sender *User `json:"sender"` 231 + IsPull bool `json:"is_pull"` 231 232 } 232 233 233 234 // JSONPayload implements Payload
+5
release-notes/5621.md
··· 1 + fix: [commit](https://codeberg.org/forgejo/forgejo/commit/f3f386545ee97b91f1aaac4142480e70a443c655) Always update expiration time when creating an artifact, so that artifacts from re-ran jobs do not get lost. 2 + fix: [commit](https://codeberg.org/forgejo/forgejo/commit/c163bf6fb55c922ab0cf552b47475fc8fc8b99d9) Remove the button toolbar when deleting a diff comment. 3 + feat: [commit](https://codeberg.org/forgejo/forgejo/commit/c3741d7fb0114691da73f00ae0ac9dced87e884d) The `requested_reviewers` data is included in more webhook events. 4 + fix: [commit](https://codeberg.org/forgejo/forgejo/commit/e8700cee612f0aa769dc6929772d9b04c6c21807) Run scheduled tasks against the latest commit. 5 + feat: [commit](https://codeberg.org/forgejo/forgejo/commit/89446e60a6e7ec3441f0c480164c09851ae54ce7) Support migrating GitHub/GitLab PR draft status.
+32 -19
routers/api/v1/repo/issue.go
··· 41 41 // parameters: 42 42 // - name: state 43 43 // in: query 44 - // description: whether issue is open or closed 44 + // description: State of the issue 45 45 // type: string 46 + // enum: [open, closed, all] 47 + // default: open 46 48 // - name: labels 47 49 // in: query 48 - // description: comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded 50 + // description: Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded. 49 51 // type: string 50 52 // - name: milestones 51 53 // in: query 52 - // description: comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded 54 + // description: Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded. 53 55 // type: string 54 56 // - name: q 55 57 // in: query 56 - // description: search string 58 + // description: Search string 57 59 // type: string 58 60 // - name: priority_repo_id 59 61 // in: query 60 - // description: repository to prioritize in the results 62 + // description: Repository ID to prioritize in the results 61 63 // type: integer 62 64 // format: int64 63 65 // - name: type 64 66 // in: query 65 - // description: filter by type (issues / pulls) if set 67 + // description: Filter by issue type 66 68 // type: string 69 + // enum: [issues, pulls] 67 70 // - name: since 68 71 // in: query 69 - // description: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format 72 + // description: Only show issues updated after the given time (RFC 3339 format) 70 73 // type: string 71 74 // format: date-time 72 - // required: false 73 75 // - name: before 74 76 // in: query 75 - // description: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format 77 + // description: Only show issues updated before the given time (RFC 3339 format) 76 78 // type: string 77 79 // format: date-time 78 - // required: false 79 80 // - name: assigned 80 81 // in: query 81 - // description: filter (issues / pulls) assigned to you, default is false 82 + // description: Filter issues or pulls assigned to the authenticated user 82 83 // type: boolean 84 + // default: false 83 85 // - name: created 84 86 // in: query 85 - // description: filter (issues / pulls) created by you, default is false 87 + // description: Filter issues or pulls created by the authenticated user 86 88 // type: boolean 89 + // default: false 87 90 // - name: mentioned 88 91 // in: query 89 - // description: filter (issues / pulls) mentioning you, default is false 92 + // description: Filter issues or pulls mentioning the authenticated user 90 93 // type: boolean 94 + // default: false 91 95 // - name: review_requested 92 96 // in: query 93 - // description: filter pulls requesting your review, default is false 97 + // description: Filter pull requests where the authenticated user's review was requested 94 98 // type: boolean 99 + // default: false 95 100 // - name: reviewed 96 101 // in: query 97 - // description: filter pulls reviewed by you, default is false 102 + // description: Filter pull requests reviewed by the authenticated user 98 103 // type: boolean 104 + // default: false 99 105 // - name: owner 100 106 // in: query 101 - // description: filter by owner 107 + // description: Filter by repository owner 102 108 // type: string 103 109 // - name: team 104 110 // in: query 105 - // description: filter by team (requires organization owner parameter to be provided) 111 + // description: Filter by team (requires organization owner parameter) 106 112 // type: string 107 113 // - name: page 108 114 // in: query 109 - // description: page number of results to return (1-based) 115 + // description: Page number of results to return (1-based) 110 116 // type: integer 117 + // minimum: 1 118 + // default: 1 111 119 // - name: limit 112 120 // in: query 113 - // description: page size of results 121 + // description: Number of items per page 114 122 // type: integer 123 + // minimum: 0 115 124 // responses: 116 125 // "200": 117 126 // "$ref": "#/responses/IssueList" 127 + // "400": 128 + // "$ref": "#/responses/error" 129 + // "422": 130 + // "$ref": "#/responses/validationError" 118 131 119 132 before, since, err := context.GetQueryBeforeSince(ctx.Base) 120 133 if err != nil {
+9 -1
services/actions/notifier_helper.go
··· 119 119 } 120 120 121 121 func notify(ctx context.Context, input *notifyInput) error { 122 + shouldDetectSchedules := input.Event == webhook_module.HookEventPush && input.Ref.BranchName() == input.Repo.DefaultBranch 122 123 if input.Doer.IsActions() { 123 124 // avoiding triggering cyclically, for example: 124 125 // a comment of an issue will trigger the runner to add a new comment as reply, 125 126 // and the new comment will trigger the runner again. 126 127 log.Debug("ignore executing %v for event %v whose doer is %v", getMethod(ctx), input.Event, input.Doer.Name) 128 + 129 + // we should update schedule tasks in this case, because 130 + // 1. schedule tasks cannot be triggered by other events, so cyclic triggering will not occur 131 + // 2. some schedule tasks may update the repo periodically, so the refs of schedule tasks need to be updated 132 + if shouldDetectSchedules { 133 + return DetectAndHandleSchedules(ctx, input.Repo) 134 + } 135 + 127 136 return nil 128 137 } 129 138 if input.Repo.IsEmpty || input.Repo.IsArchived { ··· 182 191 183 192 var detectedWorkflows []*actions_module.DetectedWorkflow 184 193 actionsConfig := input.Repo.MustGetUnit(ctx, unit_model.TypeActions).ActionsConfig() 185 - shouldDetectSchedules := input.Event == webhook_module.HookEventPush && input.Ref.BranchName() == input.Repo.DefaultBranch 186 194 workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit, 187 195 input.Event, 188 196 input.Payload,
+6 -1
services/migrations/gitea_uploader.go
··· 760 760 pr.Updated = pr.Created 761 761 } 762 762 763 + prTitle := pr.Title 764 + if pr.IsDraft && !issues_model.HasWorkInProgressPrefix(pr.Title) { 765 + prTitle = fmt.Sprintf("%s %s", setting.Repository.PullRequest.WorkInProgressPrefixes[0], pr.Title) 766 + } 767 + 763 768 issue := issues_model.Issue{ 764 769 RepoID: g.repo.ID, 765 770 Repo: g.repo, 766 - Title: pr.Title, 771 + Title: prTitle, 767 772 Index: pr.Number, 768 773 Content: pr.Content, 769 774 MilestoneID: milestoneID,
+1
services/migrations/github.go
··· 737 737 PatchURL: pr.GetPatchURL(), // see below for SECURITY related issues here 738 738 Reactions: reactions, 739 739 ForeignIndex: int64(*pr.Number), 740 + IsDraft: pr.GetDraft(), 740 741 }) 741 742 742 743 // SECURITY: Ensure that the PR is safe
+1
services/migrations/gitlab.go
··· 723 723 PatchURL: pr.WebURL + ".patch", 724 724 ForeignIndex: int64(pr.IID), 725 725 Context: gitlabIssueContext{IsMergeRequest: true}, 726 + IsDraft: pr.Draft, 726 727 }) 727 728 728 729 // SECURITY: Ensure that the PR is safe
+42 -32
services/webhook/notifier.go
··· 59 59 err = PrepareWebhooks(ctx, EventSource{Repository: issue.Repo}, webhook_module.HookEventPullRequestLabel, &api.PullRequestPayload{ 60 60 Action: api.HookIssueLabelCleared, 61 61 Index: issue.Index, 62 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 62 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 63 63 Repository: convert.ToRepo(ctx, issue.Repo, permission), 64 64 Sender: convert.ToUser(ctx, doer, nil), 65 65 }) ··· 150 150 } 151 151 apiPullRequest := &api.PullRequestPayload{ 152 152 Index: issue.Index, 153 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 153 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 154 154 Repository: convert.ToRepo(ctx, issue.Repo, permission), 155 155 Sender: convert.ToUser(ctx, doer, nil), 156 156 } ··· 201 201 From: oldTitle, 202 202 }, 203 203 }, 204 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 204 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 205 205 Repository: convert.ToRepo(ctx, issue.Repo, permission), 206 206 Sender: convert.ToUser(ctx, doer, nil), 207 207 }) ··· 236 236 // Merge pull request calls issue.changeStatus so we need to handle separately. 237 237 apiPullRequest := &api.PullRequestPayload{ 238 238 Index: issue.Index, 239 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 239 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 240 240 Repository: convert.ToRepo(ctx, issue.Repo, permission), 241 241 Sender: convert.ToUser(ctx, doer, nil), 242 242 CommitID: commitID, ··· 307 307 if err := PrepareWebhooks(ctx, EventSource{Repository: pull.Issue.Repo}, webhook_module.HookEventPullRequest, &api.PullRequestPayload{ 308 308 Action: api.HookIssueOpened, 309 309 Index: pull.Issue.Index, 310 - PullRequest: convert.ToAPIPullRequest(ctx, pull, nil), 310 + PullRequest: convert.ToAPIPullRequest(ctx, pull, pull.Issue.Poster), 311 311 Repository: convert.ToRepo(ctx, pull.Issue.Repo, permission), 312 312 Sender: convert.ToUser(ctx, pull.Issue.Poster, nil), 313 313 }); err != nil { ··· 336 336 From: oldContent, 337 337 }, 338 338 }, 339 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 339 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 340 340 Repository: convert.ToRepo(ctx, issue.Repo, permission), 341 341 Sender: convert.ToUser(ctx, doer, nil), 342 342 }) ··· 375 375 } 376 376 377 377 var eventType webhook_module.HookEventType 378 + var pullRequest *api.PullRequest 378 379 if c.Issue.IsPull { 379 380 eventType = webhook_module.HookEventPullRequestComment 381 + pullRequest = convert.ToAPIPullRequest(ctx, c.Issue.PullRequest, doer) 380 382 } else { 381 383 eventType = webhook_module.HookEventIssueComment 382 384 } 383 385 384 386 permission, _ := access_model.GetUserRepoPermission(ctx, c.Issue.Repo, doer) 385 387 if err := PrepareWebhooks(ctx, EventSource{Repository: c.Issue.Repo}, eventType, &api.IssueCommentPayload{ 386 - Action: api.HookIssueCommentEdited, 387 - Issue: convert.ToAPIIssue(ctx, doer, c.Issue), 388 - Comment: convert.ToAPIComment(ctx, c.Issue.Repo, c), 388 + Action: api.HookIssueCommentEdited, 389 + Issue: convert.ToAPIIssue(ctx, doer, c.Issue), 390 + PullRequest: pullRequest, 391 + Comment: convert.ToAPIComment(ctx, c.Issue.Repo, c), 389 392 Changes: &api.ChangesPayload{ 390 393 Body: &api.ChangesFromPayload{ 391 394 From: oldContent, ··· 403 406 issue *issues_model.Issue, comment *issues_model.Comment, mentions []*user_model.User, 404 407 ) { 405 408 var eventType webhook_module.HookEventType 409 + var pullRequest *api.PullRequest 406 410 if issue.IsPull { 407 411 eventType = webhook_module.HookEventPullRequestComment 412 + pullRequest = convert.ToAPIPullRequest(ctx, issue.PullRequest, doer) 408 413 } else { 409 414 eventType = webhook_module.HookEventIssueComment 410 415 } 411 416 412 417 permission, _ := access_model.GetUserRepoPermission(ctx, repo, doer) 413 418 if err := PrepareWebhooks(ctx, EventSource{Repository: issue.Repo}, eventType, &api.IssueCommentPayload{ 414 - Action: api.HookIssueCommentCreated, 415 - Issue: convert.ToAPIIssue(ctx, doer, issue), 416 - Comment: convert.ToAPIComment(ctx, repo, comment), 417 - Repository: convert.ToRepo(ctx, repo, permission), 418 - Sender: convert.ToUser(ctx, doer, nil), 419 - IsPull: issue.IsPull, 419 + Action: api.HookIssueCommentCreated, 420 + Issue: convert.ToAPIIssue(ctx, doer, issue), 421 + PullRequest: pullRequest, 422 + Comment: convert.ToAPIComment(ctx, repo, comment), 423 + Repository: convert.ToRepo(ctx, repo, permission), 424 + Sender: convert.ToUser(ctx, doer, nil), 425 + IsPull: issue.IsPull, 420 426 }); err != nil { 421 427 log.Error("PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) 422 428 } ··· 440 446 } 441 447 442 448 var eventType webhook_module.HookEventType 449 + var pullRequest *api.PullRequest 443 450 if comment.Issue.IsPull { 444 451 eventType = webhook_module.HookEventPullRequestComment 452 + pullRequest = convert.ToAPIPullRequest(ctx, comment.Issue.PullRequest, doer) 445 453 } else { 446 454 eventType = webhook_module.HookEventIssueComment 447 455 } 448 456 449 457 permission, _ := access_model.GetUserRepoPermission(ctx, comment.Issue.Repo, doer) 450 458 if err := PrepareWebhooks(ctx, EventSource{Repository: comment.Issue.Repo}, eventType, &api.IssueCommentPayload{ 451 - Action: api.HookIssueCommentDeleted, 452 - Issue: convert.ToAPIIssue(ctx, doer, comment.Issue), 453 - Comment: convert.ToAPIComment(ctx, comment.Issue.Repo, comment), 454 - Repository: convert.ToRepo(ctx, comment.Issue.Repo, permission), 455 - Sender: convert.ToUser(ctx, doer, nil), 456 - IsPull: comment.Issue.IsPull, 459 + Action: api.HookIssueCommentDeleted, 460 + Issue: convert.ToAPIIssue(ctx, doer, comment.Issue), 461 + PullRequest: pullRequest, 462 + Comment: convert.ToAPIComment(ctx, comment.Issue.Repo, comment), 463 + Repository: convert.ToRepo(ctx, comment.Issue.Repo, permission), 464 + Sender: convert.ToUser(ctx, doer, nil), 465 + IsPull: comment.Issue.IsPull, 457 466 }); err != nil { 458 467 log.Error("PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) 459 468 } ··· 525 534 err = PrepareWebhooks(ctx, EventSource{Repository: issue.Repo}, webhook_module.HookEventPullRequestLabel, &api.PullRequestPayload{ 526 535 Action: api.HookIssueLabelUpdated, 527 536 Index: issue.Index, 528 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 537 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 529 538 Repository: convert.ToRepo(ctx, issue.Repo, access_model.Permission{AccessMode: perm.AccessModeOwner}), 530 539 Sender: convert.ToUser(ctx, doer, nil), 531 540 }) ··· 567 576 err = PrepareWebhooks(ctx, EventSource{Repository: issue.Repo}, webhook_module.HookEventPullRequestMilestone, &api.PullRequestPayload{ 568 577 Action: hookAction, 569 578 Index: issue.Index, 570 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 579 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 571 580 Repository: convert.ToRepo(ctx, issue.Repo, permission), 572 581 Sender: convert.ToUser(ctx, doer, nil), 573 582 }) ··· 640 649 // Merge pull request calls issue.changeStatus so we need to handle separately. 641 650 apiPullRequest := &api.PullRequestPayload{ 642 651 Index: pr.Issue.Index, 643 - PullRequest: convert.ToAPIPullRequest(ctx, pr, nil), 652 + PullRequest: convert.ToAPIPullRequest(ctx, pr, doer), 644 653 Repository: convert.ToRepo(ctx, pr.Issue.Repo, permission), 645 654 Sender: convert.ToUser(ctx, doer, nil), 646 655 Action: api.HookIssueClosed, ··· 668 677 From: oldBranch, 669 678 }, 670 679 }, 671 - PullRequest: convert.ToAPIPullRequest(ctx, pr, nil), 680 + PullRequest: convert.ToAPIPullRequest(ctx, pr, doer), 672 681 Repository: convert.ToRepo(ctx, issue.Repo, mode), 673 682 Sender: convert.ToUser(ctx, doer, nil), 674 683 }); err != nil { ··· 703 712 return 704 713 } 705 714 if err := PrepareWebhooks(ctx, EventSource{Repository: review.Issue.Repo}, reviewHookType, &api.PullRequestPayload{ 706 - Action: api.HookIssueReviewed, 707 - Index: review.Issue.Index, 708 - PullRequest: convert.ToAPIPullRequest(ctx, pr, nil), 709 - Repository: convert.ToRepo(ctx, review.Issue.Repo, permission), 710 - Sender: convert.ToUser(ctx, review.Reviewer, nil), 715 + Action: api.HookIssueReviewed, 716 + Index: review.Issue.Index, 717 + PullRequest: convert.ToAPIPullRequest(ctx, pr, review.Reviewer), 718 + RequestedReviewer: convert.ToUser(ctx, review.Reviewer, nil), 719 + Repository: convert.ToRepo(ctx, review.Issue.Repo, permission), 720 + Sender: convert.ToUser(ctx, review.Reviewer, nil), 711 721 Review: &api.ReviewPayload{ 712 722 Type: string(reviewHookType), 713 723 Content: review.Content, ··· 729 739 } 730 740 apiPullRequest := &api.PullRequestPayload{ 731 741 Index: issue.Index, 732 - PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, nil), 742 + PullRequest: convert.ToAPIPullRequest(ctx, issue.PullRequest, doer), 733 743 RequestedReviewer: convert.ToUser(ctx, reviewer, nil), 734 744 Repository: convert.ToRepo(ctx, issue.Repo, permission), 735 745 Sender: convert.ToUser(ctx, doer, nil), ··· 773 783 if err := PrepareWebhooks(ctx, EventSource{Repository: pr.Issue.Repo}, webhook_module.HookEventPullRequestSync, &api.PullRequestPayload{ 774 784 Action: api.HookIssueSynchronized, 775 785 Index: pr.Issue.Index, 776 - PullRequest: convert.ToAPIPullRequest(ctx, pr, nil), 786 + PullRequest: convert.ToAPIPullRequest(ctx, pr, doer), 777 787 Repository: convert.ToRepo(ctx, pr.Issue.Repo, access_model.Permission{AccessMode: perm.AccessModeOwner}), 778 788 Sender: convert.ToUser(ctx, doer, nil), 779 789 }); err != nil {
+41 -17
templates/swagger/v1_json.tmpl
··· 4196 4196 "operationId": "issueSearchIssues", 4197 4197 "parameters": [ 4198 4198 { 4199 + "enum": [ 4200 + "open", 4201 + "closed", 4202 + "all" 4203 + ], 4199 4204 "type": "string", 4200 - "description": "whether issue is open or closed", 4205 + "default": "open", 4206 + "description": "State of the issue", 4201 4207 "name": "state", 4202 4208 "in": "query" 4203 4209 }, 4204 4210 { 4205 4211 "type": "string", 4206 - "description": "comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded", 4212 + "description": "Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded.", 4207 4213 "name": "labels", 4208 4214 "in": "query" 4209 4215 }, 4210 4216 { 4211 4217 "type": "string", 4212 - "description": "comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded", 4218 + "description": "Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded.", 4213 4219 "name": "milestones", 4214 4220 "in": "query" 4215 4221 }, 4216 4222 { 4217 4223 "type": "string", 4218 - "description": "search string", 4224 + "description": "Search string", 4219 4225 "name": "q", 4220 4226 "in": "query" 4221 4227 }, 4222 4228 { 4223 4229 "type": "integer", 4224 4230 "format": "int64", 4225 - "description": "repository to prioritize in the results", 4231 + "description": "Repository ID to prioritize in the results", 4226 4232 "name": "priority_repo_id", 4227 4233 "in": "query" 4228 4234 }, 4229 4235 { 4236 + "enum": [ 4237 + "issues", 4238 + "pulls" 4239 + ], 4230 4240 "type": "string", 4231 - "description": "filter by type (issues / pulls) if set", 4241 + "description": "Filter by issue type", 4232 4242 "name": "type", 4233 4243 "in": "query" 4234 4244 }, 4235 4245 { 4236 4246 "type": "string", 4237 4247 "format": "date-time", 4238 - "description": "Only show notifications updated after the given time. This is a timestamp in RFC 3339 format", 4248 + "description": "Only show issues updated after the given time (RFC 3339 format)", 4239 4249 "name": "since", 4240 4250 "in": "query" 4241 4251 }, 4242 4252 { 4243 4253 "type": "string", 4244 4254 "format": "date-time", 4245 - "description": "Only show notifications updated before the given time. This is a timestamp in RFC 3339 format", 4255 + "description": "Only show issues updated before the given time (RFC 3339 format)", 4246 4256 "name": "before", 4247 4257 "in": "query" 4248 4258 }, 4249 4259 { 4250 4260 "type": "boolean", 4251 - "description": "filter (issues / pulls) assigned to you, default is false", 4261 + "default": false, 4262 + "description": "Filter issues or pulls assigned to the authenticated user", 4252 4263 "name": "assigned", 4253 4264 "in": "query" 4254 4265 }, 4255 4266 { 4256 4267 "type": "boolean", 4257 - "description": "filter (issues / pulls) created by you, default is false", 4268 + "default": false, 4269 + "description": "Filter issues or pulls created by the authenticated user", 4258 4270 "name": "created", 4259 4271 "in": "query" 4260 4272 }, 4261 4273 { 4262 4274 "type": "boolean", 4263 - "description": "filter (issues / pulls) mentioning you, default is false", 4275 + "default": false, 4276 + "description": "Filter issues or pulls mentioning the authenticated user", 4264 4277 "name": "mentioned", 4265 4278 "in": "query" 4266 4279 }, 4267 4280 { 4268 4281 "type": "boolean", 4269 - "description": "filter pulls requesting your review, default is false", 4282 + "default": false, 4283 + "description": "Filter pull requests where the authenticated user's review was requested", 4270 4284 "name": "review_requested", 4271 4285 "in": "query" 4272 4286 }, 4273 4287 { 4274 4288 "type": "boolean", 4275 - "description": "filter pulls reviewed by you, default is false", 4289 + "default": false, 4290 + "description": "Filter pull requests reviewed by the authenticated user", 4276 4291 "name": "reviewed", 4277 4292 "in": "query" 4278 4293 }, 4279 4294 { 4280 4295 "type": "string", 4281 - "description": "filter by owner", 4296 + "description": "Filter by repository owner", 4282 4297 "name": "owner", 4283 4298 "in": "query" 4284 4299 }, 4285 4300 { 4286 4301 "type": "string", 4287 - "description": "filter by team (requires organization owner parameter to be provided)", 4302 + "description": "Filter by team (requires organization owner parameter)", 4288 4303 "name": "team", 4289 4304 "in": "query" 4290 4305 }, 4291 4306 { 4307 + "minimum": 1, 4292 4308 "type": "integer", 4293 - "description": "page number of results to return (1-based)", 4309 + "default": 1, 4310 + "description": "Page number of results to return (1-based)", 4294 4311 "name": "page", 4295 4312 "in": "query" 4296 4313 }, 4297 4314 { 4315 + "minimum": 0, 4298 4316 "type": "integer", 4299 - "description": "page size of results", 4317 + "description": "Number of items per page", 4300 4318 "name": "limit", 4301 4319 "in": "query" 4302 4320 } ··· 4304 4322 "responses": { 4305 4323 "200": { 4306 4324 "$ref": "#/responses/IssueList" 4325 + }, 4326 + "400": { 4327 + "$ref": "#/responses/error" 4328 + }, 4329 + "422": { 4330 + "$ref": "#/responses/validationError" 4307 4331 } 4308 4332 } 4309 4333 }
+2
web_src/js/features/repo-diff-filetree.js
··· 8 8 9 9 const fileTreeView = createApp(DiffFileTree); 10 10 fileTreeView.mount(el); 11 + } 11 12 13 + export function initDiffFileList() { 12 14 const fileListElement = document.getElementById('diff-file-list'); 13 15 if (!fileListElement) return; 14 16
+2 -1
web_src/js/features/repo-diff.js
··· 1 1 import $ from 'jquery'; 2 2 import {initCompReactionSelector} from './comp/ReactionSelector.js'; 3 3 import {initRepoIssueContentHistory} from './repo-issue-content.js'; 4 - import {initDiffFileTree} from './repo-diff-filetree.js'; 4 + import {initDiffFileTree, initDiffFileList} from './repo-diff-filetree.js'; 5 5 import {initDiffCommitSelect} from './repo-diff-commitselect.js'; 6 6 import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.js'; 7 7 import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.js'; ··· 223 223 initRepoDiffConversationForm(); 224 224 if (!$('#diff-file-list').length) return; 225 225 initDiffFileTree(); 226 + initDiffFileList(); 226 227 initDiffCommitSelect(); 227 228 initRepoDiffShowMore(); 228 229 initRepoDiffReviewButton();
+9 -6
web_src/js/features/repo-issue.js
··· 209 209 const path = conversationHolder.getAttribute('data-path'); 210 210 const side = conversationHolder.getAttribute('data-side'); 211 211 const idx = conversationHolder.getAttribute('data-idx'); 212 - const lineType = conversationHolder.closest('tr').getAttribute('data-line-type'); 212 + const lineType = conversationHolder.closest('tr')?.getAttribute('data-line-type'); 213 213 214 - if (lineType === 'same') { 215 - document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).classList.remove('tw-invisible'); 216 - } else { 217 - document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).classList.remove('tw-invisible'); 214 + // the conversation holder could appear either on the "Conversation" page, or the "Files Changed" page 215 + // on the Conversation page, there is no parent "tr", so no need to do anything for "add-code-comment" 216 + if (lineType) { 217 + if (lineType === 'same') { 218 + document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).classList.remove('tw-invisible'); 219 + } else { 220 + document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).classList.remove('tw-invisible'); 221 + } 218 222 } 219 - 220 223 conversationHolder.remove(); 221 224 } 222 225