mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-22 08:27:06 +00:00
Woodpecker-go: Use Feed instead Activity (#2690)
The models had gotten out of sync. Use the same definition ~to avoid them getting out of sync in the future~. Closes https://github.com/woodpecker-ci/woodpecker/issues/2679
This commit is contained in:
parent
bde9f97407
commit
97f04449a4
3 changed files with 9 additions and 10 deletions
|
@ -251,8 +251,8 @@ func (c *client) PipelineCreate(repoID int64, options *PipelineOptions) (*Pipeli
|
|||
}
|
||||
|
||||
// PipelineQueue returns a list of enqueued pipelines.
|
||||
func (c *client) PipelineQueue() ([]*Activity, error) {
|
||||
var out []*Activity
|
||||
func (c *client) PipelineQueue() ([]*Feed, error) {
|
||||
var out []*Feed
|
||||
uri := fmt.Sprintf(pathPipelineQueue, c.addr)
|
||||
err := c.get(uri, &out)
|
||||
return out, err
|
||||
|
|
|
@ -88,7 +88,7 @@ type Client interface {
|
|||
PipelineList(repoID int64) ([]*Pipeline, error)
|
||||
|
||||
// PipelineQueue returns a list of enqueued pipelines.
|
||||
PipelineQueue() ([]*Activity, error)
|
||||
PipelineQueue() ([]*Feed, error)
|
||||
|
||||
// PipelineCreate returns creates a pipeline on specified branch.
|
||||
PipelineCreate(repoID int64, opts *PipelineOptions) (*Pipeline, error)
|
||||
|
|
|
@ -139,12 +139,11 @@ type (
|
|||
Events []string `json:"events"`
|
||||
}
|
||||
|
||||
// Activity represents an item in the user's feed or timeline.
|
||||
Activity struct {
|
||||
Owner string `json:"owner"`
|
||||
Name string `json:"name"`
|
||||
FullName string `json:"full_name"`
|
||||
Number int `json:"number,omitempty"`
|
||||
// Feed represents an item in the user's feed or timeline.
|
||||
Feed struct {
|
||||
RepoID int64 `json:"repo_id"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Number int64 `json:"number,omitempty"`
|
||||
Event string `json:"event,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Created int64 `json:"created_at,omitempty"`
|
||||
|
@ -154,7 +153,7 @@ type (
|
|||
Branch string `json:"branch,omitempty"`
|
||||
Ref string `json:"ref,omitempty"`
|
||||
Refspec string `json:"refspec,omitempty"`
|
||||
CloneURL string `json:"clone_url,omitempty"`
|
||||
Remote string `json:"remote,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Author string `json:"author,omitempty"`
|
||||
|
|
Loading…
Reference in a new issue