mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-03 14:18:42 +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.
|
// PipelineQueue returns a list of enqueued pipelines.
|
||||||
func (c *client) PipelineQueue() ([]*Activity, error) {
|
func (c *client) PipelineQueue() ([]*Feed, error) {
|
||||||
var out []*Activity
|
var out []*Feed
|
||||||
uri := fmt.Sprintf(pathPipelineQueue, c.addr)
|
uri := fmt.Sprintf(pathPipelineQueue, c.addr)
|
||||||
err := c.get(uri, &out)
|
err := c.get(uri, &out)
|
||||||
return out, err
|
return out, err
|
||||||
|
|
|
@ -88,7 +88,7 @@ type Client interface {
|
||||||
PipelineList(repoID int64) ([]*Pipeline, error)
|
PipelineList(repoID int64) ([]*Pipeline, error)
|
||||||
|
|
||||||
// PipelineQueue returns a list of enqueued pipelines.
|
// PipelineQueue returns a list of enqueued pipelines.
|
||||||
PipelineQueue() ([]*Activity, error)
|
PipelineQueue() ([]*Feed, error)
|
||||||
|
|
||||||
// PipelineCreate returns creates a pipeline on specified branch.
|
// PipelineCreate returns creates a pipeline on specified branch.
|
||||||
PipelineCreate(repoID int64, opts *PipelineOptions) (*Pipeline, error)
|
PipelineCreate(repoID int64, opts *PipelineOptions) (*Pipeline, error)
|
||||||
|
|
|
@ -139,12 +139,11 @@ type (
|
||||||
Events []string `json:"events"`
|
Events []string `json:"events"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activity represents an item in the user's feed or timeline.
|
// Feed represents an item in the user's feed or timeline.
|
||||||
Activity struct {
|
Feed struct {
|
||||||
Owner string `json:"owner"`
|
RepoID int64 `json:"repo_id"`
|
||||||
Name string `json:"name"`
|
ID int64 `json:"id,omitempty"`
|
||||||
FullName string `json:"full_name"`
|
Number int64 `json:"number,omitempty"`
|
||||||
Number int `json:"number,omitempty"`
|
|
||||||
Event string `json:"event,omitempty"`
|
Event string `json:"event,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
Created int64 `json:"created_at,omitempty"`
|
Created int64 `json:"created_at,omitempty"`
|
||||||
|
@ -154,7 +153,7 @@ type (
|
||||||
Branch string `json:"branch,omitempty"`
|
Branch string `json:"branch,omitempty"`
|
||||||
Ref string `json:"ref,omitempty"`
|
Ref string `json:"ref,omitempty"`
|
||||||
Refspec string `json:"refspec,omitempty"`
|
Refspec string `json:"refspec,omitempty"`
|
||||||
CloneURL string `json:"clone_url,omitempty"`
|
Remote string `json:"remote,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
Author string `json:"author,omitempty"`
|
Author string `json:"author,omitempty"`
|
||||||
|
|
Loading…
Reference in a new issue