mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-01 22:31:15 +00:00
Merge branch 'origin/main' into 'next-release/main'
This commit is contained in:
commit
4a7dadebc7
2 changed files with 18 additions and 8 deletions
|
@ -362,7 +362,6 @@ func GetRepoPermissions(c *gin.Context) {
|
||||||
func GetRepoBranches(c *gin.Context) {
|
func GetRepoBranches(c *gin.Context) {
|
||||||
_store := store.FromContext(c)
|
_store := store.FromContext(c)
|
||||||
repo := session.Repo(c)
|
repo := session.Repo(c)
|
||||||
user := session.User(c)
|
|
||||||
_forge, err := server.Config.Services.Manager.ForgeFromRepo(repo)
|
_forge, err := server.Config.Services.Manager.ForgeFromRepo(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Cannot get forge from repo")
|
log.Error().Err(err).Msg("Cannot get forge from repo")
|
||||||
|
@ -370,9 +369,15 @@ func GetRepoBranches(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forge.Refresh(c, _forge, _store, user)
|
repoUser, err := _store.GetUser(repo.UserID)
|
||||||
|
if err != nil {
|
||||||
|
handleDBError(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
branches, err := _forge.Branches(c, user, repo, session.Pagination(c))
|
forge.Refresh(c, _forge, _store, repoUser)
|
||||||
|
|
||||||
|
branches, err := _forge.Branches(c, repoUser, repo, session.Pagination(c))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("failed to load branches")
|
log.Error().Err(err).Msg("failed to load branches")
|
||||||
c.String(http.StatusInternalServerError, "failed to load branches: %s", err)
|
c.String(http.StatusInternalServerError, "failed to load branches: %s", err)
|
||||||
|
@ -396,7 +401,6 @@ func GetRepoBranches(c *gin.Context) {
|
||||||
func GetRepoPullRequests(c *gin.Context) {
|
func GetRepoPullRequests(c *gin.Context) {
|
||||||
_store := store.FromContext(c)
|
_store := store.FromContext(c)
|
||||||
repo := session.Repo(c)
|
repo := session.Repo(c)
|
||||||
user := session.User(c)
|
|
||||||
_forge, err := server.Config.Services.Manager.ForgeFromRepo(repo)
|
_forge, err := server.Config.Services.Manager.ForgeFromRepo(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Cannot get forge from repo")
|
log.Error().Err(err).Msg("Cannot get forge from repo")
|
||||||
|
@ -404,9 +408,15 @@ func GetRepoPullRequests(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forge.Refresh(c, _forge, _store, user)
|
repoUser, err := _store.GetUser(repo.UserID)
|
||||||
|
if err != nil {
|
||||||
|
handleDBError(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
prs, err := _forge.PullRequests(c, user, repo, session.Pagination(c))
|
forge.Refresh(c, _forge, _store, repoUser)
|
||||||
|
|
||||||
|
prs, err := _forge.PullRequests(c, repoUser, repo, session.Pagination(c))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
|
|
|
@ -42,8 +42,8 @@ type Pipeline struct {
|
||||||
Message string `json:"message" xorm:"TEXT 'message'"`
|
Message string `json:"message" xorm:"TEXT 'message'"`
|
||||||
Timestamp int64 `json:"timestamp" xorm:"'timestamp'"`
|
Timestamp int64 `json:"timestamp" xorm:"'timestamp'"`
|
||||||
Sender string `json:"sender" xorm:"sender"` // uses reported user for webhooks and name of cron for cron pipelines
|
Sender string `json:"sender" xorm:"sender"` // uses reported user for webhooks and name of cron for cron pipelines
|
||||||
Avatar string `json:"author_avatar" xorm:"avatar"`
|
Avatar string `json:"author_avatar" xorm:"varchar(500) avatar"`
|
||||||
Email string `json:"author_email" xorm:"email"`
|
Email string `json:"author_email" xorm:"varchar(500) email"`
|
||||||
ForgeURL string `json:"forge_url" xorm:"forge_url"`
|
ForgeURL string `json:"forge_url" xorm:"forge_url"`
|
||||||
Reviewer string `json:"reviewed_by" xorm:"reviewer"`
|
Reviewer string `json:"reviewed_by" xorm:"reviewer"`
|
||||||
Reviewed int64 `json:"reviewed" xorm:"reviewed"`
|
Reviewed int64 `json:"reviewed" xorm:"reviewed"`
|
||||||
|
|
Loading…
Reference in a new issue