Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deploy staging <- main #685

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<script type="text/javascript">
window.CELLXGENE = {};
window.CELLXGENE.API = {
prefix: `http://localhost:<%= CXG_SERVER_PORT %>${location.pathname}/api/`,
prefix: `http://localhost:<%= CXG_SERVER_PORT %>${location.pathname}api/`,
version: "v0.3/",
};
</script>
Expand Down
2 changes: 2 additions & 0 deletions client/src/common/types/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const STANDARD_CATEGORY_NAMES = [
"donor_id",
];

export const EXCLUDED_CATEGORY_NAMES = ["observation_joinid"];

/**
* Author of publication associated with a collection, populated from Crossref as part of collection publication
* metadata.
Expand Down
23 changes: 18 additions & 5 deletions client/src/components/categorical/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import React from "react";
import { connect } from "react-redux";
import * as globals from "../../globals";
import Category from "./category";
import { STANDARD_CATEGORY_NAMES } from "../../common/types/entities";
import {
EXCLUDED_CATEGORY_NAMES,
STANDARD_CATEGORY_NAMES,
} from "../../common/types/entities";
import {
CategoricalAnnotationColumnSchema,
Schema,
Expand All @@ -27,19 +30,23 @@ class Categories extends React.Component<{}, State> {
super(props);
this.state = {
createAnnoModeActive: false,
// eslint-disable-next-line react/no-unused-state --- FIXME: disabled temporarily
newCategoryText: "",
// eslint-disable-next-line react/no-unused-state --- FIXME: disabled temporarily
categoryToDuplicate: null,
expandedCats: new Set(),
};
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (name: any) => {
// eslint-disable-next-line react/no-unused-state --- FIXME: disabled temporarily
this.setState({ newCategoryText: name });
};

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleSelect = (name: any) => {
// eslint-disable-next-line react/no-unused-state --- FIXME: disabled temporarily
this.setState({ newCategoryText: name });
};

Expand Down Expand Up @@ -93,6 +100,14 @@ class Categories extends React.Component<{}, State> {
isCategoryNameStandard = (catName: string): boolean =>
STANDARD_CATEGORY_NAMES.includes(catName);

/**
* Determine if category is excluded.
* @param catName - Name of category.
* @returns True if given category name is in the set of standard category names.
*/
isCategoryNameExcluded = (catName: string): boolean =>
EXCLUDED_CATEGORY_NAMES.includes(catName);

/**
* Returns true if category is writable.
* @param schema - Matrix schema.
Expand All @@ -104,10 +119,7 @@ class Categories extends React.Component<{}, State> {

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() {
const {
createAnnoModeActive,
expandedCats,
} = this.state;
const { createAnnoModeActive, expandedCats } = this.state;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exis... Remove this comment to see the full error message
const { schema } = this.props;
/* Names for categorical, string and boolean types, sorted in display order. Will be rendered in this order */
Expand All @@ -121,6 +133,7 @@ class Categories extends React.Component<{}, State> {
const authorCategoryNames = selectableCategoryNames.filter(
(catName) =>
!this.isCategoryNameStandard(catName) &&
!this.isCategoryNameExcluded(catName) &&
(this.isCategoryDisplayable(schema, catName) ||
this.isCategoryWritable(schema, catName))
);
Expand Down
20 changes: 18 additions & 2 deletions client/src/components/geneExpression/quickGene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function QuickGene() {
const df: Dataframe = await annoMatrix.fetch("var", varIndex);
let dfIds: Dataframe;
const geneIdCol = "feature_id";
const isFilteredCol = "feature_is_filtered";
const isFiltered =
annoMatrix.getMatrixColumns("var").includes(isFilteredCol) &&
(await annoMatrix.fetch("var", isFilteredCol));

// if feature id column is available in var
if (annoMatrix.getMatrixColumns("var").includes(geneIdCol)) {
Expand All @@ -69,7 +73,20 @@ function QuickGene() {
}

setStatus("success");
setGeneNames(df.col(varIndex).asArray() as DataframeValue[]);

if (isFiltered) {
const isFilteredArray = isFiltered.col(isFilteredCol).asArray();
setGeneNames(
df
.col(varIndex)
.asArray()
.filter(
(_, index) => !isFilteredArray[index] && _
) as DataframeValue[]
);
} else {
setGeneNames(df.col(varIndex).asArray() as DataframeValue[]);
}
} catch (error) {
setStatus("error");
throw error;
Expand Down Expand Up @@ -159,7 +176,6 @@ function QuickGene() {
);
});
}, [userDefinedGenes, geneNames, geneIds, dispatch]);

return (
<div style={{ width: "100%", marginBottom: "16px" }}>
<H4
Expand Down
30 changes: 30 additions & 0 deletions scripts/explorer-with-portal-rdev.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/.happy/terraform/envs/rdev/main.tf b/.happy/terraform/envs/rdev/main.tf
index 2977e4d9..9b7a9f8b 100644
--- a/.happy/terraform/envs/rdev/main.tf
+++ b/.happy/terraform/envs/rdev/main.tf
@@ -19,2 +19,3 @@ module stack {
- data_locator_domain = "${var.stack_name}-backend.internal.rdev.single-cell.czi.technology"
- cxg_bucket_path = "env-rdev-cellxgene/${var.stack_name}"
+ # data_locator_domain = "${var.stack_name}-backend.internal.rdev.single-cell.czi.technology"
+ data_locator_domain = "internal-happy-rdev-backend-1100870308.us-west-2.elb.amazonaws.com"
+ cxg_bucket_path = "env-rdev-cellxgene/STACK_NAME"
diff --git a/hosted/config.yaml b/hosted/config.yaml
index 86f7ca7e..a2cc5ea2 100644
--- a/hosted/config.yaml
+++ b/hosted/config.yaml
@@ -51 +51 @@ server:
- api_base: https://${DATA_LOCATOR_DOMAIN}/dp/v1
+ api_base: http://${DATA_LOCATOR_DOMAIN}/dp/v1
diff --git a/server/dataset/dataset_metadata.py b/server/dataset/dataset_metadata.py
index 47d0e18c..87514343 100644
--- a/server/dataset/dataset_metadata.py
+++ b/server/dataset/dataset_metadata.py
@@ -25 +25 @@ def request_dataset_metadata_from_data_portal(data_portal_api_base: str, explore
- headers = {"Content-Type": "application/json", "Accept": "application/json"}
+ headers = {"Content-Type": "application/json", "Accept": "application/json", "Host": "STACK_NAME-backend.rdev.single-cell.czi.technology"}
@@ -74 +74 @@ def get_dataset_metadata(dataset_root: str, dataset_id: str, app_config: AppConf
- explorer_url_path = f"{app_config.server__app__web_base_url}/{dataset_root}/{dataset_id}"
+ explorer_url_path = f"https://STACK_NAME-explorer.rdev.single-cell.czi.technology/{dataset_root}/{dataset_id}"
@@ -127 +127 @@ def get_dataset_and_collection_metadata(dataset_root: str, dataset_id: str, app_
- res = requests.get(f"{data_locator_base_url}/collections/{collection_id}{suffix}")
+ res = requests.get(f"{data_locator_base_url}/collections/{collection_id}{suffix}", headers={"Host": "STACK_NAME-backend.rdev.single-cell.czi.technology"})
8 changes: 8 additions & 0 deletions scripts/patch-explorer-to-find-portal-rdev-stack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This script applies a (temporary) patch to Explorer so that the RDev
# stack can find the associated Portal RDev stack and successfully
# make Portal API calls during manual testing.
#
# Usage patch-explorer-to-find-portal-rdev-stack.sh <STACK_NAME>

cd $(git rev-parse --show-toplevel)
sed -e "s/STACK_NAME/${1}/g" scripts/explorer-with-portal-rdev.patch | patch
Loading