-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: debug logging #195
feat: debug logging #195
Conversation
@richardschneider thanks! We have to be careful to scope debug output correctly and only use that scope when debugging, otherwise it will turn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides the comment below
package.json
Outdated
"detect-node": "^2.0.3", | ||
"hapi": "^16.6.2", | ||
"hat": "0.0.3", | ||
"ipfs-api": "^17.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be moved to devDependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dryajov why devDep and not dep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dryajov Doesn't ipfsd-ctl
need ipfs-api
to control the remote daemon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardschneider it does, but we've had issues bundling deps like that before (it was ipfs
proper in that case, but it applies to ipfs-api
as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a circular reference, both need each other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it apply to ipfs-api
as well? ipfs
caused issues because it brought in some native dependencies that were causing trouble for ipfs-desktop. It was ok to move ipfs
to devDep because we moved it to be injected by the user (the other option being go-ipfs-dep). However, ipfs-api
is always used and doesn't make sense that a user needs to inject as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should not bundle neither ipfs
not ipfs-api
and let the consumer bundle their own, because we can't guarantee which version is going to be ultimately used by ipfsd-ctl
in either case.
However, ipfs-api is always used and doesn't make sense that a user needs to inject as well.
So is js-ipfs
, the consuming project might have a different version bundled already.
I'm fine with bundling ipfs-api
, I don't think it's going to cause any issues, but allowing the consuming project use their own, IMO gives it more control. It's not a big issue either way, because the consumer can alway explicitly use their own ipfs-api
version with IpfsApi(ipfsd.apiAddr)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey guys, I just want some debug logging. Please make a decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine including it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with bundling ipfs-api, I don't think it's going to cause any issues, but allowing the consuming project use their own, IMO gives it more control.
What kind of control do you expect? ipfs-api
is the client library to talk with daemons.
If I understand correctly, the only reason why we don't pack in ipfs
and npm-go-ipfs-dep
by default is due to issues with electron, not because of control.
@diasdavid are you happy to merge? |
@richardschneider I'm now worried that the lack including |
@diasdavid CI tests are failing all over the place. Running I am adding this PR, so I can figure out why tests are running so slow. Blaming Travis or sprinkling |
@richardschneider could you point to what's failing? @diasdavid in |
@dryajov See
Different repos and CIs with different types of random errors. |
@richardschneider I don't think they are related to this changes, I've seen them come up randomly at different times. https://circleci.com/gh/ipfs/js-ipfs-api/1655?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link - I believe its been mentioned somewhere else might be due to webpack. https://travis-ci.org/ipfs/js-ipfs/jobs/335828903 - has been a consistent random error on travis that pops up now and then, restarting the build fixes it. I'm sure there is a race condition somewhere that might be causing that and we should definitely investigate, but it's been around for a while and predates using |
To clarify, and make sure we're on the same page.
The concerns are that, shipping I don't believe that it's the case, because:
I must be missing something and I would love to see where the issues might lie. |
@dryajov you are missing all the projects that use ipfsd-ctl to spawn go-ipfs daemons that are not js-ipfs nor js-ipfs-api. |
Fair point, thanks for bringing that up. As I said, I'm fine moving I'm not clear on why it would affect existing tests in |
I'm not saying that it will. I just want us to be diligent and make sure that we test the dependents when we make breaking changes. I've seen multiple times PRs that "ready" to later see quick fixes all over when things start failing on the dependents. I know it is a cumbersome process and ideally CI would handle all of this, but until we have the tooling it has to be done manually. |
@diasdavid got you! Thanks for clarifying. Agree on being diligent - point taken. |
@dryajov @diasdavid any progress? |
@diasdavid could you just merge this (not release to NPM). I really need this to test some speedups. Pretty please with a cherry on the top. |
@richardschneider what would merge to master enable you to do that on a branch it wouldn't? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually do not see why this can't be merged
Just some simple debug statements to figure out what is happening.