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

Get rid of Request.convertOptions #183

Closed
Stebalien opened this issue Mar 12, 2020 · 5 comments
Closed

Get rid of Request.convertOptions #183

Stebalien opened this issue Mar 12, 2020 · 5 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue

Comments

@Stebalien
Copy link
Member

Currently, we:

  1. Extract the options from the request parameters.
  2. Stash them in the request options map.
  3. Later, convert the options to the correct types, storing them back in the request.

This is bad practice. We should:

  1. Extract the options from the request parameters.
  2. Convert them.
  3. Save them.

That is, we should never store temporary data in the place we expect to store the final data, then fix it up later.

@hsanjuan hsanjuan added exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue labels Mar 13, 2020
@gargdeepak
Copy link

Can I please pick up this issue if no one else is working on it ?

@Stebalien
Copy link
Member Author

That would be awesome! Fair warning, the code in this repo has been patched heavily and is a bit gnarly.

gargdeepak pushed a commit to gargdeepak/go-ipfs-cmds that referenced this issue Mar 26, 2020
Now options are converted and saved before the request object is generated
@gargdeepak
Copy link

Thanks @Stebalien !
I have pushed the fix here: https://github.com/gargdeepak/go-ipfs-cmds/tree/fix/cmds/req-refactor
I ran go tests and following the contribution guidelines.
Anything else I should do before sending out a PR ?

@Stebalien
Copy link
Member Author

Go ahead and file a PR!

@gargdeepak
Copy link

needs review

gargdeepak pushed a commit to gargdeepak/go-ipfs-cmds that referenced this issue Mar 27, 2020
gargdeepak pushed a commit to gargdeepak/go-ipfs-cmds that referenced this issue Mar 27, 2020
gargdeepak pushed a commit to gargdeepak/go-ipfs-cmds that referenced this issue Mar 27, 2020
Stebalien added a commit that referenced this issue Mar 30, 2020
#183 refactored the request options conversion code per the ticket requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

3 participants