fission-codes / fission-server

Apache License 2.0
9 stars 0 forks source link

fix: create volume when updating for the first time #145

Closed icidasset closed 1 year ago

icidasset commented 1 year ago

Changes:

codecov[bot] commented 1 year ago

Codecov Report

Merging #145 (14cab24) into main (c46e490) will decrease coverage by 0.23%. Report is 3 commits behind head on main. The diff coverage is 12.50%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/fission-codes/fission-server/pull/145/graphs/tree.svg?width=650&height=150&src=pr&token=GO3TTZLDO0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes)](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes) ```diff @@ Coverage Diff @@ ## main #145 +/- ## ========================================== - Coverage 20.67% 20.45% -0.23% ========================================== Files 53 54 +1 Lines 2007 2039 +32 Branches 1244 1266 +22 ========================================== + Hits 415 417 +2 - Misses 1046 1075 +29 - Partials 546 547 +1 ``` | [Files Changed](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes) | Coverage Δ | | |---|---|---| | [fission-server/src/main.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | | | [fission-server/src/models/account.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL21vZGVscy9hY2NvdW50LnJz) | `35.71% <0.00%> (-5.11%)` | :arrow_down: | | [fission-server/src/models/volume.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL21vZGVscy92b2x1bWUucnM=) | `7.40% <ø> (-1.29%)` | :arrow_down: | | [fission-server/src/routes/ipfs.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlcy9pcGZzLnJz) | `0.00% <0.00%> (ø)` | | | [fission-server/src/routes/volume.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlcy92b2x1bWUucnM=) | `0.00% <0.00%> (ø)` | | | [fission-server/src/settings.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3NldHRpbmdzLnJz) | `43.24% <0.00%> (-2.48%)` | :arrow_down: | | [fission-server/src/router.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlci5ycw==) | `18.75% <14.28%> (-0.61%)` | :arrow_down: | | [fission-server/src/app\_state.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL2FwcF9zdGF0ZS5ycw==) | `37.03% <40.00%> (+0.67%)` | :arrow_up: |
QuinnWilton commented 1 year ago

Oh! I did just notice that the tests are failing now though, because the AppState isn't being initialized with any peers during tests. Instead of making the peers required in the builder, I would recommend using unwrap_or_default to default to an empty list of peers if none are provided.

Alternatively, more ergonomic would potentially be to not use an Option<Vec<_>> there, and instead default to an empty Vec, and just have a with_ipfs_peer method for pushing one to the end of the list. That would make it easier to incrementally build up the peers for tests with semi-shared logic.

icidasset commented 1 year ago

Alternatively, more ergonomic

Sounds good, I'll implement this and make sure the tests pass 👍