Skip to content

Commit

Permalink
Merge pull request #117 from souleb/update_providers
Browse files Browse the repository at this point in the history
Updates Git SaaS providers
  • Loading branch information
stefanprodan authored Oct 26, 2021
2 parents 3ad537f + 8987be1 commit 5539357
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 55 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
run: |
[ -n "${{ secrets.GITLAB_TOKEN }}" ] && export GITLAB_TOKEN=${{ secrets.GITLAB_TOKEN }} || echo "using default GITLAB_TOKEN"
[ -n "${{ secrets.GITPROVIDER_BOT_TOKEN }}" ] && export GITHUB_TOKEN=${{ secrets.GITPROVIDER_BOT_TOKEN }} || echo "using default GITHUB_TOKEN"
[ -n "${{ secrets.GIT_PROVIDER_USER }}" ] && export GIT_PROVIDER_USER=${{ secrets.GIT_PROVIDER_USER }} || echo "using default GIT_PROVIDER_USER"
[ -n "${{ secrets.GIT_PROVIDER_ORGANIZATION }}" ] && export GIT_PROVIDER_ORGANIZATION=${{ secrets.GIT_PROVIDER_ORGANIZATION }} || echo "using default GIT_PROVIDER_ORGANIZATION"
[ -n "${{ secrets.GITLAB_TEST_TEAM_NAME }}" ] && export GITLAB_TEST_TEAM_NAME=${{ secrets.GITLAB_TEST_TEAM_NAME }} || echo "using default GITLAB_TEST_TEAM_NAME"
[ -n "${{ secrets.GITLAB_TEST_SUBGROUP }}" ] && export GITLAB_TEST_SUBGROUP=${{ secrets.GITLAB_TEST_SUBGROUP }} || echo "using default GITLAB_TEST_SUBGROUP"
Expand Down
2 changes: 1 addition & 1 deletion github/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package github
import (
"fmt"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
4 changes: 2 additions & 2 deletions github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"strings"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (c *Client) ProviderID() gitprovider.ProviderID {
return ProviderID
}

// Raw returns the Go GitHub client (github.com/google/go-github/v32/github *Client)
// Raw returns the Go GitHub client (github.com/google/go-github/v35/github *Client)
// used under the hood for accessing GitHub.
func (c *Client) Raw() interface{} {
return c.c.Client()
Expand Down
2 changes: 1 addition & 1 deletion github/client_organization_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package github
import (
"context"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/client_repositories_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
3 changes: 2 additions & 1 deletion github/client_repository_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ package github

import (
"context"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

// BranchClient implements the gitprovider.BranchClient interface.
Expand Down
3 changes: 2 additions & 1 deletion github/client_repository_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package github
import (
"context"
"fmt"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

var githubNewFileMode = "100644"
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

// PullRequestClient implements the gitprovider.PullRequestClient interface.
Expand Down
2 changes: 1 addition & 1 deletion github/example_organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/fluxcd/go-git-providers/github"
"github.com/fluxcd/go-git-providers/gitprovider"
gogithub "github.com/google/go-github/v32/github"
gogithub "github.com/google/go-github/v35/github"
)

// checkErr is used for examples in this repository.
Expand Down
2 changes: 1 addition & 1 deletion github/example_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/fluxcd/go-git-providers/github"
"github.com/fluxcd/go-git-providers/gitprovider"
gogithub "github.com/google/go-github/v32/github"
gogithub "github.com/google/go-github/v35/github"
)

func ExampleOrgRepositoriesClient_Get() {
Expand Down
4 changes: 2 additions & 2 deletions github/githubclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

// githubClientImpl is a wrapper around *github.Client, which implements higher-level methods,
Expand Down Expand Up @@ -356,7 +356,7 @@ func (c *githubClientImpl) GetTeamPermissions(ctx context.Context, orgName, repo
if apiObj.Permissions == nil {
return nil, fmt.Errorf("didn't expect permissions to be nil for team: %+v: %w", apiObj, gitprovider.ErrInvalidServerData)
}
return *apiObj.Permissions, nil
return apiObj.Permissions, nil
}

func (c *githubClientImpl) ListRepoTeams(ctx context.Context, orgName, repo string) ([]*github.Team, error) {
Expand Down
2 changes: 1 addition & 1 deletion github/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"testing"
"time"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
"github.com/gregjones/httpcache"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package github

import (
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"reflect"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package github

import (
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package github

import (
"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

func newPullRequest(ctx *clientContext, apiObj *github.PullRequest) *pullrequest {
Expand Down
2 changes: 1 addition & 1 deletion github/resource_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"errors"
"reflect"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"net/http"

"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
"github.com/google/go-github/v32/github"
"github.com/google/go-github/v35/github"
)

func Test_validateAPIObject(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion gitlab/gitlabclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c *gitlabClientImpl) Client() *gitlab.Client {
}

func (c *gitlabClientImpl) GetGroup(ctx context.Context, groupID interface{}) (*gitlab.Group, error) {
apiObj, _, err := c.c.Groups.GetGroup(groupID, gitlab.WithContext(ctx))
apiObj, _, err := c.c.Groups.GetGroup(groupID, nil, gitlab.WithContext(ctx))
if err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ require (
github.com/go-git/go-git/v5 v5.4.2
github.com/go-logr/logr v1.1.0
github.com/go-logr/zapr v1.1.0
github.com/google/go-cmp v0.4.0
github.com/google/go-github/v32 v32.1.0
github.com/google/go-cmp v0.5.6
github.com/google/go-github/v35 v35.3.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-retryablehttp v0.6.4
github.com/ktrysmt/go-bitbucket v0.6.2
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/ktrysmt/go-bitbucket v0.9.28
github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1
github.com/xanzy/go-gitlab v0.43.0
github.com/xanzy/go-gitlab v0.51.1
go.uber.org/zap v1.19.0
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
Expand Down
26 changes: 15 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II=
github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho=
github.com/google/go-github/v35 v35.3.0/go.mod h1:yWB7uCcVWaUbUP74Aq3whuMySRMatyRmq5U9FTNlbio=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
Expand All @@ -65,8 +66,8 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4 h1:BbgctKO892xEyOXnGiaAwIoSq1QZ/SS4AhjoAh9DnfY=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs=
github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand All @@ -87,8 +88,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/ktrysmt/go-bitbucket v0.6.2 h1:FuDwvMw5f3Omccuz5T2T9MT3huSoLPXtA6E3bM0SsD4=
github.com/ktrysmt/go-bitbucket v0.6.2/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4=
github.com/ktrysmt/go-bitbucket v0.9.28 h1:lZw+jZczXPKO8O2da04iM3gJpK41OfLFkK1D/uW5kGw=
github.com/ktrysmt/go-bitbucket v0.9.28/go.mod h1:FWxy2UK7GlK5b0NSJGc5hPqnssVlkNnsChvyuOf/Xno=
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
Expand Down Expand Up @@ -122,10 +123,11 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/xanzy/go-gitlab v0.43.0 h1:rpOZQjxVJGW/ch+Jy4j7W4o7BB1mxkXJNVGuplZ7PUs=
github.com/xanzy/go-gitlab v0.43.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.51.1 h1:wWKLalwx4omxFoHh3PLs9zDgAD4GXDP/uoxwMRCSiWM=
github.com/xanzy/go-gitlab v0.51.1/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE=
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand All @@ -140,6 +142,7 @@ go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
Expand All @@ -149,12 +152,12 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
Expand All @@ -165,10 +168,10 @@ golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAG
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -183,6 +186,7 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
12 changes: 6 additions & 6 deletions stash/integration_repositories_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ var _ = Describe("Stash Provider", func() {
// Expect high-level fields to match their underlying data
internal := repo.APIObject().(*Repository)
Expect(repo.Repository().GetRepository()).To(Equal(internal.Name))
Expect(repo.Repository().GetIdentity()).To(Equal(testUserName))
Expect(repo.Repository().GetIdentity()).To(Equal(stashUser))
if !internal.Public {
Expect(*info.Visibility).To(Equal(gitprovider.RepositoryVisibilityPrivate))
}
}

It("should be possible to create a user repo", func() {
// First, check what repositories are available
repos, err := client.UserRepositories().List(ctx, newUserRef(testUserName))
repos, err := client.UserRepositories().List(ctx, newUserRef(stashUser))
Expect(err).ToNot(HaveOccurred())

// Generate a repository name which doesn't exist already
Expand All @@ -62,7 +62,7 @@ var _ = Describe("Stash Provider", func() {
fmt.Print("Creating repository ", testRepoName, "...")
// We know that a repo with this name doesn't exist in the organization, let's verify we get an
// ErrNotFound
repoRef := newUserRepoRef(testUserName, testRepoName)
repoRef := newUserRepoRef(stashUser, testRepoName)
_, err = client.UserRepositories().Get(ctx, repoRef)
Expect(err).To(MatchError(gitprovider.ErrNotFound))

Expand Down Expand Up @@ -91,7 +91,7 @@ var _ = Describe("Stash Provider", func() {
})

It("should error at creation time if the user repo already does exist", func() {
repoRef := newUserRepoRef(testUserName, testRepoName)
repoRef := newUserRepoRef(stashUser, testRepoName)
_, err := client.UserRepositories().Get(ctx, repoRef)
Expect(err).ToNot(HaveOccurred())

Expand All @@ -101,7 +101,7 @@ var _ = Describe("Stash Provider", func() {

It("should update if the user repo already exists when reconciling", func() {
// get the repo first to be sure to get the slug
repoRef := newUserRepoRef(testUserName, testRepoName)
repoRef := newUserRepoRef(stashUser, testRepoName)
repo, err := client.UserRepositories().Get(ctx, repoRef)
Expect(err).ToNot(HaveOccurred())
// No-op reconcile
Expand Down Expand Up @@ -153,7 +153,7 @@ var _ = Describe("Stash Provider", func() {

It("should be possible to create a pr for a user repository", func() {
testRepoName = fmt.Sprintf("test-user-repo2-%03d", rand.Intn(1000))
repoRef := newUserRepoRef(testUserName, testRepoName)
repoRef := newUserRepoRef(stashUser, testRepoName)

defaultBranch := "master"
description := "test description"
Expand Down
Loading

0 comments on commit 5539357

Please sign in to comment.