-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an API to set generic Pull-Request sidebar content #23783
Comments
looks |
For this example use case about reporting test coverage of a PR, isn't commit status suited for that? https://try.gitea.io/api/swagger#/repository/repoCreateStatus |
I think it's insufficient. It can only show success/error/warning etc, which is fine for cases where you want strict coverage, e.g. only success a PR if coverage increases. But for detailed reporting like CodeCov does as comments currently on GitHub, it's not enough. |
We need an standard API to store the coverage stats results. We can have a summary in the sidebar of pull request. And even more, we can display every file's coverage in pull request file view or commit file view. |
It could be generalized as "PR Metadata" and "PR file metadata" on the API. Thought I guess if we want to integrate deeply and show progress bars and such, there is no way around specifically supporting the coverage use case with specific APIs tailored to it. |
Just like commit status API, it will stick owner_name/repo_name and commit SHA, but not associated with a special PR. Because you don't know which model users will use with Gitea. |
I think the some tips about do it:
type ChekRun struct {
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"INDEX UNIQUE(repo_sha_index)"`
Repo *repo_model.Repository `xorm:"-"`
State int64 // difference with `CommitStatus`
Conclusion int64 // difference with `CommitStatus`
SHA string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"`
TargetURL string `xorm:"TEXT"`
NameHash string `xorm:"char(40) index"`
Name string `xorm:"TEXT"`
Creator *user_model.User `xorm:"-"`
CreatorID int64
StartAt timeutil.TimeStamp // difference with `CommitStatus`
CompletedAt timeutil.TimeStamp // difference with `CommitStatus`
OutPut *ChekRunOutPut `xorm:"-"` // difference with `CommitStatus`
Actions []ChekRunAction `xorm:"-"` // difference with `CommitStatus`
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}
type ChekRunAnnotation struct {
Path string
StartLine int64
EndLine int64
StartColumn int64
EndColumn int64
AnnotationLevel string
Message string
Title string
RawDetails string
}
type ChekRunOutPut struct {
ID int64 `xorm:"pk autoincr"`
ChekcRunID int64 `xorm:"INDEX"`
Title string
Summary string
Text string
Annotations []ChekRunAnnotation `xorm:"JSON"`
}
type ChekRunAction struct {
ID int64 `xorm:"pk autoincr"`
ChekcRunID int64 `xorm:"INDEX"`
Label string
Description string
Identifier string
Url string
} |
Feature Description
It'd be nice if we could offer a API where third-party integrations like code coverage could create sidebar content into a PR, like for example coverage.
I could see it accepting something like
details
and maybevalue
could accept Markdown.details
content could be used to display a popup on mouseover that shows detailed content.Related:
https://app.codecov.io/gh/feedback/p/support-gitea-scm
#23746 (comment)
The text was updated successfully, but these errors were encountered: