Skip to content

Commit

Permalink
Merge pull request #2110 from broadinstitute/development
Browse files Browse the repository at this point in the history
Release 1.77.1
  • Loading branch information
eweitz authored Aug 15, 2024
2 parents 0bcbab2 + 809a8ae commit 3a0d9a2
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build requested Docker image
run: |
# determine if VERSION_TAG should be set
if [[ ${{ github.ref_name }} == 'master' ]]; then
if [[ ${{ github.ref_name }} == 'main' ]]; then
bin/build_image.sh
else
bin/build_image.sh -v ${{ github.ref_name }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/delete-branch-on-merge-to-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
- closed
branches:
- 'development'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
merge_job:
# this job will only run if the PR has been merged
Expand All @@ -21,7 +21,7 @@ jobs:
# from the github actions marketplace repo here: https://github.com/pabio/delete-merged-action
uses: koj-co/delete-merged-action@master
with:
# do not delete master, development branches
branches: "!master, !development, *"
# do not delete main, development branches
branches: "!main, !development, *"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
12 changes: 6 additions & 6 deletions .github/workflows/delete-branch-on-merge-to-master.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Selectively delete feature branch after merge to master

# Only run the workflow when a PR that targets master is closed
# Only run the workflow when a PR that targets main is closed
on:
pull_request:
types:
- closed
branches:
- 'master'
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
merge_job:
# this job will only run if the PR has been merged
Expand All @@ -21,7 +21,7 @@ jobs:
# from the github actions marketplace repo here: https://github.com/pabio/delete-merged-action
uses: koj-co/delete-merged-action@master
with:
# do not delete master, development, or hotfix-release branches
branches: "!master, !development, !*hotfix*, *"
# do not delete main, development, or hotfix-release branches
branches: "!main, !development, !*hotfix*, *"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
if [[ "${{ github.event.inputs.rollback }}" = "Y" ]]; then
ROLLBACK="-R"
fi
bin/deploy-github.sh -b master -e production -g ${{ env.GOOGLE_CLOUD_PROJECT }} -h ${{ env.REMOTE_HOST }} -p ${{ env.CONFIG_FILENAME }} -s ${{ env.DEFAULT_SA_KEYFILE }} -r ${{ env.READONLY_SA_KEYFILE }} $ROLLBACK
bin/deploy-github.sh -b main -e production -g ${{ env.GOOGLE_CLOUD_PROJECT }} -h ${{ env.REMOTE_HOST }} -p ${{ env.CONFIG_FILENAME }} -s ${{ env.DEFAULT_SA_KEYFILE }} -r ${{ env.READONLY_SA_KEYFILE }} $ROLLBACK
2 changes: 1 addition & 1 deletion .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- development
- master
- main
pull_request:
env:
DOCKER_IMAGE_NAME: "gcr.io/broad-singlecellportal-staging/single-cell-portal"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@ To deploy or access an instance of Single Cell Portal in production mode:
* Once connected, switch to root via `sudo -i`.
* Change directory to where the portal is running, for instance: `cd /home/docker-user/deployments/single_cell_portal`
* Switch to the Docker user: `sudo -u docker-user -Hs`
* Get latest source code from GitHub: `git pull origin master`
* Get latest source code from GitHub: `git pull origin main`
* Exit Docker user to return to root: `exit`
* Ensure no uploads are occuring: `tail -n 1000 log/production.log`
* Put the portal in maintenance mode: `bin/enable_maintenance.sh on`
* Stop the portal: `docker stop single_cell`
* Remove the container instance: `docker rm single_cell`
* Launch a new instance of the portal with the updated container (please refer to the
[bin/boot_docker](https://github.com/broadinstitute/single_cell_portal_core/blob/master/bin/boot_docker) script for more
[bin/boot_docker](https://github.com/broadinstitute/single_cell_portal_core/blob/main/bin/boot_docker) script for more
information regarding all possible arguments as they are not all listed here):


Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/javascript/components/upload/ClusteringFileForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ClusteringFileForm({
trigger={['hover', 'focus']}
rootClose placement="top"
overlay={obsmKeyNameHelpContent()}>
<span> .obsm key name <FontAwesomeIcon icon={faQuestionCircle}/></span>
<span> .obsm key name * <FontAwesomeIcon icon={faQuestionCircle}/></span>
</OverlayTrigger>
</span>

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/upload/ClusteringStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function getDetailsContent(isAnnDataExperience, clusterFiles, addNewFile) {
<div className="form-terra">
<div className="row">
<div className="col-md-12">
<p>A <a href="https://github.com/broadinstitute/single_cell_portal/blob/master/demo_data/cluster_example.txt" target="_blank" rel="noreferrer">cluster file</a> (.txt or .txt.gz) contains any cluster ordinations and optional cluster-specific metadata.</p>
<p>A <a href="https://github.com/broadinstitute/single_cell_portal/blob/main/demo_data/cluster_example.txt" target="_blank" rel="noreferrer">cluster file</a> (.txt or .txt.gz) contains any cluster ordinations and optional cluster-specific metadata.</p>
</div>
</div>
<div className="row">
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/upload/CoordinateLabelStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function CoordinateLabelForm({
<div className="col-md-12">
<div className="form-terra">
<p>
A <a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/master/demo_data/coordinate_labels_example.txt" target="_blank" rel="noopener noreferrer">Coordinate Label File</a>
A <a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/main/demo_data/coordinate_labels_example.txt" target="_blank" rel="noopener noreferrer">Coordinate Label File</a>
&nbsp;specifies labels to display at specified coordinates of a cluster.
</p>
<pre>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/upload/GeneListStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function GeneListForm({
<p>
The file must be tab- or comma-delimited plain text (.txt) with the value &quot;GENE NAMES&quot; in the first column, and cluster names in each successive column.
<br/>
<a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/master/demo_data/marker_gene_list_example.txt" target="_blank" rel="noreferrer noopener">
<a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/main/demo_data/marker_gene_list_example.txt" target="_blank" rel="noreferrer noopener">
Example file
</a>
<br/>
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/upload/RawCountsStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ export function getExpressionFileInfoMessage(isAnnDataExperience, expressionType
const expressionFileStructureHelp = <>
<div className="row">
<div className="col-sm-6 padded">
<a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/master/demo_data/expression_example.txt" target="_blank" rel="noreferrer noopener">Dense matrix</a>
<a href="https://raw.githubusercontent.com/broadinstitute/single_cell_portal/main/demo_data/expression_example.txt" target="_blank" rel="noreferrer noopener">Dense matrix</a>
<pre>GENE&#09;CELL_1&#9;CELL_2&#09;CELL_3&#09;...<br/>It2ma&#09;0&#09;0&#09;0&#09;...<br/>Sergef&#09;0&#09;7.092&#09;0&#09;...<br/>Chil5&#09;0&#09;0&#09;0&#09;...<br/>Fgfr3&#09;0&#9;0&#09;0.978&#09;<br/>...</pre>
A “Dense matrix” is a file (.txt, .tsv, or .csv)** that has a header row containing the value “GENE” in the first column, and single cell names in each successive column.
</div>
<div className="col-sm-6 padded" >
<a href="https://github.com/broadinstitute/single_cell_portal_core/blob/master/test/test_data/GRCh38/matrix.mtx" target="_blank" rel="noreferrer noopener">Sparse matrix (.mtx)</a>
<a href="https://github.com/broadinstitute/single_cell_portal_core/blob/main/test/test_data/GRCh38/matrix.mtx" target="_blank" rel="noreferrer noopener">Sparse matrix (.mtx)</a>
<pre>%%MatrixMarket matrix coordinate real general<br/>%<br/>17123 31231 124124<br/>1 1241 1.0<br/>1 1552 2.0<br/>...</pre>
A “Sparse matrix,” as seen in <a href="https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/output/matrices" target="_blank" rel="noreferrer noopener">10x Genomics</a>
, is a Matrix Market file (.mtx, .mm, or .txt)** that contains a sparse matrix in coordinate form.<br/>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/upload/SpatialStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function SpatialUploadForm({
<div className="row">
<div className="col-md-12">
<p>
A <a href="https://github.com/broadinstitute/single_cell_portal/blob/master/demo_data/spatial_example.txt" target="_blank" rel="noreferrer">spatial file</a>
A <a href="https://github.com/broadinstitute/single_cell_portal/blob/main/demo_data/spatial_example.txt" target="_blank" rel="noreferrer">spatial file</a>
&nbsp;(.txt or .txt.gz) contains <a href="https://en.wikipedia.org/wiki/Spatial_transcriptomics" target="_blank" rel="noreferrer">spatial transcriptomics</a> cell coordinates and optional metadata.
</p>
</div>
Expand Down
13 changes: 8 additions & 5 deletions app/javascript/lib/metrics-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,15 @@ function getAnalyticsPageName() {
/**
* gets the tab name for analytics
*/
function getTabProperty() {
if (window.location.href?.match(/\?tab=/)) {
return window.location.href.split('?tab=')[1]
} else {
return window.location.hash?.replace(/#/, '')
export function getTabProperty() {
let tabParam = window.location.hash?.replace(/#/, '')
if (window.location.search) {
const searchParams = new URLSearchParams(window.location.search)
if (searchParams.has('tab')) {
tabParam = searchParams.get('tab')
}
}
return tabParam
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/javascript/lib/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const SPECIAL_LEGEND_ENTRIES = [UNSPECIFIED_ANNOTATION_NAME, FILTERED_TRACE_NAME
* central memory CD4-positive, alpha-beta T cell
*/
export function safenLabels(labels) {
if (!labels) {return labels} // Prevents erroring gene exp scatter on legend filter
if (Array.isArray(labels)) {
return labels.map(label => label.replaceAll(',', '-'))
} else {
Expand Down
4 changes: 2 additions & 2 deletions bin/deploy-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function main {
# defaults
SSH_USER="jenkins"
DESTINATION_BASE_DIR='/home/jenkins/deployments/single_cell_portal_core'
GIT_BRANCH="master"
GIT_BRANCH="main"
PASSENGER_APP_ENV="production"
BOOT_COMMAND="bin/remote_deploy.sh"
SCP_REPO="https://github.com/broadinstitute/single_cell_portal_core.git"
Expand Down Expand Up @@ -170,7 +170,7 @@ USAGE:
[OPTIONS]
-e VALUE set the environment to boot the portal in (defaults to production)
-b VALUE set the branch to pull from git (defaults to master)
-b VALUE set the branch to pull from git (defaults to main)
-d VALUE set the target directory to deploy from (defaults to $DESTINATION_BASE_DIR)
-S VALUE set the path to SSH_KEYFILE (private key for SSH auth, no default, not needing except for manual testing)
-h VALUE set the DESTINATION_HOST (remote GCP VM to SSH into, no default)
Expand Down
8 changes: 7 additions & 1 deletion test/js/explore/plot-utils.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PlotUtils from 'lib/plot'
import PlotUtils, { safenLabels } from 'lib/plot'

describe('Plot grouping function cache', () => {
it('makes traces based on the annotation groups', async () => {
Expand Down Expand Up @@ -165,4 +165,10 @@ describe('Plot grouping function cache', () => {
...data
})
})

it('does not error when raw labels are undefined', async () => {
// This prevents erroring gene expression scatter plots up applying a legend filter
const safeLabels = safenLabels(undefined)
expect(safeLabels).toBeUndefined()
})
})
25 changes: 24 additions & 1 deletion test/js/metrics-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fetch = require('node-fetch')
import { screen, render, fireEvent } from '@testing-library/react'
import React from 'react';

import {logClick, logClickLink, logMenuChange, setMetricsApiMockFlag} from 'lib/metrics-api'
import { logClick, logClickLink, logMenuChange, setMetricsApiMockFlag, getTabProperty } from 'lib/metrics-api'
import {logToSentry} from 'lib/sentry-logging'
import * as SCPContextProvider from '~/providers/SCPContextProvider'
import * as Sentry from '@sentry/react'
Expand Down Expand Up @@ -157,4 +157,27 @@ describe('Library for client-side usage analytics', () => {
expect(numDroppedWhenInfo).toEqual(1)
})

it('sets tab parameter correctly', () => {
delete global.window.location
global.window = Object.create(window)
global.window.location = {
pathname: '/single_cell/study/SCP1234'
}
let enabledTab = getTabProperty()
expect(enabledTab).toBeUndefined()

global.window.location = {
hash: '#study-visualize',
pathname: '/single_cell/study/SCP1234'
}
enabledTab = getTabProperty()
expect(enabledTab).toEqual('study-visualize')

global.window.location = {
search: '?cluster=foo&genes=bar&tab=distribution',
pathname: '/single_cell/study/SCP1234'
}
enabledTab = getTabProperty()
expect(enabledTab).toEqual('distribution')
})
})

0 comments on commit 3a0d9a2

Please sign in to comment.