frontend: show submittable status and URL, add runner, revamp logging
This commit is contained in:
parent
43f8205e85
commit
057294830e
7 changed files with 186 additions and 56 deletions
|
@ -17,13 +17,15 @@ type IClient interface {
|
|||
SubmitChangeset(changeset *Changeset) (*Changeset, error)
|
||||
RebaseChangeset(changeset *Changeset, ref string) (*Changeset, error)
|
||||
RemoveTag(changeset *Changeset, tag string) (*Changeset, error)
|
||||
GetBaseURL() string
|
||||
}
|
||||
|
||||
var _ IClient = &Client{}
|
||||
|
||||
// Client provides some ways to interact with a gerrit instance
|
||||
type Client struct {
|
||||
client *goGerrit.Client
|
||||
client *goGerrit.Client
|
||||
baseURL string
|
||||
}
|
||||
|
||||
// NewClient initializes a new gerrit client
|
||||
|
@ -38,7 +40,10 @@ func NewClient(URL, username, password string) (*Client, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Client{client: goGerritClient}, nil
|
||||
return &Client{
|
||||
client: goGerritClient,
|
||||
baseURL: URL,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SearchChangesets fetches a list of changesets matching a passed query string
|
||||
|
@ -117,3 +122,8 @@ func (gerrit *Client) RemoveTag(changeset *Changeset, tag string) (*Changeset, e
|
|||
// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-hashtags
|
||||
return changeset, nil
|
||||
}
|
||||
|
||||
// GetBaseURL returns the gerrit base URL
|
||||
func (gerrit *Client) GetBaseURL() string {
|
||||
return gerrit.baseURL
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue