Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSP-749: Unify Path Behavior #749

Merged
merged 10 commits into from
Sep 18, 2021
Merged

GSP-749: Unify Path Behavior #749

merged 10 commits into from
Sep 18, 2021

Conversation

JinnyYi
Copy link
Contributor

@JinnyYi JinnyYi commented Sep 9, 2021

ref: #744

@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #749 (f1210d5) into master (5e5d191) will not change coverage.
The diff coverage is n/a.

❗ Current head f1210d5 differs from pull request most recent head 83c3a7b. Consider uploading reports for the commit 83c3a7b to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #749   +/-   ##
=======================================
  Coverage   12.34%   12.34%           
=======================================
  Files          22       22           
  Lines        1434     1434           
=======================================
  Hits          177      177           
  Misses       1250     1250           
  Partials        7        7           
Flag Coverage Δ
unittests 12.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2104285...83c3a7b. Read the comment docs.

@JinnyYi JinnyYi changed the title Proposal: Unify Path Behavior GSP-749: Unify Path Behavior Sep 9, 2021
docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 10, 2021

Let's start a quick discussion in room: https://matrix.to/#/#beyondstorage@gsp-749:matrix.org

You're invited to talk on Matrix


- Absolute Path:
- For Unix, the absolute path starts with `/`.
- For Windows, the absolute path starts with a drive letter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe only go-service-fs will support absolute path starts with a drive letter?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we will not support Read("C:\\xxxx") ?

docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved

`path` is the file path for file system, or an object key for object storage. Also, it could be a prefix filter for `List` operation.

- For file system services on Windows, `path` MUST be the relative path for `WorkDir`. For file system on Unix, `path` could be an absolute path or a relative path.
Copy link
Contributor

Choose a reason for hiding this comment

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

For go-service-fs on windows, absolute path is OK which means a path under current volume. But absolute path with driver letter is not allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved

- Absolute Path:
- For Unix, the absolute path starts with `/`.
- For Windows, the absolute path starts with a drive letter.
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we will not support Read("C:\\xxxx") ?

docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
- For Unix, the absolute path starts with `/`.
- For Windows, the absolute path starts with a drive letter.
- Relative Path:
- The relative path is for the working directory `WorkDir`.
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit strange. What's the meaning of for? How about make it more clear?


## Implementation

N/A
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give more detail of the implementation?

  • Will we change the definitions?
  • Will we add new integration tests?

docs/rfcs/749-unify-path-behavior.md Outdated Show resolved Hide resolved
The field `path` is used as an input parameter for operation, indicating the file path for file system, object key for object storage or prefix filter for `List` operator.

- `path` could be absolut path or relative path based on `work_dir`.
- `path` MUST be Unix style path but SHOULD NOT contain the prefix `/` for object storage services.
Copy link
Contributor

Choose a reason for hiding this comment

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

When users call store.Read, they don't know whether this storage is object storage or not. So I think it's not a good rule.

And it conflicts with the example in the following.

@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 18, 2021

Mostly LGTM, let's create a tracking issue for this GSP!

@Xuanwo Xuanwo merged commit a245812 into master Sep 18, 2021
@Xuanwo Xuanwo deleted the path branch September 18, 2021 07:36
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.

2 participants