Skip to content

Commit

Permalink
Federate sample for report (#155)
Browse files Browse the repository at this point in the history
Co-authored-by: Erin Hoops <[email protected]>
Co-authored-by: Julie Han <[email protected]>
Co-authored-by: Jerry Fu <[email protected]>
Co-authored-by: bchu1 <[email protected]>
Co-authored-by: czi-github-helper[bot] <95879977+czi-github-helper[bot]@users.noreply.github.com>
Co-authored-by: rzlim08 <[email protected]>
  • Loading branch information
7 people authored Mar 7, 2024
1 parent 05355e4 commit 45407c6
Show file tree
Hide file tree
Showing 30 changed files with 1,430 additions and 469 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ jobs:
app_config_name: API_URL
app_config_value: ${{ vars.API_URL}}
happy_env: sandbox
- name: Set CZ ID Entities URL
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
app_config_name: NEXTGEN_ENTITIES_URL
app_config_value: ${{ vars.NEXTGEN_ENTITIES_URL}}
happy_env: sandbox
- name: Set CZ ID Workflows URL
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
app_config_name: NEXTGEN_WORKFLOWS_URL
app_config_value: ${{ vars.NEXTGEN_WORKFLOWS_URL}}
happy_env: sandbox
- name: Set allowed CORS origins
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ jobs:
app_config_name: API_URL
app_config_value: ${{ vars.API_URL}}
happy_env: staging
- name: Set CZ ID Entities URL
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
app_config_name: NEXTGEN_ENTITIES_URL
app_config_value: ${{ vars.NEXTGEN_ENTITIES_URL}}
happy_env: staging
- name: Set CZ ID Workflows URL
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
app_config_name: NEXTGEN_WORKFLOWS_URL
app_config_value: ${{ vars.NEXTGEN_WORKFLOWS_URL}}
happy_env: staging
- name: Set allowed CORS origins
uses: chanzuckerberg/czid-graphql-federation-server/.github/actions/happy-config-set@main
with:
Expand Down
4 changes: 0 additions & 4 deletions .happy/terraform/envs/sandbox/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ module "stack" {
stack_prefix = "/${var.stack_name}"
app_name = var.app
k8s_namespace = var.k8s_namespace
additional_env_vars = {
NEXTGEN_ENTITIES_URL = "http://entities-entities:8008"
NEXTGEN_WORKFLOWS_URL = "http://workflows-workflows:8042"
}
services = {
gql = merge(local.routing_config[local.service_type], {
name = "graphql-federation"
Expand Down
10 changes: 8 additions & 2 deletions .meshrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ sources:
requestSample: { pipelineVersion: "8.0" }
responseSchema: ./json-schemas/sampleMetadata.json
responseTypeName: SampleMetadata
- type: Query
field: SampleForReport
method: GET
path: /pub/{args.snapshotLinkId}/samples/{args.railsSampleId}.json
responseSchema: ./json-schemas/sampleForReportResponse.json
responseTypeName: SampleForReport
- type: Query
field: MngsWorkflowResults
path: /pub/{args.snapshotLinkId}/samples/{args.sampleId}.json
Expand Down Expand Up @@ -176,8 +182,8 @@ sources:
field: fedWorkflowRuns
path: /workflow_runs.json
method: POST
requestSchema: ./json-schemas/fedWorkflowRunsRequest.json
responseSchema: ./json-schemas/fedWorkflowRunsResponse.json
requestSchema: ./json-schemas/workflowRunsRequest.json
responseSchema: ./json-schemas/workflowRunsResponse.json
responseTypeName: fedWorkflowRuns
- type: Query
field: fedWorkflowRunsAggregate
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Changelog


## [2.14.0](https://github.com/chanzuckerberg/czid-graphql-federation-server/compare/v2.13.0...v2.14.0) (2024-03-07)


### Features

* update staging env variables urls ([#153](https://github.com/chanzuckerberg/czid-graphql-federation-server/issues/153)) ([26afdd7](https://github.com/chanzuckerberg/czid-graphql-federation-server/commit/26afdd7888752856d13d3fa255cb94dfcde6c23b))

## [2.13.0](https://github.com/chanzuckerberg/czid-graphql-federation-server/compare/v2.12.0...v2.13.0) (2024-03-06)


### Features

* Integrate fedWorkflowRuns and fedSequencingReads with NextGen ([#146](https://github.com/chanzuckerberg/czid-graphql-federation-server/issues/146)) ([8f51783](https://github.com/chanzuckerberg/czid-graphql-federation-server/commit/8f51783d81050e059eb11f475fbc03238c222c51))


### Bug Fixes

* createBulkDownload Change workflowRunIdsStrings type and remove required for workflowRunIds ([#145](https://github.com/chanzuckerberg/czid-graphql-federation-server/issues/145)) ([256173d](https://github.com/chanzuckerberg/czid-graphql-federation-server/commit/256173dd1b8aaa8794daea7d0527656496238021))

## [2.12.0](https://github.com/chanzuckerberg/czid-graphql-federation-server/compare/v2.11.1...v2.12.0) (2024-03-04)


Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
help: ## display help for this makefile
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: build
.PHONY: build
build: ## Build docker images
docker compose build

.PHONY: update-schema
update-schema: ## Update schema
rm tests/__snapshots__/UnifiedSchema.test.ts.snap
.PHONY: update-schema-snapshot
update-schema-snapshot: ## Update test schema snapshot
docker compose run gql npm test -- tests/UnifiedSchema.test.ts -u

.PHONY: test
test: ## Run tests
docker compose run --rm gql npm test
docker compose run --rm gql npm test

.PHONY: local-init
local-init: ## Build & start the service
Expand Down
55 changes: 55 additions & 0 deletions example-queries/sample-for-report-query.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
query SampleViewSampleQuery($railsSampleId: String, $snapshotLinkId: String) {
SampleForReport(
railsSampleId: $railsSampleId
snapshotLinkId: $snapshotLinkId
) {
id
created_at
default_background_id
default_pipeline_run_id
editable
host_genome_id
initial_workflow
name
pipeline_runs {
adjusted_remaining_reads
alignment_config_name
assembled
created_at
id
pipeline_version
run_finalized
total_ercc_reads
wdl_version
}
project {
id
name
}
project_id
railsSampleId
status
updated_at
upload_error
user_id
workflow_runs {
deprecated
executed_at
id
input_error
inputs {
accession_id
accession_name
creation_source
ref_fasta
taxon_id
taxon_name
technology
}
run_finalized
status
wdl_version
workflow
}
}
}
6 changes: 5 additions & 1 deletion example-queries/workflow-runs-query-order-by.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
query TestQuery {
fedWorkflowRuns(input: {
orderBy: {
startedAt: "ASC"
startedAt: "asc"
},
todoRemove: {
orderBy: "createdAt"
orderDir: "ASC"
}
}) {
id
Expand Down
14 changes: 2 additions & 12 deletions json-schemas/consensusGenomesResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@
},
"required": ["name"]
},
"referenceGenome": {
"type": "object",
"properties": {
"accessionId": {
"type": "string"
},
"accessionName": {
"type": "string"
}
}
},
"accession": {
"type": "object",
"properties": {
Expand All @@ -41,7 +30,8 @@
"accessionName": {
"type": "string"
}
}
},
"required": ["accessionId", "accessionName"]
},
"metrics": {
"type": "object",
Expand Down
176 changes: 0 additions & 176 deletions json-schemas/fedWorkflowRunsRequest.json

This file was deleted.

Loading

0 comments on commit 45407c6

Please sign in to comment.