Skip to content

Trim method path parameters of leading slashes#713

Closed
nfx wants to merge 3 commits intomainfrom
trim-path-suffix
Closed

Trim method path parameters of leading slashes#713
nfx wants to merge 3 commits intomainfrom
trim-path-suffix

Conversation

@nfx
Copy link
Copy Markdown
Contributor

@nfx nfx commented Nov 27, 2023

Changes

Fundamentally prevent regressions like

PUT /api/2.0/fs/files//Volumes/main/x/y/z
> [non-JSON document of 11 bytes]. <io.Reader>
< HTTP/2.0 400 Bad Request
< {
<   "error_code": "BAD_REQUEST",
<   "message": "Invalid path"
< }

Fundamentally prevent regressions like

```
 PUT /api/2.0/fs/files//Volumes/main/x/y/z
> [non-JSON document of 11 bytes]. <io.Reader>
< HTTP/2.0 400 Bad Request
< {
<   "error_code": "BAD_REQUEST",
<   "message": "Invalid path"
< }
```
@nfx nfx requested a review from mgyucht November 27, 2023 09:39
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 27, 2023

Codecov Report

Attention: 238 lines in your changes are missing coverage. Please review.

Comparison is base (af0eafe) 16.34% compared to head (3465497) 16.34%.

Files Patch % Lines
service/catalog/impl.go 0.00% 66 Missing ⚠️
service/iam/impl.go 0.00% 32 Missing ⚠️
service/sql/impl.go 0.00% 29 Missing ⚠️
service/sharing/impl.go 0.00% 19 Missing ⚠️
service/compute/impl.go 0.00% 16 Missing ⚠️
service/provisioning/impl.go 0.00% 16 Missing ⚠️
service/settings/impl.go 0.00% 16 Missing ⚠️
service/workspace/impl.go 0.00% 14 Missing ⚠️
service/pipelines/impl.go 0.00% 13 Missing ⚠️
service/ml/impl.go 0.00% 8 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #713   +/-   ##
=======================================
  Coverage   16.34%   16.34%           
=======================================
  Files          98       98           
  Lines       13996    13996           
=======================================
  Hits         2287     2287           
  Misses      11518    11518           
  Partials      191      191           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nfx nfx requested a review from pietern November 27, 2023 09:43
Copy link
Copy Markdown
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regenerating the SDK with this change does not change the generated code. The issue is that users can specify an initial / in this parameter, and it is documented as The absolute path of the file or directory in DBFS., where absolute paths begin with a /. However, if they do that, the path contains two consecutive /s.

@nfx nfx changed the title Trim method path suffix of redundant trailing slashes Trim method path parameters of leading slashes Nov 27, 2023
@renaudhartert-db
Copy link
Copy Markdown
Contributor

Closing stale PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants