Lift legacy UserToolSource representations on read#22624
Open
mvdbeek wants to merge 1 commit intogalaxyproject:devfrom
Open
Lift legacy UserToolSource representations on read#22624mvdbeek wants to merge 1 commit intogalaxyproject:devfrom
mvdbeek wants to merge 1 commit intogalaxyproject:devfrom
Conversation
1c6ab18 to
af2a6bf
Compare
Stored DynamicTool.value rows on long-lived servers predate the YAML narrowing in ec5cfe6 and carry internal-model fields the strict schema rejects, causing 500 ResponseValidationError on GET /api/unprivileged_tools (Sentry GALAXY-TEST-588ZYT7JSX3V0). Adds lift_user_tool_source(value) which validates against the strict UserToolSource and returns one of three statuses: - "ok": clean row, parsed model. - "lifted": extra_forbidden-only drift; offending paths are stripped and the model is re-validated. Dropped paths are reported. - "invalid": any other schema violation; raw dict is returned with a compact error summary so the endpoint stays up under future tightening (e.g. stricter container constraints). UnprivilegedToolResponse.representation becomes Union[UserToolSource, dict] with new representation_status and representation_errors fields. Status is also surfaced via Warning, X-Galaxy-Deprecated-Fields, and X-Galaxy-Schema-Errors response headers (computed per request, not part of the OpenAPI schema). The same lift is applied in /api/tools/{id}/raw_tool_source. Frontend: UserToolPanel reads representation defensively and shows "needs update" / "schema error" badges.
af2a6bf to
113626c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stored DynamicTool.value rows on long-lived servers predate the YAML narrowing in ec5cfe6 and carry internal-model fields the strict schema rejects, causing 500 ResponseValidationError on GET /api/unprivileged_tools (Sentry GALAXY-TEST-588ZYT7JSX3V0).
Adds lift_user_tool_source(value) which validates against the strict UserToolSource and returns one of three statuses:
UnprivilegedToolResponse.representation becomes
Union[UserToolSource, dict] with new representation_status and representation_errors fields. Status is also surfaced via Warning, X-Galaxy-Deprecated-Fields, and X-Galaxy-Schema-Errors response headers (computed per request, not part of the OpenAPI schema). The same lift is applied in /api/tools/{id}/raw_tool_source.
Frontend: UserToolPanel reads representation defensively and shows "needs update" / "schema error" badges.
How to test the changes?
(Select all options that apply)
License