Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand All @@ -70,6 +72,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run LanguageTool
uses: reviewdog/action-languagetool@v1
with:
Expand Down Expand Up @@ -108,6 +112,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: setup env
run: . ./hack/ci/setup-env.sh
- id: set-matrix-app
Expand All @@ -133,6 +139,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand All @@ -155,6 +163,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand All @@ -177,6 +187,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand All @@ -195,6 +207,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand All @@ -219,6 +233,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
run: |
. ./hack/ci/setup-env.sh
Expand Down
18 changes: 9 additions & 9 deletions pkg/hub/client/local/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewDefaultClient(endpoint string, opts ...httputil.ClientOption) *Client {
}

func (c *Client) CreateTypeInstance(ctx context.Context, in *hublocalgraphql.CreateTypeInstanceInput) (*hublocalgraphql.TypeInstance, error) {
query := fmt.Sprintf(`mutation($in: CreateTypeInstanceInput!) {
query := fmt.Sprintf(`mutation CreateTypeInstance($in: CreateTypeInstanceInput!) {
createTypeInstance(
in: $in
) {
Expand All @@ -65,7 +65,7 @@ func (c *Client) CreateTypeInstance(ctx context.Context, in *hublocalgraphql.Cre
}

func (c *Client) CreateTypeInstances(ctx context.Context, in *hublocalgraphql.CreateTypeInstancesInput) ([]hublocalgraphql.CreateTypeInstanceOutput, error) {
query := `mutation($in: CreateTypeInstancesInput!) {
query := `mutation CreateTypeInstances($in: CreateTypeInstancesInput!) {
createTypeInstances(
in: $in
) {
Expand All @@ -91,7 +91,7 @@ func (c *Client) CreateTypeInstances(ctx context.Context, in *hublocalgraphql.Cr
}

func (c *Client) UpdateTypeInstances(ctx context.Context, in []hublocalgraphql.UpdateTypeInstancesInput) ([]hublocalgraphql.TypeInstance, error) {
query := fmt.Sprintf(`mutation($in: [UpdateTypeInstancesInput]!) {
query := fmt.Sprintf(`mutation UpdateTypeInstances($in: [UpdateTypeInstancesInput]!) {
updateTypeInstances(
in: $in
) {
Expand All @@ -116,7 +116,7 @@ func (c *Client) UpdateTypeInstances(ctx context.Context, in []hublocalgraphql.U
}

func (c *Client) FindTypeInstance(ctx context.Context, id string) (*hublocalgraphql.TypeInstance, error) {
query := fmt.Sprintf(`query($id: ID!) {
query := fmt.Sprintf(`query FindTypeInstance($id: ID!) {
typeInstance(id: $id) {
%s
}
Expand All @@ -139,7 +139,7 @@ func (c *Client) FindTypeInstance(ctx context.Context, id string) (*hublocalgrap
}

func (c *Client) ListTypeInstances(ctx context.Context, filter *hublocalgraphql.TypeInstanceFilter) ([]hublocalgraphql.TypeInstance, error) {
query := fmt.Sprintf(`query($filter: TypeInstanceFilter) {
query := fmt.Sprintf(`query ListTypeInstances($filter: TypeInstanceFilter) {
typeInstances(filter: $filter) {
%s
}
Expand All @@ -162,7 +162,7 @@ func (c *Client) ListTypeInstances(ctx context.Context, filter *hublocalgraphql.
}

func (c *Client) ListTypeInstancesTypeRef(ctx context.Context) ([]hublocalgraphql.TypeInstanceTypeReference, error) {
query := `query {
query := `query ListTypeInstancesTypeRef {
typeInstances {
typeRef {
path
Expand Down Expand Up @@ -196,7 +196,7 @@ func (c *Client) ListTypeInstancesTypeRef(ctx context.Context) ([]hublocalgraphq
}

func (c *Client) DeleteTypeInstance(ctx context.Context, id string) error {
req := graphql.NewRequest(`mutation ($id: ID!) {
req := graphql.NewRequest(`mutation DeleteTypeInstance($id: ID!) {
deleteTypeInstance(
id: $id
)
Expand All @@ -215,7 +215,7 @@ func (c *Client) DeleteTypeInstance(ctx context.Context, id string) error {
}

func (c *Client) LockTypeInstances(ctx context.Context, in *hublocalgraphql.LockTypeInstancesInput) error {
query := `mutation($in: LockTypeInstancesInput!) {
query := `mutation LockTypeInstances($in: LockTypeInstancesInput!) {
lockTypeInstances(in: $in)
}`

Expand All @@ -233,7 +233,7 @@ func (c *Client) LockTypeInstances(ctx context.Context, in *hublocalgraphql.Lock
}

func (c *Client) UnlockTypeInstances(ctx context.Context, in *hublocalgraphql.UnlockTypeInstancesInput) error {
query := `mutation($in: UnlockTypeInstancesInput!) {
query := `mutation UnlockTypeInstances($in: UnlockTypeInstancesInput!) {
unlockTypeInstances(in: $in)
}`

Expand Down
12 changes: 6 additions & 6 deletions pkg/hub/client/public/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewClient(cli *graphql.Client) *Client {

// ListInterfacesMetadata returns only name, prefix and path. Rest fields have zero value.
func (c *Client) ListInterfacesMetadata(ctx context.Context) ([]gqlpublicapi.Interface, error) {
req := graphql.NewRequest(`query {
req := graphql.NewRequest(`query ListInterfacesMetadata {
interfaces {
name
prefix
Expand All @@ -49,7 +49,7 @@ func (c *Client) ListInterfacesMetadata(ctx context.Context) ([]gqlpublicapi.Int

func (c *Client) FindInterfaceRevision(ctx context.Context, ref gqlpublicapi.InterfaceReference) (*gqlpublicapi.InterfaceRevision, error) {
query, params := c.interfaceQueryForRef(ref)
req := graphql.NewRequest(fmt.Sprintf(`query($interfacePath: NodePath!, %s) {
req := graphql.NewRequest(fmt.Sprintf(`query FindInterfaceRevision($interfacePath: NodePath!, %s) {
interface(path: $interfacePath) {
%s
}
Expand All @@ -75,7 +75,7 @@ func (c *Client) FindInterfaceRevision(ctx context.Context, ref gqlpublicapi.Int
}

func (c *Client) ListInterfacesWithLatestRevision(ctx context.Context, filter gqlpublicapi.InterfaceFilter) ([]*gqlpublicapi.Interface, error) {
req := graphql.NewRequest(fmt.Sprintf(`query ListInterface($interfaceFilter: InterfaceFilter!) {
req := graphql.NewRequest(fmt.Sprintf(`query ListInterfacesWithLatestRevision($interfaceFilter: InterfaceFilter!) {
interfaces(filter: $interfaceFilter) {
%s
}
Expand All @@ -98,7 +98,7 @@ func (c *Client) ListInterfacesWithLatestRevision(ctx context.Context, filter gq
}

func (c *Client) GetInterfaceLatestRevisionString(ctx context.Context, ref gqlpublicapi.InterfaceReference) (string, error) {
req := graphql.NewRequest(`query ($interfacePath: NodePath!) {
req := graphql.NewRequest(`query GetInterfaceLatestRevisionString($interfacePath: NodePath!) {
interface(path: $interfacePath) {
latestRevision {
revision
Expand Down Expand Up @@ -130,7 +130,7 @@ func (c *Client) GetInterfaceLatestRevisionString(ctx context.Context, ref gqlpu
}

func (c *Client) ListImplementationRevisions(ctx context.Context, filter *gqlpublicapi.ImplementationRevisionFilter) ([]*gqlpublicapi.ImplementationRevision, error) {
req := graphql.NewRequest(fmt.Sprintf(`query {
req := graphql.NewRequest(fmt.Sprintf(`query ListImplementationRevisions{
implementations {
%s
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func (c *Client) ListImplementationRevisionsForInterface(ctx context.Context, re
getOpts.Apply(opts...)

query, params := c.interfaceQueryForRef(ref)
req := graphql.NewRequest(fmt.Sprintf(`query($interfacePath: NodePath!, %s) {
req := graphql.NewRequest(fmt.Sprintf(`query ListImplementationRevisionsForInterface($interfacePath: NodePath!, %s) {
interface(path: $interfacePath) {
%s
}
Expand Down