Skip to content

Commit

Permalink
Merge branch 'release_22.05' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jun 23, 2022
2 parents f17cc59 + 522e0c2 commit dbe645e
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
7 changes: 7 additions & 0 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ function buildPlugins(callback, forceRebuild) {
shell: true,
}
).status === 0;
if (!skipBuild) {
// Hash exists and is outdated, triggering a rebuild.
// Stage current hash to .orig for debugging and to
// force a plugin rebuild in the event of a failure
// (i.e. -- we're committed to a new build of this plugin).
fs.renameSync(hashFilePath, `${hashFilePath}.orig`)
}
} else {
console.log(`No build hashfile detected for ${pluginName}, generating now.`);
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/History/Content/ContentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<script>
import { backboneRoute, iframeAdd } from "components/plugins/legacyNavigation";
import { StatelessTags } from "components/Tags";
import { STATES } from "./model/states";
import { STATES, HIERARCHICAL_COLLECTION_JOB_STATES } from "./model/states";
import CollectionDescription from "./Collection/CollectionDescription";
import ContentOptions from "./ContentOptions";
import DatasetDetails from "./Dataset/DatasetDetails";
Expand Down Expand Up @@ -151,9 +151,9 @@ export default {
},
state() {
if (this.item.job_state_summary) {
for (const key of ["error", "failed", "paused", "upload", "running"]) {
if (this.item.job_state_summary[key] > 0) {
return key;
for (const state of HIERARCHICAL_COLLECTION_JOB_STATES) {
if (this.item.job_state_summary[state] > 0) {
return state;
}
}
return "ok";
Expand Down
12 changes: 11 additions & 1 deletion client/src/components/History/Content/model/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ export const STATES = {
status: "success",
text: "No data.",
},
/** the tool producing this dataset failed */
/** the tool producing this dataset has errored */
error: {
status: "danger",
text: "An error occurred with this dataset:",
icon: "exclamation-triangle",
},
/** the job has failed, this is not a dataset but a job state used in the collection job state summary. */
failed: {
status: "danger",
icon: "exclamation-triangle",
},
/** metadata discovery/setting failed or errored (but otherwise ok) */
failed_metadata: {
status: "danger",
Expand Down Expand Up @@ -74,3 +79,8 @@ export const STATES = {
spin: true,
},
};

/** We want to display a single state for a dataset collection whose elements may have mixed states.
* This list is ordered from highest to lowest priority. If any element is in error state the whole collection should be in error.
*/
export const HIERARCHICAL_COLLECTION_JOB_STATES = ["error", "failed", "queued", "upload", "paused", "running", "new"];
10 changes: 10 additions & 0 deletions client/src/components/History/Content/model/states.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { STATES, HIERARCHICAL_COLLECTION_JOB_STATES } from "./states";

describe("States", () => {
it("check if all reduced states exist and have a status set", async () => {
HIERARCHICAL_COLLECTION_JOB_STATES.forEach((jobState) => {
const alertState = STATES[jobState];
expect(alertState.status).toBeDefined();
});
});
});
2 changes: 1 addition & 1 deletion config/plugins/visualizations/PCA_3Dplot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"d3": "^7.4.4"
},
"scripts": {
"build": "mkdir static/dist && cp node_modules/pca-js/pca.min.js node_modules/plotly.js/dist/plotly.min.js node_modules/d3/dist/d3.min.js static/dist"
"build": "mkdir -p static/dist && cp node_modules/pca-js/pca.min.js node_modules/plotly.js/dist/plotly.min.js node_modules/d3/dist/d3.min.js static/dist"
}
}
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2885,7 +2885,7 @@ def disk_size(cls):
.distinct()
)
# postgres needs an alias on FROM
distinct_datasets_alias = aliased(distinct_datasets, name="datasets")
distinct_datasets_alias = aliased(distinct_datasets.subquery(), name="datasets")
# then, bind as property of history using the cls.id
size_query = (
select([func.coalesce(func.sum(distinct_datasets_alias.c.dataset_size), 0)])
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/base/webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def get_user(self):
def set_user(self, user):
"""Set the current user."""
if self.galaxy_session:
if user.bootstrap_admin_user:
if user and not user.bootstrap_admin_user:
self.galaxy_session.user = user
self.sa_session.add(self.galaxy_session)
self.sa_session.flush()
Expand Down
7 changes: 6 additions & 1 deletion lib/galaxy/webapps/galaxy/api/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
API operations on the contents of a history dataset.
"""
import logging
from io import IOBase
from io import (
BytesIO,
IOBase,
)
from typing import (
Any,
cast,
Expand Down Expand Up @@ -255,6 +258,8 @@ def display(
return FileResponse(file_name, headers=headers)
elif isinstance(display_data, ZipstreamWrapper):
return StreamingResponse(display_data.response(), headers=headers)
elif isinstance(display_data, bytes):
return StreamingResponse(BytesIO(display_data), headers=headers)
return StreamingResponse(display_data, headers=headers)

@router.get(
Expand Down

0 comments on commit dbe645e

Please sign in to comment.