Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Add bucket::upload, bucket::delete #514

Merged
merged 6 commits into from
Sep 4, 2019

Conversation

ashleymichal
Copy link
Contributor

@ashleymichal ashleymichal commented Sep 3, 2019

Closes #512 , Closes #513

@ashleymichal ashleymichal self-assigned this Sep 3, 2019
@ashleymichal ashleymichal added changelog - feature regression Something is broken, but works in previous releases labels Sep 3, 2019
Copy link
Contributor

@gabbifish gabbifish left a comment

Choose a reason for hiding this comment

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

Looks good! I'm applying some of Steve's feedback from his first pass at our feat-kv-commands branch, as well as other areas where we can simplify our Rust logic.

src/commands/kv/bucket.rs Outdated Show resolved Hide resolved
src/commands/kv/bucket.rs Outdated Show resolved Hide resolved
src/commands/kv/bucket.rs Show resolved Hide resolved
src/commands/kv/bucket.rs Outdated Show resolved Hide resolved
src/commands/kv/bucket.rs Outdated Show resolved Hide resolved
src/commands/kv/bucket.rs Outdated Show resolved Hide resolved
@ashleymichal
Copy link
Contributor Author

ashleymichal commented Sep 3, 2019

also need to update documentation.
EDIT: updated

Ok(key_value_pairs
.iter()
.map(|kv| kv.key.clone())
.collect::<Vec<_>>())
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still think we can get rid of this cloning logic? I think it would be a good idea :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, apparently if it isn't in a PR comment I don't remember it.

@ashleymichal ashleymichal added this to the KV Additions milestone Sep 4, 2019
pub fn upload(namespace_id: &str, filename: &Path) -> Result<(), failure::Error> {
let pairs: Result<Vec<KeyValuePair>, failure::Error> = match &metadata(filename) {
Ok(file_type) if file_type.is_dir() => directory_keys_values(filename),
Ok(_file_type) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Ok(_file_type) => {
Ok(_) => {

📦

Ok(_) => {
// any other file types (namely, symlinks)
failure::bail!(
"{} should be a file or directory, but is a symlink",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"{} should be a file or directory, but is a symlink",
"wrangler kv:bucket delete takes a directory",

Copy link
Contributor

@gabbifish gabbifish left a comment

Choose a reason for hiding this comment

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

small nits but otherwise LGTM!!

src/commands/kv/bucket.rs Show resolved Hide resolved
@ashleymichal ashleymichal merged commit 22a9ce0 into feat-kv-additions Sep 4, 2019
@delete-merged-branch delete-merged-branch bot deleted the alewis/add-bucket-operations branch September 4, 2019 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Something is broken, but works in previous releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants