diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 49831dedc..6c9dfd282 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -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 @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/pkg/hub/client/local/client.go b/pkg/hub/client/local/client.go index 286c8ff87..ee9a133c8 100644 --- a/pkg/hub/client/local/client.go +++ b/pkg/hub/client/local/client.go @@ -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 ) { @@ -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 ) { @@ -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 ) { @@ -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 } @@ -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 } @@ -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 @@ -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 ) @@ -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) }` @@ -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) }` diff --git a/pkg/hub/client/public/client.go b/pkg/hub/client/public/client.go index dd0e60491..105b5d69c 100644 --- a/pkg/hub/client/public/client.go +++ b/pkg/hub/client/public/client.go @@ -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 @@ -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 } @@ -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 } @@ -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 @@ -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 } @@ -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 }