Skip to content

Commit

Permalink
Merge pull request #8 from icgc-argo/RC/1.0.1
Browse files Browse the repository at this point in the history
RC/1.0.1
  • Loading branch information
lepsalex authored Jun 18, 2020
2 parents 8fb37d8 + 336f8e4 commit d5f3390
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>bio.overture</groupId>
<artifactId>song-search</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>song-search</name>
<description>GQL microservice for searching maestro generated song indexes</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public class SearchFields {
public static final String DONOR_ID = "donorId";
public static final String SPECIMEN_ID = "specimenId";
public static final String SAMPLE_ID = "sampleId";
public static final String RUN_NAME = "runName";
public static final String RUN_ID = "runId";
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public DataFetcher getDataFetcher() {
}
}
if (RUN_ENTITY.equals(values.get("__typename"))) {
final Object runName = values.get("runName");
if (runName instanceof String) {
final Object runId = values.get("runName"); // todo: will become runId after reindex
if (runId instanceof String) {
return new Run(
(String) runName,
analysisService.getAnalysesByRunName((String) runName),
(String) runId,
analysisService.getAnalysesByRunId((String) runId),
"Not Implemented!");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bio/overture/songsearch/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class Run {
private static final ObjectMapper MAPPER = new ObjectMapper();

private String runName;
private String runName; // todo: will become runId after reindex

private List<Analysis> producedAnalyses;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/bio/overture/songsearch/model/Workflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
public class Workflow {
private static final ObjectMapper MAPPER = new ObjectMapper();

private String runName;

private String runId;

private String workflowName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private static Map<String, Function<String, AbstractQueryBuilder<?>>> argumentPa
.put(ANALYSIS_VERSION, value -> new TermQueryBuilder("analysis_version", value))
.put(ANALYSIS_STATE, value -> new TermQueryBuilder("analysis_state", value))
.put(STUDY_ID, value -> new TermQueryBuilder("study_id", value))
.put(RUN_NAME, value -> new TermQueryBuilder("workflow.run_id", value)) // TODO: change to run_name after migration
.put(RUN_ID, value -> new TermQueryBuilder("workflow.run_id", value))
.put(
DONOR_ID,
value ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Map;

import static bio.overture.songsearch.config.SearchFields.ANALYSIS_ID;
import static bio.overture.songsearch.config.SearchFields.RUN_NAME;
import static bio.overture.songsearch.config.SearchFields.RUN_ID;
import static java.util.stream.Collectors.toUnmodifiableList;

@Service
Expand Down Expand Up @@ -43,8 +43,8 @@ public Analysis getAnalysisById(String analysisId) {
return runOpt.orElse(null);
}

public List<Analysis> getAnalysesByRunName(String runName) {
val response = analysisRepository.getAnalyses(Map.of(RUN_NAME, runName), null);
public List<Analysis> getAnalysesByRunId(String runId) {
val response = analysisRepository.getAnalyses(Map.of(RUN_ID, runId), null);
val hitStream = Arrays.stream(response.getHits().getHits());
return hitStream.map(AnalysisService::hitToAnalysis).collect(toUnmodifiableList());
}
Expand Down
7 changes: 3 additions & 4 deletions src/main/resources/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ type Sample {
matchedNormalSubmitterSampleId: String
}

type Workflow {
runName: String # TODO: swap runName to be ID post migration
type Workflow @key(fields: "runId") {
runId: ID!
workflowName: String
workflowVersion: String
Expand Down Expand Up @@ -118,7 +117,7 @@ input AnalysisFilter {
donorId: String
specimenId: String
sampleId: String
runName: String
runId: String
}

input FileFilter {
Expand All @@ -137,7 +136,7 @@ input Page {
}

type Run @key(fields: "runName") @extends {
runName: ID! @external
runName: ID! @external # todo: runName will become runId after reindex
producedAnalyses: [Analysis]
inputAnalyses: String
}
Expand Down

0 comments on commit d5f3390

Please sign in to comment.