From b7ade55dd051686a1e7830720c4b6e4b48991434 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:26:01 +0000 Subject: [PATCH 1/4] Bump puma from 5.6.8 to 5.6.9 in /server Bumps [puma](https://github.com/puma/puma) from 5.6.8 to 5.6.9. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.8...v5.6.9) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- server/Gemfile | 2 +- server/Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/Gemfile b/server/Gemfile index eb3b47af8..3ee244ec0 100644 --- a/server/Gemfile +++ b/server/Gemfile @@ -8,7 +8,7 @@ gem 'rails', '~> 7.1' # Use postgresql as the database for Active Record gem 'pg', '~> 1.1' # Use Puma as the app server -gem 'puma', '5.6.8' +gem 'puma', '5.6.9' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker diff --git a/server/Gemfile.lock b/server/Gemfile.lock index 4fe23250f..9fbf8a94e 100644 --- a/server/Gemfile.lock +++ b/server/Gemfile.lock @@ -273,7 +273,7 @@ GEM net-smtp (0.4.0.1) net-protocol net-ssh (7.2.1) - nio4r (2.7.0) + nio4r (2.7.3) nokogiri (1.16.5-aarch64-linux) racc (~> 1.4) nokogiri (1.16.5-arm-linux) @@ -330,7 +330,7 @@ GEM psych (5.1.2) stringio public_suffix (5.0.4) - puma (5.6.8) + puma (5.6.9) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.0) @@ -579,7 +579,7 @@ DEPENDENCIES pg (~> 1.1) pry pry-rails - puma (= 5.6.8) + puma (= 5.6.9) rack-cors (~> 1.1.1) rack-mini-profiler (~> 2.0) rails (~> 7.1) From 17f0c3996afc315719871cfca0bd41ced5f891b7 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Tue, 1 Oct 2024 15:04:53 -0500 Subject: [PATCH 2/4] Comment out any order by LENGTH statements since they cause unexplained errors on production --- .../app/graphql/types/queries/typeahead_queries.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/app/graphql/types/queries/typeahead_queries.rb b/server/app/graphql/types/queries/typeahead_queries.rb index c972266a0..396f43339 100644 --- a/server/app/graphql/types/queries/typeahead_queries.rb +++ b/server/app/graphql/types/queries/typeahead_queries.rb @@ -81,13 +81,13 @@ def disease_typeahead(query_term:) base_query = Disease.where(deprecated: false) results = base_query.where("diseases.name ILIKE ?", "%#{query_term}%") .or(base_query.where("diseases.doid ILIKE ?", "#{query_term}%")) - .order("LENGTH(diseases.name) ASC") + #.order("LENGTH(diseases.name) ASC") .limit(10) if results.size < 10 secondary_results = base_query.eager_load(:disease_aliases) .where("disease_aliases.name ILIKE ?", "%#{query_term}%") .where.not(id: results.select('id')) - .order("LENGTH(diseases.name) ASC") + #.order("LENGTH(diseases.name) ASC") .distinct .limit(10-results.size) return results + secondary_results @@ -100,7 +100,7 @@ def therapy_typeahead(query_term:) base_query = Therapy.where(deprecated: false) results = base_query.where("therapies.name ILIKE ?", "#{query_term}%") .or(base_query.where("therapies.ncit_id ILIKE ?", "%#{query_term}%")) - .order("LENGTH(therapies.name) ASC") + #.order("LENGTH(therapies.name) ASC") .limit(10) if results.size < 10 secondary_results = base_query.where('therapies.name ILIKE ?', "%#{query_term}%") @@ -110,7 +110,7 @@ def therapy_typeahead(query_term:) tertiary_results = base_query.eager_load(:therapy_aliases) .where("therapy_aliases.name ILIKE ?", "%#{query_term}%") .where.not(id: results.select('id') + secondary_results.select('id')) - .order("LENGTH(therapies.name) ASC") + #.order("LENGTH(therapies.name) ASC") .distinct .limit(10-results.size) @@ -131,14 +131,14 @@ def feature_typeahead(query_term:, feature_type: nil) end results = base_query.where('features.name ILIKE ?', "#{query_term}%") - .order("LENGTH(features.name) ASC") + #.order("LENGTH(features.name) ASC") .limit(10) if results.size < 10 secondary_results = base_query.eager_load(:feature_aliases) .where("feature_aliases.name ILIKE ?", "#{query_term}%") .where.not(id: results.select('id')) - .order("LENGTH(features.name) ASC") + #.order("LENGTH(features.name) ASC") .distinct .limit(10 - results.size) return (results + secondary_results).uniq From 2d1066ef3096513ba6ace8afd7743c7fee7b6298 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 2 Oct 2024 10:26:55 -0500 Subject: [PATCH 3/4] Add coordinate stub on gene variant creation --- server/app/models/activities/create_variant.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/app/models/activities/create_variant.rb b/server/app/models/activities/create_variant.rb index 2a1cd1a1f..f4216323b 100644 --- a/server/app/models/activities/create_variant.rb +++ b/server/app/models/activities/create_variant.rb @@ -32,9 +32,19 @@ def call_actions @variant = cmd.variant @molecular_profile = cmd.molecular_profile + + stub_coordinates + variant.save! + events << cmd.events end + def stub_coordinates + if variant.type == 'Variants::GeneVariant' + variant.coordinates = VariantCoordinate.generate_stub(variant, 'Gene Variant Coordinate') + end + end + def linked_entities molecular_profile end From ff24bc3a99d683f49ecc5d7548c983d12c575229 Mon Sep 17 00:00:00 2001 From: Adam Coffman Date: Wed, 2 Oct 2024 10:42:34 -0500 Subject: [PATCH 4/4] actually invoke promise callback for count calculation --- server/app/graphql/types/variants/gene_variant_type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app/graphql/types/variants/gene_variant_type.rb b/server/app/graphql/types/variants/gene_variant_type.rb index 44fcb99c6..742f27af2 100644 --- a/server/app/graphql/types/variants/gene_variant_type.rb +++ b/server/app/graphql/types/variants/gene_variant_type.rb @@ -42,7 +42,7 @@ def mane_select_transcript def open_revision_count Loaders::AssociationCountLoader.for(object.class, association: :open_revisions).load(object.id).then do |count| Loaders::AssociationLoader.for(Variants::GeneVariant, :coordinates).load(object).then do |coord| - Loaders::AssociationCountLoader.for(VariantCoordinate, association: :open_revisions).load(coord.id) do |coord_count| + Loaders::AssociationCountLoader.for(VariantCoordinate, association: :open_revisions).load(coord.id).then do |coord_count| count + coord_count end end