Skip to content

Commit

Permalink
fix(repo/sync): use PATCH over GET
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Oct 27, 2023
1 parent d4124d4 commit 8cf6e9b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835
github.com/coreos/go-semver v0.3.1
github.com/gin-gonic/gin v1.9.1
github.com/go-vela/server v0.21.0
github.com/go-vela/types v0.21.0
github.com/go-vela/server v0.21.1-0.20231027153048-e12a3dd81823
github.com/go-vela/types v0.21.1-0.20231024201126-19101a5b1346
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/google/go-cmp v0.5.9
github.com/google/go-querystring v1.1.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-vela/server v0.21.0 h1:tBSUMp1rni2i1wOzP2uxh7o6uTkzjrYfRe0fKJBOcNA=
github.com/go-vela/server v0.21.0/go.mod h1:3pp/hg5NUZ6VbbDC6JO97H7Ry7vv/qKA8GpWsaUpZ1M=
github.com/go-vela/types v0.21.0 h1:yZrVUw4jKO0JHaUBkOIZZdniDGyDOpTMbKriemdm1jg=
github.com/go-vela/types v0.21.0/go.mod h1:Jn8K28uj7mACc55fkFgaIzL0q45iXydOFGEeoSeHUtQ=
github.com/go-vela/server v0.21.1-0.20231027153048-e12a3dd81823 h1:MMXjm5eKh5MAwe/p1vOu3vC7X0qC1WJ8mBqQ2PrmN7s=
github.com/go-vela/server v0.21.1-0.20231027153048-e12a3dd81823/go.mod h1:1nQQLHtK1EJWW/0sQ/62ryYsg4OccDt8JRmbzoIe+IA=
github.com/go-vela/types v0.21.1-0.20231024201126-19101a5b1346 h1:8VqRJ02KcAxV+gHuxLzuPuNaf7EOE/zfBomEV+UPj/E=
github.com/go-vela/types v0.21.1-0.20231024201126-19101a5b1346/go.mod h1:Jn8K28uj7mACc55fkFgaIzL0q45iXydOFGEeoSeHUtQ=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
Expand Down
4 changes: 2 additions & 2 deletions vela/scm.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type SCMService service
func (svc *SCMService) Sync(org, repo string) (*string, *Response, error) {
u := fmt.Sprintf("/api/v1/scm/repos/%s/%s/sync", org, repo)
v := new(string)
resp, err := svc.client.Call("GET", u, nil, v)
resp, err := svc.client.Call("PATCH", u, nil, v)

return v, resp, err
}
Expand All @@ -23,7 +23,7 @@ func (svc *SCMService) Sync(org, repo string) (*string, *Response, error) {
func (svc *SCMService) SyncAll(org string) (*string, *Response, error) {
u := fmt.Sprintf("/api/v1/scm/orgs/%s/sync", org)
v := new(string)
resp, err := svc.client.Call("GET", u, nil, v)
resp, err := svc.client.Call("PATCH", u, nil, v)

return v, resp, err
}

0 comments on commit 8cf6e9b

Please sign in to comment.