Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robertaboukhalil committed Oct 6, 2023
1 parent b0ef208 commit e3cbc4d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 268 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
entities/api/schema.json linguist-generated=true
entities/api/schema.graphql linguist-generated=true
entities/cli/gql_schema.py linguist-generated=true
workflows/entity_gql_schema.py linguist-generated=true
1 change: 0 additions & 1 deletion entities/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ codegen: ## Update the GQL types used by the CLI
$(docker_compose_run) entities strawberry export-schema api.main:schema > api/schema.graphql
$(docker_compose) exec entities python3 -m sgqlc.introspection --exclude-deprecated --exclude-description http://localhost:8008/graphql api/schema.json
$(docker_compose) exec entities sgqlc-codegen schema api/schema.json cli/gql_schema.py
cp cli/gql_schema.py ../workflows/entity_gql_schema.py

### CERBOS #############################################
cerbos-tests:
Expand Down
29 changes: 0 additions & 29 deletions workflows/api/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import configparser
import json
import os
import typing

import database.models as db
import entity_gql_schema as entity_schema
import strawberry
from cerbos.sdk.client import CerbosClient
from cerbos.sdk.model import Principal
Expand All @@ -14,8 +11,6 @@
from platformics.api.core.settings import APISettings
from platformics.api.core.strawberry_extensions import DependencyExtension
from platformics.database.connect import AsyncDB
from sgqlc.endpoint.http import HTTPEndpoint
from sgqlc.operation import Operation
from sqlalchemy.ext.asyncio import AsyncSession
from strawberry.fastapi import GraphQLRouter
from strawberry_sqlalchemy_mapper import StrawberrySQLAlchemyMapper
Expand Down Expand Up @@ -94,30 +89,6 @@ async def get_workflow_runners(self) -> typing.List[WorkflowRunner]:

@strawberry.type
class Mutation:
@strawberry.mutation(extensions=[DependencyExtension()])
async def test_connection(self) -> str:
entity_service_url = os.getenv("ENTITY_SERVICE_URL")
entity_service_auth_token = os.getenv("ENTITY_SERVICE_AUTH_TOKEN")
headers = {"Authorization": f"Bearer {entity_service_auth_token}"}
endpoint = HTTPEndpoint(entity_service_url)

# Create query to list all samples
op = Operation(entity_schema.Query)
samples = op.samples()
samples.id()
samples.name()
samples.location()
data = endpoint(op, extra_headers=headers)
print(json.dumps(data["data"]["samples"], indent=4))

# Create a sample
op = Operation(entity_schema.Mutation)
op.create_sample(name="test", location="test", collection_id=444)
data = endpoint(op, extra_headers=headers)
print(json.dumps(data, indent=4))

return "Hello World"

@strawberry.mutation(extensions=[DependencyExtension()])
async def add_workflow(
self,
Expand Down
1 change: 1 addition & 0 deletions workflows/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
JWK_PUBLIC_KEY_FILE: "/workflows/test_infra/fixtures/public_key.pem"
JWK_PRIVATE_KEY_FILE: "/workflows/test_infra/fixtures/private_key.pem"
DEFAULT_UPLOAD_BUCKET: "local-bucket"
DEFAULT_UPLOAD_PROTOCOL: "S3"
BOTO_ENDPOINT_URL: "http://motoserver.czidnet:4000"
ENTITY_SERVICE_URL: "http://entity-service:8008"
AWS_REGION: "us-west-2"
Expand Down
237 changes: 0 additions & 237 deletions workflows/entity_gql_schema.py

This file was deleted.

0 comments on commit e3cbc4d

Please sign in to comment.