Add tests for pull request's content_version in API (#37044)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
wxiaoguang
2026-03-31 01:28:45 +08:00
committed by GitHub
parent 9bb0aa1c49
commit daf581fa89
5 changed files with 72 additions and 9 deletions

View File

@@ -80,7 +80,8 @@ type Issue struct {
PullRequest *PullRequestMeta `json:"pull_request"`
Repo *RepositoryMeta `json:"repository"`
PinOrder int `json:"pin_order"`
PinOrder int `json:"pin_order"`
// The version of the issue content for optimistic locking
ContentVersion int `json:"content_version"`
}
@@ -115,7 +116,8 @@ type EditIssueOption struct {
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
RemoveDeadline *bool `json:"unset_due_date"`
ContentVersion *int `json:"content_version"`
// The current version of the issue content to detect conflicts during editing
ContentVersion *int `json:"content_version"`
}
// EditDeadlineOption options for creating a deadline

View File

@@ -90,7 +90,8 @@ type PullRequest struct {
Closed *time.Time `json:"closed_at"`
// The pin order for the pull request
PinOrder int `json:"pin_order"`
PinOrder int `json:"pin_order"`
// The version of the pull request content for optimistic locking
ContentVersion int `json:"content_version"`
}
@@ -169,7 +170,8 @@ type EditPullRequestOption struct {
RemoveDeadline *bool `json:"unset_due_date"`
// Whether to allow maintainer edits
AllowMaintainerEdit *bool `json:"allow_maintainer_edit"`
ContentVersion *int `json:"content_version"`
// The current version of the pull request content to detect conflicts during editing
ContentVersion *int `json:"content_version"`
}
// ChangedFile store information about files affected by the pull request