Skip to content

Commit 4afb1be

Browse files
committed
Update schema, lint
1 parent a1c717c commit 4afb1be

6 files changed

Lines changed: 43 additions & 49 deletions

File tree

client/src/api/schema/schema.ts

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7217,7 +7217,7 @@ export interface components {
72177217
*/
72187218
outputs: (
72197219
| components["schemas"]["IncomingToolOutputDataset"]
7220-
| components["schemas"]["IncomingToolOutputCollection-Input"]
7220+
| components["schemas"]["IncomingToolOutputCollection"]
72217221
| components["schemas"]["ToolOutputText"]
72227222
| components["schemas"]["ToolOutputInteger"]
72237223
| components["schemas"]["ToolOutputFloat"]
@@ -12308,6 +12308,12 @@ export interface components {
1230812308
* @description Data of an export record associated with a history that was archived.
1230912309
*/
1231012310
ExportRecordData: {
12311+
/**
12312+
* Ignore Errors
12313+
* @description Last resort. If True, skip serialization errors caused by missing provenance (e.g. orphan implicit collection job associations, null job param refs from older histories that pre-date collections) instead of failing. Exported data may be incomplete or corrupt.
12314+
* @default false
12315+
*/
12316+
ignore_errors: boolean;
1231112317
/**
1231212318
* Include deleted
1231312319
* @description Include file contents for deleted datasets (if include_files is True).
@@ -15751,32 +15757,7 @@ export interface components {
1575115757
type: "in_range";
1575215758
};
1575315759
/** IncomingToolOutputCollection */
15754-
"IncomingToolOutputCollection-Input": {
15755-
/**
15756-
* hidden
15757-
* @description If true, the output will not be shown in the history.
15758-
*/
15759-
hidden?: boolean | null;
15760-
/**
15761-
* label
15762-
* @description Output label. Will be used as dataset name in history.
15763-
*/
15764-
label?: string | null;
15765-
/**
15766-
* name
15767-
* @description Parameter name. Used when referencing parameter in workflows.
15768-
*/
15769-
name?: string | null;
15770-
/** structure */
15771-
structure: components["schemas"]["ToolOutputCollectionStructure"];
15772-
/**
15773-
* @description discriminator enum property added by openapi-typescript
15774-
* @enum {string}
15775-
*/
15776-
type: "collection";
15777-
};
15778-
/** IncomingToolOutputCollection */
15779-
"IncomingToolOutputCollection-Output": {
15760+
IncomingToolOutputCollection: {
1578015761
/**
1578115762
* hidden
1578215763
* @description If true, the output will not be shown in the history.
@@ -24786,7 +24767,7 @@ export interface components {
2478624767
*/
2478724768
outputs: (
2478824769
| components["schemas"]["IncomingToolOutputDataset"]
24789-
| components["schemas"]["IncomingToolOutputCollection-Input"]
24770+
| components["schemas"]["IncomingToolOutputCollection"]
2479024771
| components["schemas"]["ToolOutputText"]
2479124772
| components["schemas"]["ToolOutputInteger"]
2479224773
| components["schemas"]["ToolOutputFloat"]
@@ -24881,7 +24862,7 @@ export interface components {
2488124862
*/
2488224863
outputs: (
2488324864
| components["schemas"]["IncomingToolOutputDataset"]
24884-
| components["schemas"]["IncomingToolOutputCollection-Output"]
24865+
| components["schemas"]["IncomingToolOutputCollection"]
2488524866
| components["schemas"]["ToolOutputText"]
2488624867
| components["schemas"]["ToolOutputInteger"]
2488724868
| components["schemas"]["ToolOutputFloat"]
@@ -25778,6 +25759,12 @@ export interface components {
2577825759
* @description Override xref for 'description domain' when generating BioCompute object.
2577925760
*/
2578025761
bco_override_xref?: components["schemas"]["XrefItem"][] | null;
25762+
/**
25763+
* Ignore Errors
25764+
* @description Last resort. If True, skip serialization errors caused by missing provenance (e.g. orphan implicit collection job associations, null job param refs from older histories that pre-date collections) instead of failing. Exported data may be incomplete or corrupt.
25765+
* @default false
25766+
*/
25767+
ignore_errors: boolean;
2578125768
/**
2578225769
* Include deleted
2578325770
* @description Include file contents for deleted datasets (if include_files is True).
@@ -25809,6 +25796,12 @@ export interface components {
2580925796
};
2581025797
/** WriteStoreToPayload */
2581125798
WriteStoreToPayload: {
25799+
/**
25800+
* Ignore Errors
25801+
* @description Last resort. If True, skip serialization errors caused by missing provenance (e.g. orphan implicit collection job associations, null job param refs from older histories that pre-date collections) instead of failing. Exported data may be incomplete or corrupt.
25802+
* @default false
25803+
*/
25804+
ignore_errors: boolean;
2581225805
/**
2581325806
* Include deleted
2581425807
* @description Include file contents for deleted datasets (if include_files is True).

lib/galaxy/managers/model_stores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def write_history_to(self, request: WriteHistoryTo):
268268
model_store_format,
269269
export_files=export_files,
270270
user_context=user_context,
271-
tolerate_missing_data=request.tolerate_missing_data,
271+
ignore_errors=request.ignore_errors,
272272
)(request.target_uri)
273273
with export_store:
274274
history = self._history_manager.by_id(request.history_id)

lib/galaxy/model/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def __init__(
459459
serialize_dataset_objects: Optional[bool] = None,
460460
serialize_files_handler: Optional[SerializeFilesHandler] = None,
461461
strip_metadata_files: Optional[bool] = None,
462-
tolerate_missing_data: bool = False,
462+
ignore_errors: bool = False,
463463
) -> None:
464464
self.for_edit = for_edit
465465
if serialize_dataset_objects is None:
@@ -474,7 +474,7 @@ def __init__(
474474
# When True, serializers emit best-effort output for histories whose imports left
475475
# unresolved references (orphan ImplicitCollectionJobsJobAssociation rows, null-id
476476
# job param refs) instead of raising. Intended for background archival exports.
477-
self.tolerate_missing_data = tolerate_missing_data
477+
self.ignore_errors = ignore_errors
478478

479479
def attach_identifier(self, id_encoder, obj, ret_val):
480480
if self.for_edit and obj.id:
@@ -498,7 +498,7 @@ def get_identifier(self, id_encoder, obj):
498498

499499
def get_identifier_for_id(self, id_encoder, obj_id):
500500
if not obj_id:
501-
if self.tolerate_missing_data:
501+
if self.ignore_errors:
502502
return obj_id
503503
raise NotImplementedError()
504504
if self.for_edit:
@@ -2961,7 +2961,7 @@ def _serialize(self, id_encoder, serialization_options):
29612961
jobs=[
29622962
serialization_options.get_identifier(id_encoder, j_a.job)
29632963
for j_a in self.jobs
2964-
if j_a.job is not None or not serialization_options.tolerate_missing_data
2964+
if j_a.job is not None or not serialization_options.ignore_errors
29652965
],
29662966
)
29672967
serialization_options.attach_identifier(id_encoder, self, rval)

lib/galaxy/model/store/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ def __init__(
19651965
strip_metadata_files: bool = True,
19661966
serialize_jobs: bool = True,
19671967
user_context=None,
1968-
tolerate_missing_data: bool = False,
1968+
ignore_errors: bool = False,
19691969
) -> None:
19701970
"""
19711971
:param export_directory: path to export directory. Will be created if it does not exist.
@@ -2002,7 +2002,7 @@ def __init__(
20022002
serialize_dataset_objects=serialize_dataset_objects,
20032003
strip_metadata_files=strip_metadata_files,
20042004
serialize_files_handler=self,
2005-
tolerate_missing_data=tolerate_missing_data,
2005+
ignore_errors=ignore_errors,
20062006
)
20072007
self.export_files = export_files
20082008
self.included_datasets: dict[model.DatasetInstance, tuple[model.DatasetInstance, bool]] = {}
@@ -3042,15 +3042,15 @@ def get_export_store_factory(
30423042
export_files=None,
30433043
bco_export_options: Optional[BcoExportOptions] = None,
30443044
user_context=None,
3045-
tolerate_missing_data: bool = False,
3045+
ignore_errors: bool = False,
30463046
) -> Callable[[StrPath], FileSourceModelExportStore]:
30473047
export_store_class: type[FileSourceModelExportStore]
30483048
export_store_class_kwds = {
30493049
"app": app,
30503050
"export_files": export_files,
30513051
"serialize_dataset_objects": False,
30523052
"user_context": user_context,
3053-
"tolerate_missing_data": tolerate_missing_data,
3053+
"ignore_errors": ignore_errors,
30543054
}
30553055
if download_format in ["tar.gz", "tgz"]:
30563056
export_store_class = TarModelExportStore

lib/galaxy/schema/schema.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,9 +1924,14 @@ class WriteStoreToPayload(StoreExportPayload):
19241924
title="Target URI",
19251925
description="Galaxy Files URI to write mode store content to.",
19261926
)
1927-
tolerate_missing_data: bool = Field(
1927+
ignore_errors: bool = Field(
19281928
default=False,
1929-
description="Best-effort export: skip unresolved references instead of failing.",
1929+
description=(
1930+
"Last resort. If True, skip serialization errors caused by missing "
1931+
"provenance (e.g. orphan implicit collection job associations, null "
1932+
"job param refs from older histories that pre-date collections) "
1933+
"instead of failing. Exported data may be incomplete or corrupt."
1934+
),
19301935
)
19311936

19321937

test/unit/data/model/test_model_store.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ def test_export_history_with_orphan_icjja(tmp_path):
778778
"""Orphan ImplicitCollectionJobsJobAssociation rows (job_id NULL) are
779779
persisted by the import path when an ICJ references a job key not in
780780
object_import_tracker.jobs_by_key. The next export crashes in
781-
get_identifier(j_a.job=None); tolerate_missing_data skips the orphan."""
781+
get_identifier(j_a.job=None); ignore_errors skips the orphan."""
782782
app = _mock_app()
783783
u, h, _d1, _d2, j = _setup_simple_cat_job(app)
784784

@@ -794,17 +794,15 @@ def test_export_history_with_orphan_icjja(tmp_path):
794794
app.add_and_commit(icj, linked, to_orphan)
795795

796796
# Mimic the post-import state: drop the FK so the row becomes an orphan.
797-
to_orphan.job = None
797+
to_orphan.job = None # type: ignore[assignment]
798798
app.commit()
799799

800800
with pytest.raises(AttributeError):
801801
with store.TarModelExportStore(str(tmp_path / "strict.tgz"), app=app, export_files="copy") as export_store:
802802
export_store.export_history(h)
803803

804804
tolerant_archive = str(tmp_path / "tolerant.tgz")
805-
with store.TarModelExportStore(
806-
tolerant_archive, app=app, export_files="copy", tolerate_missing_data=True
807-
) as export_store:
805+
with store.TarModelExportStore(tolerant_archive, app=app, export_files="copy", ignore_errors=True) as export_store:
808806
export_store.export_history(h)
809807

810808
imported_history = import_archive(tolerant_archive, app, u)
@@ -817,7 +815,7 @@ def test_export_history_with_null_param_id(tmp_path):
817815
"""Job params shaped {"src": "hda"|"hdca"|"dce", "id": null} are persisted
818816
by the import path at model/store/__init__.py:1860-1888 when a referenced
819817
HDA/HDCA/DCE can't be resolved. Strict export raises in
820-
get_identifier_for_id; tolerate_missing_data passes the null through.
818+
get_identifier_for_id; ignore_errors passes the null through.
821819
822820
Reproducing the on-disk state directly: the only producer is the import
823821
path itself, so deleting the referenced HDA wouldn't null the persisted
@@ -832,9 +830,7 @@ def test_export_history_with_null_param_id(tmp_path):
832830
export_store.export_history(h)
833831

834832
tolerant_archive = str(tmp_path / "tolerant.tgz")
835-
with store.TarModelExportStore(
836-
tolerant_archive, app=app, export_files="copy", tolerate_missing_data=True
837-
) as export_store:
833+
with store.TarModelExportStore(tolerant_archive, app=app, export_files="copy", ignore_errors=True) as export_store:
838834
export_store.export_history(h)
839835

840836
imported_history = import_archive(tolerant_archive, app, u)

0 commit comments

Comments
 (0)