mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix: seed issue create from --template, edit and delete inline review comments, explain workflow run refs (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
9 files changed
+122
-21
No files matched your search
@@ -61,6 +61,17 @@ func (s Comments) Page(ctx context.Context, n int64, limit, page int) ([]Comment
|
||||
return pageOf(items, limit, page)
|
||||
}
|
||||
|
||||
// NotPlainCommentError reports a comment that the single-comment endpoint answers with no body,
|
||||
// such as an inline review comment. Such comments can still be edited and deleted by ID.
|
||||
type NotPlainCommentError struct {
|
||||
ID int64
|
||||
Repository string
|
||||
}
|
||||
|
||||
func (e NotPlainCommentError) Error() string {
|
||||
return fmt.Sprintf("comment %d in %s is not a plain comment, such as an inline review comment, which this command cannot show", e.ID, e.Repository)
|
||||
}
|
||||
|
||||
// View retrieves a comment by its repository-scoped ID.
|
||||
func (s Comments) View(ctx context.Context, id int64) (Comment, error) {
|
||||
status := 0
|
||||
@@ -73,7 +84,7 @@ func (s Comments) View(ctx context.Context, id int64) (Comment, error) {
|
||||
})
|
||||
if status == http.StatusNoContent {
|
||||
// Gitea answers without a body for the comments that are not plain ones, such as inline review comments.
|
||||
return Comment{}, fmt.Errorf("comment %d in %s is not a plain comment, such as an inline review comment, which this command cannot show", id, s.Repository)
|
||||
return Comment{}, NotPlainCommentError{ID: id, Repository: s.Repository}
|
||||
}
|
||||
return item, Classify(err, "comment", strconv.FormatInt(id, 10), s.Repository)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user