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

bugfix: corrent the import path of logrus #953

Merged

Conversation

faycheng
Copy link
Contributor

Ⅰ. Describe what this PR did

1, rename upper-case 'Sirupsen' to 'sirupsen'
2, change import path extra/libnetwork/Godeps/_workspace/src/github.com/Sirupsen/logrus to github.com/sirupsen/logrus

Ⅱ. Does this pull request fix one issue?

fixes #949

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added areas/log kind/bug This is bug report for project size/XS labels Mar 23, 2018
@pouchrobot
Copy link
Collaborator

We found this is your first time to contribute to Pouch, @faycheng
👏 We really appreciate it.
Just remind that you have read the contribution guide: https://github.com/alibaba/pouch/blob/master/CONTRIBUTING.md
If you didn't, you should do that first. If done, welcome again and please enjoy hacking! 🍻

@CLAassistant
Copy link

CLAassistant commented Mar 23, 2018

CLA assistant check
All committers have signed the CLA.

@allencloud
Copy link
Collaborator

Thanks a lot for your contribution. CI fails and I am afraid that :

daemon/mgr/network.go
network/mode/bridge/bridge.go
volume/core.go
please format Go code with 'gofmt -s -w'
Makefile:42: recipe for target 'fmt' failed
make: *** [fmt] Error 1
make: *** [test] Error 2

We need to gofmt the code. @faycheng

@faycheng
Copy link
Contributor Author

sorry, i will solve it

@codecov-io
Copy link

codecov-io commented Mar 23, 2018

Codecov Report

Merging #953 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #953   +/-   ##
=======================================
  Coverage   13.06%   13.06%           
=======================================
  Files         123      123           
  Lines        8235     8235           
=======================================
  Hits         1076     1076           
  Misses       7063     7063           
  Partials       96       96
Impacted Files Coverage Δ
daemon/mgr/network.go 3.95% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdc2e13...8e70a80. Read the comment docs.

@allencloud
Copy link
Collaborator

Could you help to review this?
Actually It makes me feel good to simplify some code in this PR? @rudyfly 🥂

@allencloud
Copy link
Collaborator

allencloud commented Mar 23, 2018

I tested this PR on my local machine, and it works fine indeed. Please help to take a look at this. @rudyfly

But I have to say without the change brought by this PR, the master code still works fine like the follwowing:

root@i-8brpbc9t:~/go/src/github.com/alibaba/pouch# make install
GOOS=linux go build -o pouchd
go build -o pouch github.com/alibaba/pouch/cli
install
installing pouchd and pouch to /usr/local/bin
root@i-8brpbc9t:~/go/src/github.com/alibaba/pouch# git branch
* master
  new-953
root@i-8brpbc9t:~/go/src/github.com/alibaba/pouch#

volume/core.go Outdated
"github.com/alibaba/pouch/pkg/client"
metastore "github.com/alibaba/pouch/pkg/meta"
"github.com/alibaba/pouch/volume/driver"
volerr "github.com/alibaba/pouch/volume/error"
"github.com/alibaba/pouch/volume/types"
"github.com/alibaba/pouch/volume/types/meta"
"github.com/sirupsen/logrus"

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the import pkg "github.com/sirupsen/logrus", I think you could remove this line "github.com/sirupsen/logrus", right? @faycheng

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, i will remove it

"github.com/alibaba/pouch/network"
"github.com/alibaba/pouch/pkg/errtypes"
"github.com/sirupsen/logrus"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please move this line to L15, since this is a third-party package. We have a rule of how to import packages in :

When importing packages, to improve readabilities, we should import package by sequence: system packages, project's own packages and third-party packages. And we should keep a blank line among these three kinds of packages;

In https://github.com/alibaba/pouch/blob/master/docs/contributions/code_styles.md#additional-style-rules

@@ -23,6 +22,7 @@ import (
networktypes "github.com/docker/libnetwork/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
netlog "github.com/sirupsen/logrus"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think L24 and L25 are duplicated as well.

Signed-off-by: 程飞 <fay.cheng.cn@gmail.com>
@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Mar 23, 2018
@allencloud allencloud merged commit f1cee76 into AliyunContainerService:master Mar 23, 2018
@@ -411,15 +410,15 @@ func (nm *NetworkManager) getNetworkSandbox(id string) libnetwork.Sandbox {

func initNetworkLog(cfg *config.Config) {
if cfg.Debug {
netlog.SetLevel(netlog.DebugLevel)
logrus.SetLevel(logrus.DebugLevel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Libnetwork's logrus version is different from pouchd, so we need to set libnetwork's logrus addintionly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

known

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/log kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[help wanted] Sirupsen caused installation to fail
6 participants