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

Merge 24.0 into dev #18177

Merged
merged 23 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b388b81
Drop unnecessary commit() call
mvdbeek May 13, 2024
2950ae6
Fix addition of default collection to history
mvdbeek May 13, 2024
25f8d7e
Don't flush for inner elements
mvdbeek May 14, 2024
cd47ef6
Merge pull request #18131 from mvdbeek/no_commit_in_delete_pja
dannon May 14, 2024
e1815c3
Merge pull request #18132 from mvdbeek/fix_data_default_values_not_ge…
jdavcs May 14, 2024
48e1eda
[24.0] Fix undefined `reading 'produces_entry_points'` TypeError
ahmedhamidawan May 14, 2024
a20d163
add a `LoadingSpan` if there is no job response
ahmedhamidawan May 14, 2024
81abefe
Fix accessing config prior to it potentially being populated. We don't
dannon May 14, 2024
62e78b7
Merge pull request #18141 from ahmedhamidawan/fix_tool_success_prop
mvdbeek May 14, 2024
3180435
Fix Legacy HTML page view
mvdbeek May 14, 2024
6a60cc5
Merge pull request #18143 from dannon/fix-config-access-storagemanager
davelopez May 14, 2024
91f7bec
Use Array.from instead of Object.values
mvdbeek May 15, 2024
ab56ee1
Merge pull request #18145 from mvdbeek/fix_legacy_page_view
mvdbeek May 15, 2024
7b509b6
Delay tool form rendering until config is loaded
mvdbeek May 15, 2024
69e7940
Raise RequestParameterInvalidException when url is invalid
mvdbeek May 15, 2024
6b06aac
Merge pull request #18151 from mvdbeek/delay_tool_form_rendering_unti…
jmchilton May 15, 2024
34404bd
Drop redundant error message
mvdbeek May 15, 2024
5280a79
Merge pull request #18155 from mvdbeek/raise_invalid_request_invalid_url
mvdbeek May 15, 2024
d638bf4
Merge pull request #18156 from mvdbeek/drop_redundant_error_message
mvdbeek May 15, 2024
7c60446
Fix error message on access to restricted zenodo records
davelopez May 17, 2024
d6a76f7
Display record URL for verification
davelopez May 17, 2024
d613130
Merge pull request #18169 from davelopez/24.0_fix_invenio_restricted_…
mvdbeek May 17, 2024
5890212
Merge branch 'release_24.0' into dev
mvdbeek May 20, 2024
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/src/components/PageDisplay/PageHtml.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
if (content) {
const vDom = document.createElement("div");
vDom.innerHTML = content;
const children = vDom.children;
const children = Array.from(vDom.children);
children.forEach((child) => {
if (child.classList.contains("embedded-item")) {
const splitId = child.id.split("-");
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Tool/ToolForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="currentUser && currentHistoryId">
<div v-if="currentUser && currentHistoryId && isConfigLoaded">
<b-alert :show="messageShow" :variant="messageVariant">
{{ messageText }}
</b-alert>
Expand Down
13 changes: 10 additions & 3 deletions client/src/components/Tool/ToolSuccess.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script setup lang="ts">
import { BAlert } from "bootstrap-vue";
import { computed, onMounted } from "vue";
import { useRouter } from "vue-router/composables";

import { useConfig } from "@/composables/config";
import { useJobStore } from "@/stores/jobStore";

import LoadingSpan from "../LoadingSpan.vue";
import ToolRecommendation from "../ToolRecommendation.vue";
import ToolSuccessMessage from "./ToolSuccessMessage.vue";
import Webhook from "@/components/Common/Webhook.vue";
Expand All @@ -31,10 +33,15 @@ onMounted(() => {

<template>
<section>
<div v-if="jobResponse.produces_entry_points">
<ToolEntryPoints v-for="job in jobResponse.jobs" :key="job.id" :job-id="job.id" />
<BAlert v-if="!jobResponse" variant="info" show>
<LoadingSpan message="Waiting on a job response" />
</BAlert>
<div v-else>
<div v-if="jobResponse?.produces_entry_points">
<ToolEntryPoints v-for="job in jobResponse.jobs" :key="job.id" :job-id="job.id" />
</div>
<ToolSuccessMessage :job-response="jobResponse" :tool-name="toolName" />
</div>
<ToolSuccessMessage :job-response="jobResponse" :tool-name="toolName" />
<Webhook type="tool" :tool-id="jobDef.tool_id" />
<ToolRecommendation v-if="showRecommendation" :tool-id="jobDef.tool_id" />
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function onConfirmCleanupSelected(selectedItems: CleanableItem[]) {
</b-alert>
</b-row>
<b-row class="justify-content-md-center mb-5">
<b-alert v-if="config.enable_quotas" show>
<b-alert v-if="config?.enable_quotas" show>
{{ localize("The storage manager only shows elements that count towards your disk quota.") }}
<b-link :href="config.quota_url" target="_blank">{{ localize("Learn more") }}</b-link>
</b-alert>
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/files/sources/invenio.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Unpack,
)

from galaxy.exceptions import AuthenticationRequired
from galaxy.files import OptionalUserContext
from galaxy.files.sources import (
AnyRemoteEntry,
Expand Down Expand Up @@ -434,6 +435,9 @@ def _get_request_headers(self, user_context: OptionalUserContext):
return headers

def _ensure_response_has_expected_status_code(self, response, expected_status_code: int):
if response.status_code == 403:
record_url = response.url.replace("/api", "").replace("/files", "")
raise AuthenticationRequired(f"Please make sure you have the necessary permissions to access: {record_url}")
if response.status_code != expected_status_code:
error_message = self._get_response_error_message(response)
raise Exception(
Expand Down
7 changes: 6 additions & 1 deletion lib/galaxy/files/uris.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from galaxy.exceptions import (
AdminRequiredException,
ConfigDoesNotAllowException,
RequestParameterInvalidException,
)
from galaxy.files import (
ConfiguredFileSources,
Expand Down Expand Up @@ -125,7 +126,11 @@ def validate_non_local(uri: str, ip_allowlist: List[IpAllowedListEntryT]) -> str
# safe to log out, no credentials/request path, just an IP + port
log.debug("parsed url %s, port: %s", parsed_url, port)
# Call getaddrinfo to resolve hostname into tuples containing IPs.
addrinfo = socket.getaddrinfo(parsed_url, port)
try:
addrinfo = socket.getaddrinfo(parsed_url, port)
except socket.gaierror as e:
log.debug("Could not resolve url '%': %'", url, e)
raise RequestParameterInvalidException(f"Could not verify url '{url}'.")
# Get the IP addresses that this entry resolves to (uniquely)
# We drop:
# AF_* family: It will resolve to AF_INET or AF_INET6, getaddrinfo(3) doesn't even mention AF_UNIX,
Expand Down
3 changes: 0 additions & 3 deletions lib/galaxy/job_execution/actions/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from markupsafe import escape

from galaxy.model import PostJobActionAssociation
from galaxy.model.base import transaction
from galaxy.util import send_mail
from galaxy.util.custom_logging import get_logger

Expand Down Expand Up @@ -370,8 +369,6 @@ def execute(cls, app, sa_session, action, job, replacement_dict, final_job_state
# POTENTIAL ISSUES: When many outputs are being finish()ed
# concurrently, sometimes non-terminal steps won't be cleaned up
# because of the lag in job state updates.
with transaction(sa_session):
sa_session.commit()
if not job.workflow_invocation_step:
log.debug("This job is not part of a workflow invocation, delete intermediates aborted.")
return
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ def __handle_waiting_jobs(self):
self.sa_session.add(dataset_assoc.dataset.dataset)
self.sa_session.add(job)
elif job_state == JOB_ERROR:
log.error("(%d) Error checking job readiness" % job.id)
# A more informative message is shown wherever the job state is set to error
pass
else:
log.error("(%d) Job in unknown state '%s'" % (job.id, job_state))
new_waiting_jobs.append(job.id)
Expand Down
17 changes: 12 additions & 5 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,9 @@ def to_text(self, value):

# Code from CWL branch to massage in order to be shared across tools and workflows,
# and for CWL artifacts as well as Galaxy ones.
def raw_to_galaxy(app: "MinimalApp", history: "History", as_dict_value: Dict[str, Any]) -> "HistoryItem":
def raw_to_galaxy(
app: "MinimalApp", history: "History", as_dict_value: Dict[str, Any], commit: bool = True
) -> "HistoryItem":
object_class = as_dict_value["class"]
if object_class == "File":
# TODO: relative_to = "/"
Expand Down Expand Up @@ -2728,7 +2730,8 @@ def raw_to_galaxy(app: "MinimalApp", history: "History", as_dict_value: Dict[str
app.model.session.add(primary_data)
history.stage_addition(primary_data)
history.add_pending_items()
app.model.session.flush()
if commit:
app.model.session.commit()
return primary_data
else:
name = as_dict_value.get("name")
Expand All @@ -2740,14 +2743,16 @@ def raw_to_galaxy(app: "MinimalApp", history: "History", as_dict_value: Dict[str
name=name,
collection=collection,
)
app.model.session.add(hdca)

def write_elements_to_collection(has_elements, collection_builder):
element_dicts = has_elements.get("elements")
for element_dict in element_dicts:
element_class = element_dict["class"]
identifier = element_dict["identifier"]
if element_class == "File":
hda = raw_to_galaxy(app, history, element_dict)
# Don't commit for inner elements
hda = raw_to_galaxy(app, history, element_dict, commit=False)
collection_builder.add_dataset(identifier, hda)
else:
subcollection_builder = collection_builder.get_level(identifier)
Expand All @@ -2756,8 +2761,10 @@ def write_elements_to_collection(has_elements, collection_builder):
collection_builder = builder.BoundCollectionBuilder(collection)
write_elements_to_collection(as_dict_value, collection_builder)
collection_builder.populate()
app.model.session.add(hdca)
app.model.session.flush()
history.stage_addition(hdca)
history.add_pending_items()
if commit:
app.model.session.commit()
return hdca


Expand Down
Loading