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

Fix golang version not aligned at .github/workflows #62

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

guessi
Copy link
Contributor

@guessi guessi commented Mar 19, 2022

  • build with golang 1.17 and alpine 3.15
  • introduce .gitignore to prevent sensitive data being packed into docker image

PR build

% go version
go version go1.17.7 darwin/amd64

% go run ./cmd/action/
krew-release-bot is a Github Action for updating plugin manifests in Krew Index repo

Usage:
  krew-release-bot [command]

Available Commands:
  action      github action for updating plugin manifests in krew-index repo
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  template    template helps validate the krew index template file without going through github actions workflow

Flags:
  -h, --help   help for krew-release-bot

Use "krew-release-bot [command] --help" for more information about a command.

% go run ./cmd/action/ help action
github action for updating plugin manifests in krew-index repo

Usage:
  krew-release-bot action [flags]

Flags:
  -h, --help   help for action

Test

% go test ./... -cover
?   	github.com/rajatjindal/krew-release-bot/cmd/action	[no test files]
?   	github.com/rajatjindal/krew-release-bot/cmd/webhook	[no test files]
?   	github.com/rajatjindal/krew-release-bot/pkg/cicd	[no test files]
ok  	github.com/rajatjindal/krew-release-bot/pkg/cicd/circleci	0.259s	coverage: 81.5% of statements
ok  	github.com/rajatjindal/krew-release-bot/pkg/cicd/github	0.481s	coverage: 65.4% of statements
ok  	github.com/rajatjindal/krew-release-bot/pkg/cicd/travisci	0.718s	coverage: 61.5% of statements
ok  	github.com/rajatjindal/krew-release-bot/pkg/krew	0.732s	coverage: 76.5% of statements
?   	github.com/rajatjindal/krew-release-bot/pkg/releaser	[no test files]
ok  	github.com/rajatjindal/krew-release-bot/pkg/source	25.053s	coverage: 77.2% of statements
ok  	github.com/rajatjindal/krew-release-bot/pkg/source/actions	25.287s	coverage: 48.1% of statements

@netlify
Copy link

netlify bot commented Mar 19, 2022

👷 Deploy request for inspiring-brown-e0fe87 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 093539f

@guessi
Copy link
Contributor Author

guessi commented Mar 19, 2022

Hi @rajatjindal, thank you for creating krew-release-bot which is helpful for krew community.

Btw, I'm aware there was a comment under pr12 back in 2020 explained why keeping vendor/, but it would be nice to utilize go modules. I also tried to minimized go.{mod,sum}, hope it could reduce the time spent for packages downloading.

It would be nice if you have some time to review this PR. Thanks!

@guessi
Copy link
Contributor Author

guessi commented Mar 19, 2022

fyi, it would be easier to review via TAB: commits, I've split my commits into several topics.

go.mod Outdated Show resolved Hide resolved
@ahmetb
Copy link

ahmetb commented Mar 19, 2022

Out of curiosity: why remove vendor?

@guessi
Copy link
Contributor Author

guessi commented Mar 19, 2022

Out of curiosity: why remove vendor?

Simply trying to make source tree clear and reduce diff-lines for the following commits.

@guessi
Copy link
Contributor Author

guessi commented Mar 19, 2022

I think I should leave it to original author @rajatjindal to decide when to upgrade packages and how to manage packages. So I decided to revert commits for package version changes.

Commits still available here at my personal fork.


RUN mkdir -p /home/app
WORKDIR /home/app
Copy link
Contributor Author

Choose a reason for hiding this comment

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

WORKDIR will create the directory so that we could remove mkdir here.

@@ -1,21 +1,21 @@
FROM golang:1.17.3-alpine3.14 as builder
FROM golang:1.17-alpine3.15 as builder

WORKDIR /go/src/github.com/rajatjindal/krew-release-bot
COPY . .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

without .dockerignore it will copy all files including sensitive/unnecessary info such as commit history inside .git/*.

@guessi guessi changed the title Enhancements Fix golang version not aligned at .github/workflows Mar 19, 2022
Dockerfile Outdated Show resolved Hide resolved
@rajatjindal rajatjindal merged commit 0650a49 into rajatjindal:master Mar 29, 2022
@rajatjindal
Copy link
Owner

thanks a lot for your PR

@guessi guessi deleted the enhancements branch April 2, 2022 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants