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

Add new feature which prints information about new plugins which can be upgraded to #611

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jxr98
Copy link
Contributor

@jxr98 jxr98 commented Aug 13, 2021

Make sure that you've checked the boxes below before you submit PR:

Always

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Written well with PR title, we generate the release notes base on that

For the bug fixes or features only

  • Quality Gate Passed. Change this URL to your PR.
  • The coverage is xxx on the new lines
  • I've tested it by manual in the following platform
    • MacOS
    • Linux
    • Windows
  • Unit Test covered
  • e2e Test covered

Copy link
Member

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

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

Failed when I try to compile this PR:

codespace ➜ /workspaces/jenkins-cli (pr/wxharry/610) $ gh pr checkout 611
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 36 (delta 26), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (36/36), 8.79 KiB | 817.00 KiB/s, done.
From https://github.com/jenkins-zh/jenkins-cli
 * [new ref]         refs/pull/611/head -> plugincenter
Switched to branch 'plugincenter'
codespace ➜ /workspaces/jenkins-cli (plugincenter) $ make
go fmt ./util/...
go: github.com/creack/pty@v1.1.11: missing go.sum entry; to add it:
        go mod download github.com/creack/pty
make: *** [Makefile:108: fmt] Error 1

Still failed when I added the missing go.sum entry:

codespace ➜ /workspaces/jenkins-cli (plugincenter) $         go mod download github.com/creack/pty
codespace ➜ /workspaces/jenkins-cli (plugincenter ✗) $ make
go fmt ./util/...
go fmt ./client/...
go: downloading github.com/linuxsuren/http-downloader v0.0.22
go fmt ./app/...
go: downloading golang.org/x/text v0.3.5
go: downloading github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd
go: downloading github.com/xanzy/ssh-agent v0.2.1
go: downloading github.com/sergi/go-diff v1.0.0
gofmt -s -w .
go vet ./...
go: downloading github.com/onsi/ginkgo v1.15.1
go: downloading github.com/onsi/gomega v1.11.0
app/cmd/plugin_center.go:9:2: missing go.sum entry for module providing package github.com/jedib0t/go-pretty/v6/table (imported by github.com/jenkins-zh/jenkins-cli/app/cmd); to add:
        go get github.com/jenkins-zh/jenkins-cli/app/cmd
/go/pkg/mod/github.com/google/go-github/v29@v29.0.3/github/git_commits.go:16:2: missing go.sum entry for module providing package golang.org/x/crypto/openpgp (imported by github.com/google/go-github/v29/github); to add:
        go get github.com/google/go-github/v29/github@v29.0.3
/go/pkg/mod/github.com/linuxsuren/go-cli-plugin@v0.0.4/pkg/cmd/fetch.go:7:2: missing go.sum entry for module providing package golang.org/x/crypto/ssh (imported by github.com/linuxsuren/go-cli-plugin/pkg/cmd); to add:
        go get github.com/linuxsuren/go-cli-plugin/pkg/cmd@v0.0.4
/go/pkg/mod/github.com/xanzy/ssh-agent@v0.2.1/sshagent.go:27:2: missing go.sum entry for module providing package golang.org/x/crypto/ssh/agent (imported by github.com/xanzy/ssh-agent); to add:
        go get github.com/xanzy/ssh-agent@v0.2.1
/go/pkg/mod/gopkg.in/src-d/go-git.v4@v4.13.1/plumbing/transport/ssh/auth_method.go:18:2: missing go.sum entry for module providing package golang.org/x/crypto/ssh/knownhosts (imported by gopkg.in/src-d/go-git.v4/plumbing/transport/ssh); to add:
        go get gopkg.in/src-d/go-git.v4/plumbing/transport/ssh@v4.13.1
/go/pkg/mod/github.com/jbenet/go-context@v0.0.0-20150711004518-d14ea06fba99/io/ctxio.go:16:2: missing go.sum entry for module providing package golang.org/x/net/context (imported by github.com/jenkins-zh/jenkins-cli/app/cmd); to add:
        go get github.com/jenkins-zh/jenkins-cli/app/cmd
/go/pkg/mod/gopkg.in/src-d/go-git.v4@v4.13.1/plumbing/transport/ssh/common.go:15:2: missing go.sum entry for module providing package golang.org/x/net/proxy (imported by gopkg.in/src-d/go-git.v4/plumbing/transport/ssh); to add:
        go get gopkg.in/src-d/go-git.v4/plumbing/transport/ssh@v4.13.1
/go/pkg/mod/github.com/mattn/go-isatty@v0.0.12/isatty_tcgets.go:6:8: missing go.sum entry for module providing package golang.org/x/sys/unix (imported by golang.org/x/term); to add:
        go get golang.org/x/term@v0.0.0-20210503060354-a79de5458b56
make: *** [Makefile:97: vet] Error 1

It works well when I try to run these commands:

codespace ➜ /workspaces/jenkins-cli (plugincenter ✗) $ go mod tidy
go: downloading github.com/jedib0t/go-pretty/v6 v6.2.3
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading golang.org/x/lint v0.0.0-20200302205851-738671d3881b
go: downloading honnef.co/go/tools v0.0.1-2020.1.3
go: downloading gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
go: downloading golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
go: downloading golang.org/x/tools v0.0.0-20210106214847-113979e3529a
go: downloading github.com/google/go-cmp v0.5.4
go: downloading github.com/mattn/go-runewidth v0.0.9
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/golang/protobuf v1.4.3
go: downloading google.golang.org/protobuf v1.25.0
codespace ➜ /workspaces/jenkins-cli (plugincenter ✗) $ make
go fmt ./util/...
go fmt ./client/...
go fmt ./app/...
gofmt -s -w .
go vet ./...
export GO111MODULE=on
export GOPROXY=https://goproxy.io
go mod tidy
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/linuxsuren/cobra-extension/version.version=dev-v0.0.37 -X github.com/linuxsuren/cobra-extension/version.commit=6474f76 -X github.com/linuxsuren/cobra-extension/version.date=2021-08-15" -o bin/linux/jcli main.go
chmod +x bin/linux/jcli
rm -rf jcli && ln -s bin/linux/jcli jcli

@jxr98
Copy link
Contributor Author

jxr98 commented Aug 15, 2021

All right. I am gonna fix this.

go.mod Outdated
@@ -1,6 +1,6 @@
module github.com/jenkins-zh/jenkins-cli

go 1.16
go 1.14
Copy link
Member

Choose a reason for hiding this comment

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

why you change the go version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I've changed it back.

@jxr98 jxr98 changed the title Add new feature which prints information about new plugins which can be upgraded to WIP: Add new feature which prints information about new plugins which can be upgraded to Aug 15, 2021
@jxr98 jxr98 changed the title WIP: Add new feature which prints information about new plugins which can be upgraded to Add new feature which prints information about new plugins which can be upgraded to Aug 15, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2021

Codecov Report

Merging #611 (1ba6052) into master (a99158f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #611   +/-   ##
=======================================
  Coverage   37.98%   37.98%           
=======================================
  Files          13       13           
  Lines         416      416           
=======================================
  Hits          158      158           
  Misses        246      246           
  Partials       12       12           
Flag Coverage Δ
unittests 37.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 a99158f...1ba6052. Read the comment docs.

@LinuxSuRen
Copy link
Member

hi @jxr98 Please pay attention to the conflicts.

@jxr98
Copy link
Contributor Author

jxr98 commented Sep 22, 2021

Hi @LinuxSuRen, I've solved the conflicts. By the way, any problem with this pr?

@jxr98 jxr98 changed the title Add new feature which prints information about new plugins which can be upgraded to WIP: Add new feature which prints information about new plugins which can be upgraded to Sep 24, 2021
@jxr98 jxr98 changed the title WIP: Add new feature which prints information about new plugins which can be upgraded to Add new feature which prints information about new plugins which can be upgraded to Sep 28, 2021
@jxr98
Copy link
Contributor Author

jxr98 commented Oct 8, 2021

To use this new feature, a plugin called 'pipeline restful api' needs to be installed in jenkins. I've tested using the command './jcli plugin center'. It's a bit slow because the function is going to check every installed plugins in 'https://plugins.jenkins.io/api/plugin/'. The function only prints information about plugins which have newer versions then the installed.

@jxr98
Copy link
Contributor Author

jxr98 commented Oct 11, 2021

Hello Rick. This pr is the second needed to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants