Skip to content

Commit b7805db

Browse files
feat: Add repository contributors updates (#392)
* Add repository contributors updates Will help with contributor program workflow * fix test
1 parent fb8a736 commit b7805db

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ require (
4444
github.com/olekukonko/tablewriter v0.0.5
4545
github.com/packethost/packngo v0.29.0
4646
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
47-
github.com/pluralsh/gqlclient v1.3.13
47+
github.com/pluralsh/gqlclient v1.3.14
4848
github.com/pluralsh/plural-operator v0.5.3
4949
github.com/pluralsh/polly v0.1.1
5050
github.com/rodaine/hclencoder v0.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
899899
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
900900
github.com/pluralsh/controller-reconcile-helper v0.0.4 h1:1o+7qYSyoeqKFjx+WgQTxDz4Q2VMpzprJIIKShxqG0E=
901901
github.com/pluralsh/controller-reconcile-helper v0.0.4/go.mod h1:AfY0gtteD6veBjmB6jiRx/aR4yevEf6K0M13/pGan/s=
902-
github.com/pluralsh/gqlclient v1.3.13 h1:ihix+ruoIkwiVdPnvJecrsxrVYEKTG26JFHPiF36O3U=
903-
github.com/pluralsh/gqlclient v1.3.13/go.mod h1:z1qHnvPeqIN/a+5OzFs40e6HI6tDxzh1+yJuEpvqGy4=
902+
github.com/pluralsh/gqlclient v1.3.14 h1:MX3odnIfPSYT9PysegKkC31w/Vn8PZhrT/rZXZck/yU=
903+
github.com/pluralsh/gqlclient v1.3.14/go.mod h1:z1qHnvPeqIN/a+5OzFs40e6HI6tDxzh1+yJuEpvqGy4=
904904
github.com/pluralsh/oauth v0.9.2 h1:tM9hBK4tCnJUeCOgX0ctxBBCS3hiCDPoxkJLODtedmQ=
905905
github.com/pluralsh/oauth v0.9.2/go.mod h1:aTUw/75rzcsbvW+/TLvWtHVDXFIdtFrDtUncOq9vHyM=
906906
github.com/pluralsh/plural-operator v0.5.3 h1:GaPL3LgimfzKZNHt7zXzqYZpb0hgyW9noHYnkA+rqNs=

pkg/api/repos.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type RepositoryInput struct {
5252
Icon string `json:"icon,omitempty" yaml:"icon"`
5353
DarkIcon string `json:"darkIcon,omitempty" yaml:"darkIcon"`
5454
Docs string `json:"docs,omitempty" yaml:"docs"`
55+
Contributors []string
5556
Category string
5657
Notes string `json:"notes,omitempty" yaml:"notes"`
5758
GitUrl string `json:"gitUrl" yaml:"gitUrl"`
@@ -275,6 +276,7 @@ func ConstructGqlClientRepositoryInput(marshalled []byte) (*gqlclient.Repository
275276
DarkIcon: &repoInput.DarkIcon,
276277
Description: &repoInput.Description,
277278
ReleaseStatus: releaseStatus,
279+
Contributors: lo.ToSlicePtr(repoInput.Contributors),
278280
GitURL: &repoInput.GitUrl,
279281
Homepage: &repoInput.Homepage,
280282
Icon: &repoInput.Icon,

pkg/api/repos_test.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"github.com/pluralsh/gqlclient"
77
"github.com/pluralsh/plural/pkg/api"
8+
"github.com/samber/lo"
89

910
"github.com/stretchr/testify/assert"
1011
)
@@ -26,15 +27,16 @@ func TestConstructGqlClientRepositoryInput(t *testing.T) {
2627
{
2728
name: `test repository.yaml conversion`,
2829
expected: &gqlclient.RepositoryAttributes{
29-
Category: &devopsCategory,
30-
DarkIcon: &emptyString,
31-
Description: &testDescription,
32-
GitURL: &emptyString,
33-
Homepage: &emptyString,
34-
Icon: &icon,
35-
Name: &name,
36-
Notes: &notes,
37-
Docs: &emptyString,
30+
Category: &devopsCategory,
31+
DarkIcon: &emptyString,
32+
Description: &testDescription,
33+
GitURL: &emptyString,
34+
Homepage: &emptyString,
35+
Contributors: lo.ToSlicePtr([]string{"someone@email.com"}),
36+
Icon: &icon,
37+
Name: &name,
38+
Notes: &notes,
39+
Docs: &emptyString,
3840
OauthSettings: &gqlclient.OauthSettingsAttributes{
3941
AuthMethod: "POST",
4042
URIFormat: "https://{domain}/oauth2/callback",
@@ -55,6 +57,8 @@ category: DEVOPS
5557
private: true
5658
icon: plural/icons/test.png
5759
notes: plural/notes.tpl
60+
contributors:
61+
- someone@email.com
5862
oauthSettings:
5963
uriFormat: https://{domain}/oauth2/callback
6064
authMethod: POST

0 commit comments

Comments
 (0)