Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-6322
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Jun 18, 2024
2 parents 7bc1c23 + aaa1e94 commit ef98e81
Show file tree
Hide file tree
Showing 215 changed files with 2,106 additions and 2,196 deletions.
13 changes: 13 additions & 0 deletions opencga-app/app/misc/clients/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2015-2024 OpenCB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
15 changes: 1 addition & 14 deletions opencga-app/app/misc/clients/java_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ def get_imports(self):

headers = []
headers.append('/*')
headers.append('* Copyright 2015-' + str(date.today().year) + ' OpenCB')
headers.append('*')
headers.append('* Licensed under the Apache License, Version 2.0 (the "License");')
headers.append('* you may not use this file except in compliance with the License.')
headers.append('* You may obtain a copy of the License at')
headers.append('*')
headers.append('* http://www.apache.org/licenses/LICENSE-2.0')
headers.append('*')
headers.append('* Unless required by applicable law or agreed to in writing, software')
headers.append('* distributed under the License is distributed on an "AS IS" BASIS,')
headers.append('* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.')
headers.append('* See the License for the specific language governing permissions and')
headers.append('* limitations under the License.')
headers.append(self.get_copyright_message(prefix='* '))
headers.append('*/')
headers.append('')
# We need to calculate the Java package and no use: headers.append('package org.opencb.opencga.client.rest.clients;')
Expand Down Expand Up @@ -99,7 +87,6 @@ def get_class_definition(self, category):
text.append('/**')
text.append(' * This class contains methods for the {} webservices.'.format(
self.categories[self.get_category_name(category)]))
text.append(' *{}Client version: {}'.format(' ' * 4, self.version))
text.append(' *{}PATH: {}'.format(' ' * 4, self.get_category_path(category)))
text.append(' */')
text.append('public class {}Client extends {} {{'.format(self.categories[self.get_category_name(category)], parentClientClass))
Expand Down
12 changes: 2 additions & 10 deletions opencga-app/app/misc/clients/javascript_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,10 @@ def __init__(self, server_url, output_dir):
}

def get_imports(self):
copyright = self.get_copyright_message(prefix=' * ')
auto_msg = "\n * ".join(self.get_autogenerated_message())
return (f'/**\n'
f' * Copyright 2015-2020 OpenCB\n'
f' * Licensed under the Apache License, Version 2.0 (the "License");\n'
f' * you may not use this file except in compliance with the License.\n'
f' * You may obtain a copy of the License at\n'
f' * http://www.apache.org/licenses/LICENSE-2.0\n'
f' * Unless required by applicable law or agreed to in writing, software\n'
f' * distributed under the License is distributed on an "AS IS" BASIS,\n'
f' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n'
f' * See the License for the specific language governing permissions and\n'
f' * limitations under the License.\n'
f'{copyright}\n'
f' * {auto_msg}'
f' \n *\n**/\n\n'
f'import OpenCGAParentClass from "./../opencga-parent-class.js";\n\n')
Expand Down
1 change: 0 additions & 1 deletion opencga-app/app/misc/clients/python_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def get_class_definition(self, category):
text.append('{}"""'.format(' ' * 4))
text.append('{}This class contains methods for the \'{}\' webservices'.format(' ' * 4,
self.get_category_name(category)))
text.append('{}Client version: {}'.format(' ' * 4, self.version))
text.append('{}PATH: {}'.format(' ' * 4, category['path']))
text.append('{}"""'.format(' ' * 4))
text.append('')
Expand Down
1 change: 1 addition & 0 deletions opencga-app/app/misc/clients/r_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def get_class_definition(self, category):
myEndpoint['path'],
", ".join(endpoint_params)))
path_params = set(class_path_params)
path_params = sorted(list(path_params))
text.append("#'\n#' @md")
text.append("#' @seealso \\url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation")
text.append("#' \\url{http://bioinfo.hpc.cam.ac.uk/opencga-prod/webservices/}")
Expand Down
29 changes: 27 additions & 2 deletions opencga-app/app/misc/clients/rest_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,39 @@ def __init__(self, rest_api_file, output_dir):
'Admin': 'Admin'
}

@staticmethod
def get_copyright_message(prefix=""):
# copyright = [
# 'Copyright 2015-2024 OpenCB',
# '',
# 'Licensed under the Apache License, Version 2.0 (the "License");',
# 'you may not use this file except in compliance with the License.',
# 'You may obtain a copy of the License at',
# '',
# ' http://www.apache.org/licenses/LICENSE-2.0',
# '',
# 'Unless required by applicable law or agreed to in writing, software',
# 'distributed under the License is distributed on an "AS IS" BASIS,',
# 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.',
# 'See the License for the specific language governing permissions and',
# 'limitations under the License.'
# ]
copyright_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'copyright.txt')
print("Reading from file: ", copyright_file)
with open(copyright_file, 'r') as file:
copyright = file.read().splitlines()
## Add prefix to each line
if prefix:
for line in range(len(copyright)):
copyright[line] = (prefix + copyright[line]).rstrip()
return "\n".join(copyright)

@staticmethod
def get_autogenerated_message():
date_ = datetime.now().strftime("%Y-%m-%d")
return [
'WARNING: AUTOGENERATED CODE',
'',
'This code was generated by a tool.',
'Autogenerated on: ' + date_,
'',
'Manual changes to this file may cause unexpected behavior in your application.',
'Manual changes to this file will be overwritten if the code is regenerated.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.opencb.commons.datastore.core.ObjectMap;
import org.opencb.opencga.app.cli.admin.options.MigrationCommandOptions;
import org.opencb.opencga.app.cli.main.io.Table;
import org.opencb.opencga.app.migrations.v3_0_0.OrganizationMigration;
import org.opencb.opencga.app.migrations.v3.v3_0_0.OrganizationMigration;
import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.managers.CatalogManager;
import org.opencb.opencga.catalog.migration.Migration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright 2015-2024-04-29 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opencb.opencga.app.cli.main;

import org.jline.reader.Candidate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
* Copyright 2015-2024-04-29 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opencb.opencga.app.cli.main;

import com.beust.jcommander.JCommander;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.opencb.opencga.app.migrations.v2.v2_0_3.catalog.java;

import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "recalculate_roles", description = "Recalculate roles from Family #1763", version = "2.0.3", date = 20210528,
deprecatedSince = "3.0.0")
public class Migration1 extends MigrationTool {

@Override
protected void run() throws CatalogException {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.opencb.opencga.app.migrations.v2.v2_0_5.catalog.java;


import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "initialise_groups", description = "Initialise userIds list from groups #1791", version = "2.0.5", date = 20210621,
deprecatedSince = "3.0.0")
public class initialiseGroups extends MigrationTool {

@Override
protected void run() throws CatalogException {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.opencb.opencga.app.migrations.v2.v2_0_6.catalog;


import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "remove_file_references_from_sample", description = "Remove deleted file references from samples #1815", version = "2.0.6",
date = 20210901, deprecatedSince = "3.0.0")
public class removeDeletedFileReferencesFromSample extends MigrationTool {

@Override
protected void run() throws CatalogException {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.opencb.opencga.app.migrations.v2.v2_12_0.catalog;


import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "add_annotation_sets_to_clinical_analysis" ,
description = "Add private annotation fields to ClinicalAnalysis documents #TASK-5198",
version = "2.12.0",
domain = Migration.MigrationDomain.CATALOG,
language = Migration.MigrationLanguage.JAVA,
date = 20231116,
deprecatedSince = "3.0.0"
)
public class AddAnnotationSetsInClinicalAnalysisMigration extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.opencb.opencga.app.migrations.v2.v2_12_0.catalog;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "complete_clinical_report_data_model" ,
description = "Complete Clinical Report data model #TASK-5198",
version = "2.12.0",
domain = Migration.MigrationDomain.CATALOG,
language = Migration.MigrationLanguage.JAVA,
date = 20231128,
deprecatedSince = "3.0.0"
)
public class CompleteClinicalReportDataModelMigration extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "add_missing_indexes",
description = "Add missing indexes", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210928,
deprecatedSince = "3.0.0")
public class AddMissingIndexes extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "add_panels_to_interpretations",
description = "Add panels to Interpretations #1802", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
date = 20210713,
deprecatedSince = "3.0.0")
public class AddPanelsToInterpretations extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "create_audit_indexes", description = "Create Audit indexes", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210622,
deprecatedSince = "3.0.0")
public class CreateAuditIndexes extends MigrationTool {

@Override
protected void run() throws Exception {
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "add_panel_lock",
description = "Add new panelLock to ClinicalAnalysis #1802", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210713,
deprecatedSince = "3.0.0")
public class PanelLock extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "remove_rc_version_from_migration_runs",
description = "Remove RC versions from migration runs stored in catalog", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210723,
deprecatedSince = "3.0.0")
public class RemoveRCVersionsFromMigrationRuns extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;

import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "rename_datastore_configuration_to_options", description = "Rename project.internal.datastores.variant.configuration to options", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210617,
deprecatedSince = "3.0.0")
public class RenameDatastoreConfigurationToOptions extends MigrationTool {

@Override
protected void run() throws Exception {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.opencb.opencga.app.migrations.v2.v2_1_0.catalog.java;


import org.opencb.opencga.catalog.migration.Migration;
import org.opencb.opencga.catalog.migration.MigrationTool;

@Migration(id = "move_study_clinical_config_to_internal",
description = "Move Study ClinicalConfiguration to internal.configuration", version = "2.1.0",
language = Migration.MigrationLanguage.JAVA,
domain = Migration.MigrationDomain.CATALOG,
patch = 1,
date = 20210708,
deprecatedSince = "3.0.0")
public class StudyClinicalConfigurationRelocation extends MigrationTool {

@Override
protected void run() throws Exception {
}
}
Loading

0 comments on commit ef98e81

Please sign in to comment.