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

API revamp and cleansing #140

Merged
merged 27 commits into from Jul 4, 2017

Conversation

Projects
None yet
6 participants
@pgte

pgte commented Jun 29, 2017

Fixes #139

Pedro Teixeira added some commits Jun 28, 2017

Pedro Teixeira
Pedro Teixeira

@Kubuxu Kubuxu added the in progress label Jun 29, 2017

@pgte pgte changed the title from API revamp and cleansing to WIP: API revamp and cleansing Jun 29, 2017

@pgte pgte changed the title from WIP: API revamp and cleansing to API revamp and cleansing Jun 29, 2017

@diasdavid

left some comments. Let's not forget the repo.exists

Thanks @pgte :):)

Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated src/api-addr.js
Show outdated Hide outdated src/default-options.js
Show outdated Hide outdated src/index.js
Show outdated Hide outdated src/index.js
{
config: (cb) => this.config.exists(cb),
version: (cb) => this.version.check(repoVersion, cb)
},

This comment has been minimized.

@diasdavid

diasdavid Jun 29, 2017

Member

Interesting, why making this an object?

@diasdavid

diasdavid Jun 29, 2017

Member

Interesting, why making this an object?

This comment has been minimized.

@pgte

pgte Jun 29, 2017

Just aesthetics: I prefer to refer to result.config rather than result[0].

@pgte

pgte Jun 29, 2017

Just aesthetics: I prefer to refer to result.config rather than result[0].

This comment has been minimized.

@diasdavid

diasdavid Jun 29, 2017

Member

nice. That I didn't know :)

@diasdavid

diasdavid Jun 29, 2017

Member

nice. That I didn't know :)

Show outdated Hide outdated README.md
* `key` can be a buffer, a string or a [Key](https://github.com/ipfs/interface-datastore#keys).
* `callback` is a callback function `function (err, result:Buffer)`

This comment has been minimized.

@diasdavid

diasdavid Jul 1, 2017

Member

let's add a line here saying "blocks/blockstore" and link it to the ipfs-block class

@diasdavid

diasdavid Jul 1, 2017

Member

let's add a line here saying "blocks/blockstore" and link it to the ipfs-block class

This comment has been minimized.

@pgte
@pgte
@diasdavid

🎉🎉🎉🎉🎉🎉 Thank you @pgte, this module is getting so much better structured, really like the new way things are mounted.

Could you be extra rigorous with interop testing and by this I mean:

  • get the latest go-ipfs
  • init a clean repo
  • add 3 objects
  • add a couple of files
  • keep all of those hashes
  • bring that new repo to the test folder
  • Make sure you can read all that data
  • Do the same for some DHT records and or pinroot set hash (that gets stored in the datastore level)
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
@diasdavid

This comment has been minimized.

Show comment
Hide comment
@diasdavid

diasdavid Jul 1, 2017

Member

@justinmchase I believe you are going to like the results of this PR as it will make way more obvious and testable that S3 backend you are looking for :)

Member

diasdavid commented Jul 1, 2017

@justinmchase I believe you are going to like the results of this PR as it will make way more obvious and testable that S3 backend you are looking for :)

Show outdated Hide outdated README.md
Show outdated Hide outdated src/index.js

Pedro Teixeira added some commits Jul 1, 2017

Pedro Teixeira
Pedro Teixeira
Show outdated Hide outdated README.md
* @returns {void}
*/
set (value, callback) {
store.put(apiFile, Buffer.from(value.toString()), callback)

This comment has been minimized.

@dignifiedquire

dignifiedquire Jul 2, 2017

Member

Buffer.from is not available in node@4 you will need to include safe-buffer

@dignifiedquire

dignifiedquire Jul 2, 2017

Member

Buffer.from is not available in node@4 you will need to include safe-buffer

This comment has been minimized.

@pgte
@pgte
Show outdated Hide outdated src/config.js
Show outdated Hide outdated src/index.js
sharding: true,
extension: '.data'
}
}

This comment has been minimized.

@justinmchase

justinmchase Jul 2, 2017

Contributor

👍

@justinmchase

justinmchase Jul 2, 2017

Contributor

👍

const levelDirectory = 'datastore'
const lockers = {
memory: require('./lock-memory'),
fs: require('./lock')

This comment has been minimized.

@justinmchase

justinmchase Jul 2, 2017

Contributor

Shouldn't the locks also be a datastore? What if you are running on an ephemeral server and it goes down and back up, would the locks need to be preserved or is it ok that they are lost when the server is replaced? For example if your server was a Docker container and you update the instance.

@justinmchase

justinmchase Jul 2, 2017

Contributor

Shouldn't the locks also be a datastore? What if you are running on an ephemeral server and it goes down and back up, would the locks need to be preserved or is it ok that they are lost when the server is replaced? For example if your server was a Docker container and you update the instance.

This comment has been minimized.

@dignifiedquire

dignifiedquire Jul 3, 2017

Member

Lock can't be a simple datastore as it uses os specific system calls on the filesystem. Though the memory lock could use something else as backend if needed. It might be good to allow passing in ones own lock module if one wants to instead of using one of the specified

@dignifiedquire

dignifiedquire Jul 3, 2017

Member

Lock can't be a simple datastore as it uses os specific system calls on the filesystem. Though the memory lock could use something else as backend if needed. It might be good to allow passing in ones own lock module if one wants to instead of using one of the specified

Pedro Teixeira added some commits Jul 3, 2017

@pgte

This comment has been minimized.

Show comment
Hide comment
@pgte

pgte Jul 3, 2017

I think I've addressed every concern here. Please tell me if there's anything else I need to do to make this happen, as I depend on this. :)

pgte commented Jul 3, 2017

I think I've addressed every concern here. Please tell me if there's anything else I need to do to make this happen, as I depend on this. :)

@diasdavid diasdavid requested a review from dignifiedquire Jul 3, 2017

@diasdavid

Only minor comments for cosmetic changes.

Have you:

  • tested with a fresh repo from go-ipfs 0.4.10?
  • tested all the dependents that live inside the IPFS org? If yes, could you list them in awesome endeavour PR
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
Show outdated Hide outdated README.md
})
})
```

This comment has been minimized.

@diasdavid

diasdavid Jul 3, 2017

Member

extra \n

@diasdavid

diasdavid Jul 3, 2017

Member

extra \n

This comment has been minimized.

@pgte
@pgte
Show outdated Hide outdated README.md
@pgte

This comment has been minimized.

Show comment
Hide comment
@pgte

pgte Jul 4, 2017

@diasdavid listed dependents in awesome endeavour PR: ipfs/js-ipfs#887

pgte commented Jul 4, 2017

@diasdavid listed dependents in awesome endeavour PR: ipfs/js-ipfs#887

@pgte

This comment has been minimized.

Show comment
Hide comment
@pgte

pgte Jul 4, 2017

@diasdavid 85a2810 and c5695ed test this against a repo generated by go-ipfs v0.4.10.

pgte commented Jul 4, 2017

@diasdavid 85a2810 and c5695ed test this against a repo generated by go-ipfs v0.4.10.

Pedro Teixeira

@diasdavid diasdavid merged commit 0208d60 into master Jul 4, 2017

1 of 4 checks passed

ci/circleci Your tests failed on CircleCI
Details
coverage/coveralls Coverage decreased (-20.2%) to 60.432%
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@diasdavid diasdavid removed the in progress label Jul 4, 2017

@diasdavid diasdavid deleted the feat/api-cleansing branch Jul 4, 2017

@diasdavid diasdavid referenced this pull request Jul 10, 2017

Closed

⚡️ v0.25.0 RELEASE 🚀 #910

13 of 13 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment