Skip to content

Commit

Permalink
Merge branch 'master' into jbrowse2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrestel committed Oct 2, 2024
2 parents 0e7ddcc + 9bdc250 commit ce523f3
Show file tree
Hide file tree
Showing 45 changed files with 967 additions and 231 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Configure dependabot to create a pull request when it finds a new version of
# @veupathdb npm packages.

version: 2
updates:
- package-ecosystem: "npm"
directory: "/Site"
schedule:
interval: "daily"
time: "23:00"
timezone: "America/New_York"
allow:
- dependency-name: "@veupathdb/*"
commit-message:
prefix: "npm"
versioning-strategy: "lockfile-only"
32 changes: 32 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Automatically merge dependabot PRs for @veupathdb packages

name: Dependendabot auto-approve
on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: >
${{
contains(steps.metadata.outputs.dependency-names, '@veupathdb') &&
(
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
)
}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ SITE_BASE_URL=https://{{ hostname }}/{{ webapp_ctx }}
PROJECT_ID={{ project }}

COHORT={{ cohort }}

OAUTH_URL={{ modelconfig_oauthUrl }}
OAUTH_CLIENT_ID={{ modelconfig_oauthClientId }}
OAUTH_CLIENT_SECRET={{ modelconfig_oauthClientSecret }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ modelprop:
FACEBOOK_URL: https://facebook.com/pages/VectorBase/189608142260
eda:
enabled: "true" # this will enable it for dev sites
example_analyses_author: 854899613
example_analyses_author: 854899613,1926010
single_app_mode: pass
user_datasets_workspace:
enabled: "true"
17 changes: 17 additions & 0 deletions Model/lib/conifer/roles/conifer/vars/ApiCommon/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,20 @@ fisherexacttestconfig_dbLogin: '{{ modelconfig_appDb_login }}'
fisherexacttestconfig_dbPassword: '{{ modelconfig_appDb_password }}'
fisherexacttestconfig_perlExec: /usr/bin/perl
fisherexacttestconfig_connectionUrl: "{{ '' if modelconfig_userDb_connectionUrl.startswith('=c=') else modelconfig_appDb_connectionUrl|jdbc2Dbi }}"

_showUnreleasedDataByHostnamePrefix:
a: false
b: false
w: false

# Construct a prefix from hostname, like "w" or "a".
#
# This will only match when a hostname starts with a single letter, followed by a single number, followed by a period:
# "a1.plasmodb.org" => "a"
# "b2.veupathdb.org" => "b"
# "joeuser.plasmodb.org" => "joeuser.plasmodb.org"
#
# When a Hostname does not match, the original will be returned.
hostname_prefix: "{{ hostname | regex_replace('^([a-z])[0-9][.].*','\\1') }}"

showUnreleasedData: "{{ _showUnreleasedDataByHostnamePrefix[hostname_prefix] | default('true') }}"

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,35 @@ modelconfig_userDb_maxIdle: 10
modelconfig_commentdb.maxIdle: 10
commentconfig_solrUrl: "https://solr-sitesearch-{{ sitesearchsolr_env_map[prefix]|default(sitesearchsolr_env_map['default']) }}.local.apidb.org:8443/solr/site_search/"

requireLogin: "true"

prefix_vdi: "{{ hostname | regex_replace('^([a-z][0-9]).*','\\1_prefix') }}"

vdi_control_env_map:
w1_prefix: VDI_CONTROL_PROD_S
b1_prefix: VDI_CONTROL_BETA_S
q1_prefix: VDI_CONTROL_QA_S
w2_prefix: VDI_CONTROL_PROD_N
b2_prefix: VDI_CONTROL_BETA_N
q2_prefix: VDI_CONTROL_QA_N
default: VDI_CONTROL_QA_N

vdi_datasets_env_map:
w1_prefix: VDI_DATASETS_PROD_S
b1_prefix: VDI_DATASETS_BETA_S
q1_prefix: VDI_DATASETS_QA_S
w2_prefix: VDI_DATASETS_PROD_N
b2_prefix: VDI_DATASETS_BETA_N
q2_prefix: VDI_DATASETS_QA_N
default: VDI_DATASETS_QA_N

modelprop:
VDI_DATASETS_DIRECTORY: "/var/www/Common/userDatasets"
HOSTNAME: "{{ hostname }}"
PREFIX_VDI: "{{ prefix_vdi }}"
PREFIX: "{{ prefix }}"
VDI_CONTROL_SCHEMA: "{{ vdi_control_env_map[prefix_vdi]|default(vdi_control_env_map['default']) }}"
VDI_DATASETS_SCHEMA: "{{ vdi_datasets_env_map[prefix_vdi]|default(vdi_datasets_env_map['default']) }}"
GOOGLE_ANALYTICS_ID: "{{ lookup('euparc',
'attr=google_analytics_id xpath=sites/site[@hostname=\"{}\"] default='.format( hostname|swap_hostname(_host_frontends) )
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.apidb.apicommon.controller;

import java.util.Map;

import org.apidb.apicommon.model.comment.CommentFactory;
import org.apidb.apicommon.model.comment.pojo.Author;
import org.gusdb.fgputil.accountdb.UserProfile;
import org.gusdb.fgputil.events.Event;
import org.gusdb.fgputil.events.Events;
import org.gusdb.oauth2.client.veupathdb.User;
import org.gusdb.oauth2.client.veupathdb.UserProperty;
import org.gusdb.wdk.events.UserProfileUpdateEvent;
import org.gusdb.wdk.model.WdkModel;
import org.gusdb.wdk.model.WdkModelException;
Expand Down Expand Up @@ -36,13 +35,11 @@ private static void userProfileUpdateListener(Event event)
UserProfileUpdateEvent updateEvent = (UserProfileUpdateEvent) event;

// check to see if any of the property text fields changed
Map<String, String> userProps = updateEvent.getNewProfile().getProperties();
Map<String, String> oldProfileProps = updateEvent.getOldProfile()
.getProperties();
boolean commentSearchTextUpdateRequired = false;

for (String key : oldProfileProps.keySet()) {
if (!oldProfileProps.get(key).equals(userProps.get(key))) {
String[] commentProps = new String[] { "firstName", "lastName", "organization" };
for (String key : commentProps) {
UserProperty prop = User.USER_PROPERTIES.get(key);
if (!prop.getValue(updateEvent.getOldUser()).equals(prop.getValue(updateEvent.getNewUser()))) {
commentSearchTextUpdateRequired = true;
}
}
Expand All @@ -54,12 +51,12 @@ private static void userProfileUpdateListener(Event event)
// need to write updated text to comment search field
CommentFactory commentFactory = CommentFactoryManager.getCommentFactory(
updateEvent.getWdkModel().getProjectId());
UserProfile profile = updateEvent.getNewProfile();
User user = updateEvent.getNewUser();

commentFactory.updateAuthor(new Author()
.setFirstName(profile.getProperties().get("firstName"))
.setLastName(profile.getProperties().get("lastName"))
.setOrganization(profile.getProperties().get("organization"))
.setUserId(profile.getUserId()));
.setFirstName(user.getFirstName())
.setLastName(user.getLastName())
.setOrganization(user.getOrganization())
.setUserId(user.getUserId()));
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.apidb.apicommon.model.comment;

import java.util.Collection;
import java.util.stream.Collectors;

import org.apidb.apicommon.model.comment.pojo.CommentRequest;
import org.apidb.apicommon.model.comment.pojo.ExternalDatabase;
import org.gusdb.fgputil.FormatUtil;
import org.gusdb.wdk.model.WdkModel;
import org.gusdb.wdk.model.user.User;

import java.util.Collection;
import java.util.stream.Collectors;

public class CommentAlertEmailFormatter {
private static final String
FIELD_COMMENT_ID = "Comment Id",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,66 @@
package org.apidb.apicommon.model.comment;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apidb.apicommon.model.comment.pojo.*;
import org.apidb.apicommon.model.comment.repo.*;
import org.gusdb.fgputil.db.pool.DatabaseInstance;
import org.gusdb.fgputil.runtime.InstanceManager;
import org.gusdb.fgputil.runtime.Manageable;
import org.gusdb.wdk.model.WdkModel;
import org.gusdb.wdk.model.WdkModelException;
import org.gusdb.wdk.model.config.ModelConfigUserDB;
import org.gusdb.wdk.model.user.User;
import static org.apidb.apicommon.model.comment.ReferenceType.ACCESSION;
import static org.apidb.apicommon.model.comment.ReferenceType.AUTHOR;
import static org.apidb.apicommon.model.comment.ReferenceType.DIGITAL_OBJECT_ID;
import static org.apidb.apicommon.model.comment.ReferenceType.PUB_MED;

import javax.sql.DataSource;
import java.io.IOException;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;

import javax.sql.DataSource;

import org.apidb.apicommon.model.comment.pojo.Attachment;
import org.apidb.apicommon.model.comment.pojo.Author;
import org.apidb.apicommon.model.comment.pojo.Category;
import org.apidb.apicommon.model.comment.pojo.Comment;
import org.apidb.apicommon.model.comment.pojo.CommentRequest;
import org.apidb.apicommon.model.comment.pojo.ExternalDatabase;
import org.apidb.apicommon.model.comment.pojo.Project;
import org.apidb.apicommon.model.comment.pojo.PubMedReference;
import org.apidb.apicommon.model.comment.repo.DeleteAttachmentQuery;
import org.apidb.apicommon.model.comment.repo.FindCommentQuery;
import org.apidb.apicommon.model.comment.repo.GetAllAttachmentsQuery;
import org.apidb.apicommon.model.comment.repo.GetAttachmentQuery;
import org.apidb.apicommon.model.comment.repo.GetAuthorQuery;
import org.apidb.apicommon.model.comment.repo.GetCategoriesQuery;
import org.apidb.apicommon.model.comment.repo.GetCommentExistsQuery;
import org.apidb.apicommon.model.comment.repo.GetCommentQuery;
import org.apidb.apicommon.model.comment.repo.GetExternalDatabaseQuery;
import org.apidb.apicommon.model.comment.repo.HideCommentQuery;
import org.apidb.apicommon.model.comment.repo.InsertAttachmentQuery;
import org.apidb.apicommon.model.comment.repo.InsertAuthorQuery;
import org.apidb.apicommon.model.comment.repo.InsertCategoryQuery;
import org.apidb.apicommon.model.comment.repo.InsertCommentQuery;
import org.apidb.apicommon.model.comment.repo.InsertExternalDatabaseLinkQuery;
import org.apidb.apicommon.model.comment.repo.InsertExternalDatabaseQuery;
import org.apidb.apicommon.model.comment.repo.InsertLocationQuery;
import org.apidb.apicommon.model.comment.repo.InsertReferencesQuery;
import org.apidb.apicommon.model.comment.repo.InsertSequenceQuery;
import org.apidb.apicommon.model.comment.repo.InsertStableIdQuery;
import org.apidb.apicommon.model.comment.repo.Table;
import org.apidb.apicommon.model.comment.repo.UpdateAttachmentQuery;
import org.apidb.apicommon.model.comment.repo.UpdateAuthorQuery;
import org.eupathdb.sitesearch.data.comments.UserCommentUpdater;
import org.gusdb.fgputil.db.pool.DatabaseInstance;
import org.gusdb.fgputil.runtime.InstanceManager;
import org.gusdb.fgputil.runtime.Manageable;
import org.gusdb.wdk.model.WdkModel;
import org.gusdb.wdk.model.WdkModelException;
import org.gusdb.wdk.model.config.ModelConfigUserDB;
import org.gusdb.wdk.model.user.User;

import static org.apidb.apicommon.model.comment.ReferenceType.*;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
* Manages user comments on WDK records
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import org.gusdb.wdk.model.user.User;

import java.util.Map;

public class Author {

private String _firstName;

private String _lastName;
Expand Down Expand Up @@ -50,11 +49,10 @@ public Author setUserId(long userId) {
}

public static Author fromUser(final User user) {
final Map<String, String> props = user.getProfileProperties();
return new Author()
.setUserId(user.getUserId())
.setFirstName(props.get("firstName"))
.setLastName(props.get("lastName"))
.setOrganization(props.get("organization"));
.setFirstName(user.getFirstName())
.setLastName(user.getLastName())
.setOrganization(user.getOrganization());
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package org.apidb.apicommon.model.comment.repo;

import static java.sql.Types.BIGINT;
import static java.sql.Types.CLOB;
import static java.sql.Types.VARCHAR;

import java.io.StringReader;

import org.apidb.apicommon.model.comment.ReviewStatus;
import org.apidb.apicommon.model.comment.pojo.CommentRequest;
import org.apidb.apicommon.model.comment.pojo.Project;
import org.gusdb.fgputil.db.runner.BasicArgumentBatch;
import org.gusdb.fgputil.db.runner.SQLRunner;
import org.gusdb.wdk.model.user.User;

import java.io.StringReader;

import static java.sql.Types.*;

/**
* Insert a new comment record.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
public class BedGeneReporter extends BedReporter {

private enum SequenceType {
dna_components,
transcript_components,
dna_component,
transcript_component,
genomic,
spliced_genomic,
genomic_features,
Expand All @@ -49,8 +49,8 @@ private enum SplicedGenomic {
public static boolean useCoordinatesOnProteinReference(JSONObject config) throws WdkModelException {
SequenceType type = SequenceType.valueOf(config.getString("type"));
switch(type){
case dna_components:
case transcript_components:
case dna_component:
case transcript_component:
case genomic:
case spliced_genomic:
case genomic_features:
Expand Down Expand Up @@ -145,7 +145,7 @@ private static BedFeatureProvider createFeatureProvider(JSONObject config) throw
default:
throw new WdkModelException(String.format("Unsupported spliced genomic type: %s", splicedGenomic.name()));
}
case dna_components:
case dna_component:
DnaComponent dnaComponent = DnaComponent.valueOf(config.getString("dnaComponent"));
switch (dnaComponent){
case exon:
Expand All @@ -155,7 +155,7 @@ private static BedFeatureProvider createFeatureProvider(JSONObject config) throw
default:
throw new WdkModelException(String.format("Unsupported dnaComponent type: %s", dnaComponent.name()));
}
case transcript_components:
case transcript_component:
TranscriptComponent transcriptComponent = TranscriptComponent.valueOf(config.getString("transcriptComponent"));
switch(transcriptComponent){
case five_prime_utr:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected ContentDisposition getContentDisposition(JSONObject config) {

@Override
public String getHttpContentType() {
return "text/x-bed";
return "text/plain";
}

@Override
Expand Down
Loading

0 comments on commit ce523f3

Please sign in to comment.