-
Notifications
You must be signed in to change notification settings - Fork 60
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
Code Review up to now #4
Comments
any ideas on how to test this stuff? maybe a sharness suite that upgrades through all the versions runs tests on each version, does stuff and then verifies everything is still fine? like have some workloads (mix of adding + pinning/unpinning + gcing a lot of things) and then have the expected output, upgrade through and check everything is still the same. particularly important with the pinset changes for the migration. this could be a test for both migrations and ipfs-update that make sure everything is solid across version changes. cc @chriscool thoughts? |
I'm trying to differentiate between 'output' and 'logs', Printf and friends are used for program output (i.e. |
Fortunately this doesnt need to be a 'recommended' upgrade path until 0.4.0, we can ship 0.3.10 and still not "recommend" it as the primary upgrade path. |
@whyrusleeping ok sounds good. we'll need thorough testing by 0.4.0 though |
@jbenet agreed. I'm hoping @chriscool has good ideas on testing this nicely, theres a good number of moving parts involved. |
Ok, I will have a look at testing it soon... |
youre the bestest ever |
@whyrusleeping thanks! Please take a look: #5 |
Tested it out-- seems to work! 👍
ipfs-update versions
outputThings to Fix
command help could be more user friendly: no idea what to feed it here:
use
v<num>
or<num>
, be consistent:improve description of
stash
cmd, not clear what it would be used for.separate
testnew.go
into own subpkg -- https://github.com/ipfs/ipfs-update/blob/b4d672f8551bb17e8f84d19b35cfbf2b82a9f400/testnew.goseparate the "update bundle" formatting parts into a subpkg (versions.go)
use
localApiUrl
const for urlipfs-update/versions.go
Line 31 in b4d672f
port is configurable...
ipfs-update/versions.go
Line 31 in b4d672f
$repo/api
file (respect $IPFS_PATH)--api
flagshould bound the
httpFetch
resp.Body
reader with a limited reader (like at most {4MB, 8MB} or something) --ipfs-update/utils.go
Line 24 in b4d672f
Decompose into logical units!
ipfs-update/install.go
Line 17 in b4d672f
should say "error reverting" --
ipfs-update/revert.go
Line 20 in b4d672f
Give user directions on what to do now:
ipfs-update/revert.go
Line 22 in b4d672f
Otherwise, this tool leaves users totally in the dust. "my old binary is in X, ok? what does that mean? what should i do?"
mixing your stump thing with
fmt.Fprintf
!? --ipfs-update/revert.go
Line 56 in b4d672f
if going to allow overriding stdio elsewhere, make this a variable reader too, not os.Stdio --
ipfs-update/revert.go
Line 61 in b4d672f
repeat
"(0 to exit)"
here --ipfs-update/revert.go
Line 68 in b4d672f
can the "VERSION" and "AUTHORS" parts be removed from standard
--help
output? i think it's distracting to the average user. or if not, then maybe as one subtle line at the end?The habit of writing out to the user from the bowels of the code is very bad. It makes me never want to touch this code, as any meaningful refactor could have unintended serious impact in the flow of the UX.
bad error -- handle errors better
silently correct inputs not specifying the
v
(or clearly handle this error specially, by prompting the user to add it)none of this is tested
Overall, a good start! 👍
but needs lots of testing before i would be comfortable shipping this to users in a "this is the recommended upgrade path" state.
The text was updated successfully, but these errors were encountered: