kunwp1 opened a new pull request, #8883:
URL: https://github.com/apache/texera/pull/8883
### What changes were proposed in this PR?
Root cause. `createDatasetVersion` names a version `v{N} - {description}`
from whatever the user typed, and the UI accepted a `/`. The version name is
one segment of the logical path `/<prefix>/owner/resource/version/file`, and
`FileResolver.parsePrefixedPath` splits that path on `/`. For the path in the
issue, `/texera/bughunt-version-name/v1 - 2024/01 snapshot/second.csv`, the
version becomes `v1 - 2024` and `01 snapshot/second.csv` becomes the file path,
so the version lookup misses and `presign-download` returns a 500.
`createModelVersion` builds its name the same way, so model versions have the
same problem.
Fix. `ResourceNaming.validateVersionDescription` rejects a description
containing `/` with a 400. `createDatasetVersion` and `createModelVersion` call
it right after the write-access check, before the LakeFS commit, so the staged
files stay staged and the user can fix the description and retry. The version
uploader, which datasets and models both use, shows the error under the input
and disables Submit, and `Enter` no longer submits either.
```
Before: description "/" -> version "v3 - /" -> every file in it fails
with presign-download 500
After: description "/" -> 400 "Invalid version description" (UI: inline
error, Submit disabled)
```
Not included. Versions already stored with a `/` in their name stay
unopenable, and repairing them needs a data migration. A `%` or `+` in a name
has a separate problem, because `resolveVersionedFile` URL-decodes `filePath` a
second time.
### Any related issues, documentation, discussions?
Closes #8882
### How was this PR tested?
Tests were added for the validator, for both resources, and for the version
uploader, and they were written first and failed against the old code.
```
sbt "FileService/testOnly
org.apache.texera.service.resource.ResourceNamingSpec
org.apache.texera.service.resource.DatasetResourceSpec
org.apache.texera.service.resource.ModelUploadResourceSpec"
cd frontend && yarn ng test --watch=false
--include='**/version-uploader.component.spec.ts'
```
The first command passes 177 tests and the second passes 73. `scalafixAll`,
`scalafmtAll`, `prettier-eslint` and `eslint` ran clean on the changed files.
I have not checked the new inline error in a browser yet, so there are no
before/after screenshots.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code, Claude Sonnet 5.5
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]