Skip to content

Commit

Permalink
Woodpecker-go: Use model.Feed instead Activity
Browse files Browse the repository at this point in the history
The models had gotten out of sync.
Use the same definition to avoid them getting out of sync in the future.

Closes #2679
  • Loading branch information
runephilosof-karnovgroup committed Nov 1, 2023
1 parent 9028776 commit ea06ed0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions woodpecker-go/woodpecker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion woodpecker-go/woodpecker/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 6 additions & 7 deletions woodpecker-go/woodpecker/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down

0 comments on commit ea06ed0

Please sign in to comment.