Files
gitea/modules/structs/issue_comment.go
T
silverwindandbircni fc49368845 feat: Improve Gitea-compatible forge migrations, fix many migration bugs (#39424)
Supports migrating from Gitea-compatible forges like Forgejo and fixes
many migration bugs.

1. Pre-release and `+gitea-` suffixed server versions no longer drop
reviews, reactions and pagination.
2. Review states, dismissals, scoped and archived labels and merge bases
are migrated.
3. Disabled units, external trackers, unavailable release assets, and
GitLab confidential issues and internal notes are skipped.
4. Credentials are only sent to the source host, and `Retry-After` rate
limits are waited out.
5. GitHub migrations of only issues or pull requests, basic auth clones
and dismissed reviews work again.
6. The API returns 404 for releases of a disabled unit and shows
migrated authors as mannequins, replacing the never populated
`original_author` and `original_author_id` fields.

Fixes: https://github.com/go-gitea/gitea/issues/19533
Fixes: https://github.com/go-gitea/gitea/issues/35885
Fixes: https://github.com/go-gitea/gitea/issues/18275
Fixes: https://github.com/go-gitea/gitea/issues/35069
Fixes: https://github.com/go-gitea/gitea/issues/17763
Fixes: https://github.com/go-gitea/gitea/issues/39548
Co-authored-by: bircni <bircni@icloud.com>
2026-10-24 01:15:31 +00:00

97 lines
3.1 KiB
Go

// Copyright 2016 The Gogs Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
import (
"time"
)
// Comment represents a comment on a commit or issue
type Comment struct {
// ID is the unique identifier for the comment
ID int64 `json:"id"`
// HTMLURL is the web URL for viewing the comment
HTMLURL string `json:"html_url"`
// PRURL is the API URL for the pull request (if applicable)
PRURL string `json:"pull_request_url"`
// IssueURL is the API URL for the issue
IssueURL string `json:"issue_url"`
// Poster is the user who posted the comment
Poster *User `json:"user"`
// Body contains the comment text content
Body string `json:"body"`
// Attachments contains files attached to the comment
Attachments []*Attachment `json:"assets"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
Updated time.Time `json:"updated_at"`
}
// CreateIssueCommentOption options for creating a comment on an issue
type CreateIssueCommentOption struct {
// required:true
// Body is the comment text content
Body string `json:"body" binding:"Required"`
}
// EditIssueCommentOption options for editing a comment
type EditIssueCommentOption struct {
// required: true
// Body is the updated comment text content
Body string `json:"body" binding:"Required"`
}
// TimelineComment represents a timeline comment (comment of any type) on a commit or issue
type TimelineComment struct {
// ID is the unique identifier for the timeline comment
ID int64 `json:"id"`
// Type indicates the type of timeline event
Type string `json:"type"`
// HTMLURL is the web URL for viewing the comment
HTMLURL string `json:"html_url"`
// PRURL is the API URL for the pull request (if applicable)
PRURL string `json:"pull_request_url"`
// IssueURL is the API URL for the issue
IssueURL string `json:"issue_url"`
// Poster is the user who created the timeline event
Poster *User `json:"user"`
// Body contains the timeline event content
Body string `json:"body"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
Updated time.Time `json:"updated_at"`
OldProjectID int64 `json:"old_project_id"`
ProjectID int64 `json:"project_id"`
OldMilestone *Milestone `json:"old_milestone"`
Milestone *Milestone `json:"milestone"`
TrackedTime *TrackedTime `json:"tracked_time"`
OldTitle string `json:"old_title"`
NewTitle string `json:"new_title"`
OldRef string `json:"old_ref"`
NewRef string `json:"new_ref"`
RefIssue *Issue `json:"ref_issue"`
RefComment *Comment `json:"ref_comment"`
RefAction string `json:"ref_action"`
// commit SHA where issue/PR was referenced
RefCommitSHA string `json:"ref_commit_sha"`
ReviewID int64 `json:"review_id"`
Label *Label `json:"label"`
Assignee *User `json:"assignee"`
AssigneeTeam *Team `json:"assignee_team"`
// whether the assignees were removed or added
RemovedAssignee bool `json:"removed_assignee"`
ResolveDoer *User `json:"resolve_doer"`
DependentIssue *Issue `json:"dependent_issue"`
}