Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
70b4c1c
fix unique_terms querys when filtering on system
ahaessly Nov 17, 2023
b70248d
update to deploy rdbms server
ahaessly Dec 5, 2023
ab7769b
add a comment to indicate how we handle fields from the somatic_mutat…
ahaessly Dec 14, 2023
f2559b5
update starting/testing section
ahaessly Dec 15, 2023
e0dee17
Merge pull request #226 from CancerDataAggregator/ah-cd-644-dups-for-…
abradyGDIT Dec 18, 2023
acf0e71
add new workflow (#227)
ahaessly Jan 5, 2024
f6aa8c1
remove hikari property
ahaessly Jan 12, 2024
dc10794
add HikariCP
ahaessly Jan 12, 2024
165813e
remove redundant workflow
ahaessly Jan 12, 2024
d781470
delete old workflow
ahaessly Jan 12, 2024
510e62a
add push to dev
ahaessly Jan 16, 2024
f6cde13
remove sonarqube
ahaessly Jan 16, 2024
dcdf9e8
fix spacing
ahaessly Jan 16, 2024
a0efc7d
change field names when specifying fields in the mapping tables
ahaessly Dec 14, 2023
5732458
don't return id alias fields
ahaessly Jan 17, 2024
6ba747b
Merge pull request #231 from CancerDataAggregator/ah_add_sherlock_dev
tanner-coon-bh Feb 5, 2024
f04d22c
CD-675 AH fix integer alias (#232)
ahaessly Feb 9, 2024
c79560e
upgrade versions to match vulnerability fixes in main (#234)
ahaessly Feb 15, 2024
c145698
CD-772 finish migrating to integer aliases (#235)
ahaessly Feb 28, 2024
76ff268
add boolean types for parameters (#236)
ahaessly Feb 28, 2024
5d0f90f
Ah CD-778 internal cols exposed (#237)
ahaessly Feb 28, 2024
84d3447
treat somatic_mutation as both entity and mapping table (#238)
ahaessly Feb 29, 2024
dd4296a
AH fix unique terms system param (#239)
ahaessly Mar 1, 2024
2332523
fix relationships with data_source tables
ahaessly Mar 5, 2024
a5bffcc
Feature count merge (#243)
fthomas641 Mar 8, 2024
b766693
Update build.gradle
abradyGDIT Mar 11, 2024
ca278f5
Mvp bug fix (#245)
tanner-coon-bh Mar 11, 2024
367b867
Added Optimization For File Paged Query Preselects
tanner-coon-bh Mar 11, 2024
2165d39
Updated To Utilize Files table
tanner-coon-bh Mar 12, 2024
46a44bc
upgrade logback version to 1.2.13 (#241)
ahaessly Mar 12, 2024
b3ad039
test connection to database for status check (#246)
ahaessly Mar 12, 2024
abacd1c
File preselect optimization (#248)
tanner-coon-bh Mar 12, 2024
d5ba894
Updated entitycountsqlgenerator tests to match optimized queries.
fthomas641 Mar 12, 2024
bc9e355
Merge branch 'file_preselect_optimization' into develop
fthomas641 Mar 12, 2024
381cc5a
Disabled incorrect unit tests.
fthomas641 Mar 12, 2024
8de6da3
Disabled unit tests that need to be updated in the future.
fthomas641 Mar 12, 2024
c8876be
Fixing FileSqlGeneratorTest
tanner-coon-bh Mar 12, 2024
25248e2
Catching Non-Entity*SQLGenerator types
tanner-coon-bh Mar 12, 2024
b0bb647
Fixed Parenthesis Around Filters with File Preselect
tanner-coon-bh Mar 12, 2024
9cec0bc
Added case where file columns included in select clause
tanner-coon-bh Mar 12, 2024
322a7ff
Bug Fix for simple queries with mapping table
tanner-coon-bh Mar 13, 2024
2085653
Fixed another bug
tanner-coon-bh Mar 15, 2024
e5dffe9
set qa env for stable data
ahaessly Mar 15, 2024
485b42a
Merge branch 'test' into develop
KutnerBroadie Mar 15, 2024
cda132d
Innocuous change to trigger deploy
fthomas641 Mar 20, 2024
a5beafa
Fixed bugs with simple queries
tanner-coon-bh Mar 20, 2024
7223f18
Remove caching from response header (#251)
fthomas641 Mar 25, 2024
a3053b6
Removed bulk-data and boolean-query endpoint (#250)
fthomas641 Mar 25, 2024
a29357e
Updated the hardcoded dataset-description information (#252)
fthomas641 Mar 25, 2024
c3c2f29
Added Endpoint to Test Java Memory Settings (#253)
tanner-coon-bh Mar 26, 2024
eca564b
Fixed bug (#254)
tanner-coon-bh Mar 27, 2024
1f68dd5
Fixed Incorrect Paged Queries (#255)
tanner-coon-bh Mar 28, 2024
545cd35
Fixed Join Keep in Paged Query (#256)
tanner-coon-bh Mar 29, 2024
8e3eb62
Don't deploy to dev in PRs (#258)
em-may Apr 4, 2024
36a08ce
Updated For New Mutation Table (#259)
tanner-coon-bh Jun 6, 2024
fb26efc
Fixed Mutation Default Order By (#260)
tanner-coon-bh Jun 24, 2024
28f7ff3
BigInt hotfix (#261)
tanner-coon-bh Jul 16, 2024
55bc278
Query parameter fix and update SnakeYaml package (#262)
tanner-coon-bh Nov 26, 2024
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
21 changes: 18 additions & 3 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Github action to Build cda service artifact, add/promote semantic tagging

name: cda-service-build-tag-publish
name: Tag, Build, and Push Image

on:
push:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
env:
DEFAULT_BUMP: patch
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }}
RELEASE_BRANCHES: master
RELEASE_BRANCHES: develop
WITH_V: true

- name: debug outputs
Expand Down Expand Up @@ -91,4 +91,19 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
# inputs: '{ "bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}" }'

# inputs: '{ "bee-name": "${{ github.event.repository.name }}-${{ github.run_id }}-${{ matrix.terra-env }}" }'

set-version-in-dev:
if: ${{ github.event_name != 'pull_request' }}
# Put new cda version in Broad dev environment
uses: broadinstitute/sherlock/.github/workflows/client-set-environment-app-version.yaml@main
needs: [tag-build-publish, report-to-sherlock]
with:
new-version: ${{ needs.tag-build-publish.outputs.tag }}
chart-name: 'cancerdata'
environment-name: 'dev'
secrets:
sync-git-token: ${{ secrets.BROADBOT_TOKEN }}
permissions:
id-token: 'write'
62 changes: 0 additions & 62 deletions .github/workflows/master_push.yml

This file was deleted.

9 changes: 2 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,18 @@ jobs:
restore-keys: ${{ runner.os }}-gradle
- name: Run tests
run: ./gradlew test --scan
- name: Run SonarQube scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube --info
- name: Run Coverage
run: |
chmod +x gradlew
./gradlew jacocoTestReport
- name: Upload Report
uses: 'actions/upload-artifact@v2'
uses: 'actions/upload-artifact@v4'
with:
name: report.xml
path: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.2
uses: madrapps/jacoco-report@v1.6.1
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask


buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.4.RELEASE")
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.18")
classpath("com.google.guava:guava:30.1.1-jre")
}
configurations.all {
Expand All @@ -18,7 +19,7 @@ buildscript {
plugins {
id 'java'
id 'idea'
id 'org.springframework.boot' version '2.7.4'
id 'org.springframework.boot' version '2.7.18'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'com.google.cloud.tools.jib' version '2.8.0'
id 'org.openapi.generator' version '6.0.1'
Expand Down Expand Up @@ -63,9 +64,11 @@ dependencies {
// These dependencies are required to load the logback config file.
implementation group: 'org.codehaus.groovy', name: 'groovy', version: '3.0.7'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging', version: '1.2.8.RELEASE'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.13'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.2.13'

// These are temporary until the including library catches up with these vulnerability fixes
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.33'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.0-rc1'

// -- OpenAPI CodeGen dependencies --
Expand Down Expand Up @@ -273,13 +276,13 @@ requires = ["setuptools", "wheel"] # PEP 508 specifications.
pyprojectTomlTemplate += line + "\n"
}

for( line in new File("./build/generated-client/requirements.txt")){
for( line in new File( System.getenv().get('PWD') + "/build/generated-client/requirements.txt" ) ) {
String[] parts = line.split("[><=]")
String op = "="
pyprojectTomlTemplate += "${parts[0].trim()} ${op} \"${parts[parts.length - 1].trim()}\" \n"
}

new File("./build/generated-client/pyproject.toml").write(pyprojectTomlTemplate)
new File( System.getenv().get('PWD') + "/build/generated-client/pyproject.toml" ).write( pyprojectTomlTemplate )
println pyprojectTomlTemplate
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bio/terra/cda/app/builders/JoinBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected boolean foundMatch(ForeignKey key, String toTable) {

protected ForeignKey getMatchingMappingFK(ForeignKey key, String toTable, String toFieldname) {
TableInfo destTable = dataSetInfo.getTableInfo(key.getDestinationTableName());
if (destTable.isMapppingTable()) {
if (destTable.isMappingTable()) {
// remove the FK that got us to this mapping table
return
destTable.getForeignKeys().stream()
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/bio/terra/cda/app/builders/ParameterBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import bio.terra.cda.app.models.QueryField;
import org.apache.logging.log4j.util.Strings;
import org.springframework.jdbc.core.SqlParameterValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import org.springframework.jdbc.core.SqlParameterValue;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.util.StringUtils;
import org.yaml.snakeyaml.util.ArrayUtils;

import java.sql.Types;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class ParameterBuilder {
private static final Logger logger = LoggerFactory.getLogger(ParameterBuilder.class);
private final MapSqlParameterSource parameterValueMap;
private int index;

Expand All @@ -28,26 +30,35 @@ public MapSqlParameterSource getParameterValueMap() {

public String addParameterValue(String type, Object value) {
String parameterName = String.format("parameter_%s", ++index);

if (value.getClass().isArray()) {
this.parameterValueMap.addValue(parameterName, value, Types.ARRAY);
} else
if (type.equals("text")) {
} else if (type.equals("text")) {
this.parameterValueMap.addValue(parameterName, value);
} else if (type.equals("integer")){
} else if (type.equals("integer")) {
this.parameterValueMap.addValue(parameterName, value, Types.INTEGER);
} else if (type.equals("bigint")) {
this.parameterValueMap.addValue(parameterName, value, Types.BIGINT);
} else if (type.equals("float")) {
this.parameterValueMap.addValue(parameterName, value, Types.FLOAT);
} else if (type.equals("boolean")) {
this.parameterValueMap.addValue(parameterName, value, Types.BOOLEAN);
} else {
logger.error("Unknown type: {}", type);
throw new RuntimeException("Unknown type: " + type);
}
return String.format(":%s", parameterName);
}

public String substituteForReadableString(String sqlStr) {
String result = sqlStr;
for (String key : getParameterValueMap().getParameterNames()) {
List<String> reversed_parameters = Arrays.asList(getParameterValueMap().getParameterNames());
Collections.reverse(reversed_parameters);
for (String key : reversed_parameters) {
String keyformat = String.format(":%s", key);
Object value = parameterValueMap.getValue(key);
int type = parameterValueMap.getSqlType(key);
if (type == Types.INTEGER || type == Types.FLOAT) {
if (type == Types.INTEGER || type == Types.FLOAT || type == Types.BOOLEAN) {
result = result.replace(keyformat, value.toString());
} else if (type == Types.ARRAY) {
List<String> valueList = Arrays.stream((Object[])value).map(x ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ private ResponseEntity<ErrorReport> buildErrorReport(
errorReport =
new ErrorReport().message(ex.getMessage()).statusCode(statusCode.value()).causes(causes);
}
return new ResponseEntity<>(errorReport, statusCode);
return new ResponseEntity<>(errorReport, HeaderUtils.getNoCacheResponseHeader(), statusCode);
}
}
15 changes: 15 additions & 0 deletions src/main/java/bio/terra/cda/app/controller/HeaderUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package bio.terra.cda.app.controller;

import org.springframework.http.CacheControl;
import org.springframework.http.HttpHeaders;

public class HeaderUtils {

public static HttpHeaders getNoCacheResponseHeader(){
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.setCacheControl(CacheControl.noStore());
responseHeaders.setPragma("no-cache");
return responseHeaders;
}

}
21 changes: 13 additions & 8 deletions src/main/java/bio/terra/cda/app/controller/MetaApiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import org.apache.http.Header;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
Expand All @@ -41,35 +44,37 @@ public MetaApiController(ApplicationConfiguration applicationConfiguration) {
@TrackExecutionTime
@Override
public ResponseEntity<SystemStatus> serviceStatus() {
//TODO actually validate systems
return ResponseEntity.ok(new SystemStatus());
return ResponseEntity.ok().headers(HeaderUtils.getNoCacheResponseHeader()).body(queryService.postgresCheck());
}

// For now, the dataset description is hardcoded. In the future, it will probably be read from a
// table
private DatasetDescription createDescription() {
var dateOfRelease =
OffsetDateTime.of(LocalDate.of(2022, 6, 28), LocalTime.MIN, ZoneOffset.UTC).toString();
OffsetDateTime.of(LocalDate.of(2024, 3, 21), LocalTime.MIN, ZoneOffset.UTC).toString();
Model m = new Model();
m.setVersion("1.0");
m.setDate(dateOfRelease);
return new DatasetDescription()
.addDatasetsItem(
new DatasetInfo()
.version(applicationConfiguration.getVersion())
.source("IDC, PDC and GDC")
.source("IDC, PDC, GDC and CDS")
.date(dateOfRelease))
.cdaVersion("MVP")
.cdaVersion("4.0")
.notes("CDA MVP release")
.releaseDate(dateOfRelease)
.cdaModel(new Model());
.cdaModel(m);
}

@Override
public ResponseEntity<List<DatasetDescription>> allReleaseNotes() {
return ResponseEntity.ok(Collections.singletonList(createDescription()));
return ResponseEntity.ok().headers(HeaderUtils.getNoCacheResponseHeader()).body(Collections.singletonList(createDescription()));
}

@Override
public ResponseEntity<DatasetDescription> latestReleaseNotes() {
return ResponseEntity.ok(createDescription());
return ResponseEntity.ok().headers(HeaderUtils.getNoCacheResponseHeader()).body(createDescription());
}

}
Loading