Skip to content

Commit 2346cf8

Browse files
committed
Restore WebDAV template v0; add v1 for url -> base_url rename
Existing user file source instances created against v0 of the WebDAV template have `url` in their persisted template_variables dict. Mutating v0 in place to use `base_url` would break those instances on render because `{{ variables.base_url }}` has no value. Instead, restore v0 unchanged and add v1 with the renamed variable so users get an upgrade-available prompt and migrate at their own pace.
1 parent ada2d2b commit 2346cf8

2 files changed

Lines changed: 46 additions & 3 deletions

File tree

lib/galaxy/files/templates/examples/production_webdav.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
- id: webdav
22
version: 0
33
name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud)
4+
description: |
5+
The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server.
6+
variables:
7+
url:
8+
label: Server Domain (e.g. https://myowncloud.org)
9+
type: string
10+
help: |
11+
The domain of the WebDAV server you are connecting to. This should be the full URL
12+
including the protocol (http or https) and the domain name.
13+
root:
14+
label: WebDAV server Path (e.g., /a/sub/path/remote.php/webdav, /remote.php/dav/files/username)
15+
type: string
16+
help: |
17+
The full server path to the WebDAV service.
18+
login:
19+
label: Username
20+
type: string
21+
help: |
22+
The username to use to connect to the WebDAV server. This should be the username you use
23+
to log in to the WebDAV server.
24+
writable:
25+
label: Writable?
26+
type: boolean
27+
optional: true
28+
default: false
29+
help: Allow Galaxy to write data to this WebDAV server.
30+
secrets:
31+
password:
32+
label: Password
33+
help: |
34+
The password to use to connect to the WebDAV server. This should be the password you use
35+
to log in to the WebDAV server.
36+
configuration:
37+
type: webdav
38+
url: '{{ variables.url }}'
39+
root: '{{ variables.root }}'
40+
login: '{{ variables.login }}'
41+
writable: '{{ variables.writable }}'
42+
password: '{{ secrets.password }}'
43+
44+
- id: webdav
45+
version: 1
46+
name: WebDAV (e.g. Nextcloud, Owncloud, Opencloud)
447
description: |
548
The WebDAV protocol is a simple way to access files over the internet. Here, you can connect to any WebDAV server.
649
variables:
@@ -40,4 +83,3 @@
4083
login: '{{ variables.login }}'
4184
writable: '{{ variables.writable }}'
4285
password: '{{ secrets.password }}'
43-

lib/galaxy/files/templates/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ class WebdavConfigMixin:
238238
@model_validator(mode="before")
239239
@classmethod
240240
def ensure_base_url(cls, data: Any) -> Any:
241-
# Keep persisted user file sources created before the WebDAV
242-
# url -> base_url rename loadable in the preferences UI.
241+
# Accept the version-0 WebDAV template's `url` field as an alias of
242+
# `base_url` so that v0 templates and any persisted v0 rendered configs
243+
# continue to validate after the rename.
243244
if isinstance(data, dict) and "base_url" not in data and "url" in data:
244245
data = dict(data)
245246
data["base_url"] = data.pop("url")

0 commit comments

Comments
 (0)