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

adds support for unit tests, golangci-lint and gosec #83

Merged
merged 1 commit into from
Apr 5, 2023
Merged

adds support for unit tests, golangci-lint and gosec #83

merged 1 commit into from
Apr 5, 2023

Conversation

vjayaramrh
Copy link
Contributor

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 1, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vjayaramrh / name: Vishwanath Jayaraman (03feecb)

@vjayaramrh
Copy link
Contributor Author

@gvbalaji
Copy link

gvbalaji commented Apr 3, 2023

@vjayaramrh @radoslawc can you please take care of this PR as well while creating prow jobs for this repo?

Copy link
Member

@electrocucaracha electrocucaracha left a comment

Choose a reason for hiding this comment

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

@vjayaramrh I tried to run it but I got the following error:

$ make unit
Makefile:20: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

After replacing the spaces with tabs, I was eable to run it.

diff --git a/Makefile b/Makefile
index cf282a5..6950216 100644
--- a/Makefile
+++ b/Makefile
@@ -17,37 +17,37 @@ CONTAINER_RUNNABLE ?= $(shell $(CONTAINER_RUNTIME) -v > /dev/null 2>&1; echo $$?
 .PHONY: unit_clean
 unit_clean: ## clean up the unit test artifacts created
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) system prune -f
+       $(CONTAINER_RUNTIME) system prune -f
 endif
-        rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
+       rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
 
 .PHONY: unit
 unit: ## Run unit tests against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
-         /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
+       /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
 else
-         go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
+       go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
 endif
 
 # Install link at https://golangci-lint.run/usage/install/ if not running inside a container
 .PHONY: lint
 lint: ## Run lint  against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
 else
-         golangci-lint run ./... -v
+       golangci-lint run ./... -v
 endif
 
 # Install link at https://github.com/securego/gosec#install if not running inside a container
 .PHONY: gosec
 gosec: ## inspects source code for security problem by scanning the Go Abstract Syntax Tree
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
 else
-         gosec ./...
+       gosec ./...
 endif

I couldn't add the suggestion into the PR, but those are the changes. BTW, I got failures given this repo doesn't contain go lang source so I guess that's normal

@vjayaramrh
Copy link
Contributor Author

@vjayaramrh I tried to run it but I got the following error:

$ make unit
Makefile:20: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

After replacing the spaces with tabs, I was eable to run it.

diff --git a/Makefile b/Makefile
index cf282a5..6950216 100644
--- a/Makefile
+++ b/Makefile
@@ -17,37 +17,37 @@ CONTAINER_RUNNABLE ?= $(shell $(CONTAINER_RUNTIME) -v > /dev/null 2>&1; echo $$?
 .PHONY: unit_clean
 unit_clean: ## clean up the unit test artifacts created
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) system prune -f
+       $(CONTAINER_RUNTIME) system prune -f
 endif
-        rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
+       rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
 
 .PHONY: unit
 unit: ## Run unit tests against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
-         /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
+       /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
 else
-         go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
+       go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
 endif
 
 # Install link at https://golangci-lint.run/usage/install/ if not running inside a container
 .PHONY: lint
 lint: ## Run lint  against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
 else
-         golangci-lint run ./... -v
+       golangci-lint run ./... -v
 endif
 
 # Install link at https://github.com/securego/gosec#install if not running inside a container
 .PHONY: gosec
 gosec: ## inspects source code for security problem by scanning the Go Abstract Syntax Tree
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
 else
-         gosec ./...
+       gosec ./...
 endif

I couldn't add the suggestion into the PR, but those are the changes. BTW, I got failures given this repo doesn't contain go lang source so I guess that's normal

@vjayaramrh I tried to run it but I got the following error:

$ make unit
Makefile:20: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

After replacing the spaces with tabs, I was eable to run it.

diff --git a/Makefile b/Makefile
index cf282a5..6950216 100644
--- a/Makefile
+++ b/Makefile
@@ -17,37 +17,37 @@ CONTAINER_RUNNABLE ?= $(shell $(CONTAINER_RUNTIME) -v > /dev/null 2>&1; echo $$?
 .PHONY: unit_clean
 unit_clean: ## clean up the unit test artifacts created
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) system prune -f
+       $(CONTAINER_RUNTIME) system prune -f
 endif
-        rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
+       rm ${TEST_COVERAGE_FILE} ${TEST_COVERAGE_HTML_FILE} ${TEST_COVERAGE_FUNC_FILE} > /dev/null 2>&1
 
 .PHONY: unit
 unit: ## Run unit tests against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
-         /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/library/golang:${GO_VERSION}-alpine3.17 \
+       /bin/sh -c "go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}; \
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}; \
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
 else
-         go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
-         go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
-         go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
+       go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
+       go tool cover -html=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_HTML_FILE}
+       go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
 endif
 
 # Install link at https://golangci-lint.run/usage/install/ if not running inside a container
 .PHONY: lint
 lint: ## Run lint  against code.
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
 else
-         golangci-lint run ./... -v
+       golangci-lint run ./... -v
 endif
 
 # Install link at https://github.com/securego/gosec#install if not running inside a container
 .PHONY: gosec
 gosec: ## inspects source code for security problem by scanning the Go Abstract Syntax Tree
 ifeq ($(CONTAINER_RUNNABLE), 0)
-         $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
+       $(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
 else
-         gosec ./...
+       gosec ./...
 endif

I couldn't add the suggestion into the PR, but those are the changes. BTW, I got failures given this repo doesn't contain go lang source so I guess that's normal

I have fixed the space vs TAB issue, would appreciate if you can confirm it is resolved

Copy link
Member

@electrocucaracha electrocucaracha left a comment

Choose a reason for hiding this comment

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

/lgtm

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 4, 2023

@electrocucaracha: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@electrocucaracha
Copy link
Member

/assign @johnbelamaric

@henderiw
Copy link
Contributor

henderiw commented Apr 4, 2023

I don't have Podman installed and got this error:

podman run -it -v /Users/henderiw/code/nephio/nephio-api:/go/src -w /go/src docker.io/library/golang:-alpine3.17
/bin/sh -c "go test ./... -v -coverprofile lcov.info;
go tool cover -html=lcov.info -o coverage_unit.html;
go tool cover -func=lcov.info -o func_coverage.out"
Cannot connect to Podman. Please verify your connection to the Linux system using podman system connection list, or try podman machine init and podman machine start to manage a new Linux VM
Error: unable to connect to Podman socket: Get "http://d/v4.4.2/libpod/_ping": dial unix ///var/folders/4j/6w02hpjj7z79lhld6kf7rmmm0000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory
make: *** [unit] Error 125

@vishwanathj
Copy link

I don't have Podman installed and got this error:

podman run -it -v /Users/henderiw/code/nephio/nephio-api:/go/src -w /go/src docker.io/library/golang:-alpine3.17 /bin/sh -c "go test ./... -v -coverprofile lcov.info; go tool cover -html=lcov.info -o coverage_unit.html; go tool cover -func=lcov.info -o func_coverage.out" Cannot connect to Podman. Please verify your connection to the Linux system using podman system connection list, or try podman machine init and podman machine start to manage a new Linux VM Error: unable to connect to Podman socket: Get "http://d/v4.4.2/libpod/_ping": dial unix ///var/folders/4j/6w02hpjj7z79lhld6kf7rmmm0000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory make: *** [unit] Error 125

@henderiw Good to know, let me investigate

@vjayaramrh
Copy link
Contributor Author

I don't have Podman installed and got this error:

podman run -it -v /Users/henderiw/code/nephio/nephio-api:/go/src -w /go/src docker.io/library/golang:-alpine3.17 /bin/sh -c "go test ./... -v -coverprofile lcov.info; go tool cover -html=lcov.info -o coverage_unit.html; go tool cover -func=lcov.info -o func_coverage.out" Cannot connect to Podman. Please verify your connection to the Linux system using podman system connection list, or try podman machine init and podman machine start to manage a new Linux VM Error: unable to connect to Podman socket: Get "http://d/v4.4.2/libpod/_ping": dial unix ///var/folders/4j/6w02hpjj7z79lhld6kf7rmmm0000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory make: *** [unit] Error 125

@henderiw I believe that you may have podman installed, but the podman machine is not running. If the podman machine is stopped, you can restart it using the command podman machine start on macbook. Let me know if this fixes the issue. Thanks

Copy link
Member

@johnbelamaric johnbelamaric left a comment

Choose a reason for hiding this comment

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

Some tools don't always put newlines at the end of files, can we see if that's a setting or something?

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 4, 2023

@henderiw: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rravindran123
Copy link
Contributor

rravindran123 commented Apr 4, 2023

Downloaded this PR and ran the Make unit on my MAC/Docker Desktop, and it ran successfully.

/lgtm

@johnbelamaric
Copy link
Member

/approve
/lgtm

@johnbelamaric
Copy link
Member

@vishwanathj looks like the tab issue is still there. Perhaps the commit was never pushed?

@vjayaramrh
Copy link
Contributor Author

@vishwanathj looks like the tab issue is still there. Perhaps the commit was never pushed?

strange, let me investigate

@nephio-prow nephio-prow bot removed the lgtm label Apr 5, 2023
@vjayaramrh
Copy link
Contributor Author

/retest

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@vjayaramrh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vjayaramrh
Copy link
Contributor Author

/ok-to-test

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@vjayaramrh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@electrocucaracha
Copy link
Member

/lgtm

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@electrocucaracha: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@electrocucaracha
Copy link
Member

Testing after signing CLA

/lgtm

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@electrocucaracha: changing LGTM is restricted to collaborators

In response to this:

Testing after signing CLA

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@henderiw
Copy link
Contributor

henderiw commented Apr 5, 2023

/lgtm
/approve

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@henderiw: changing LGTM is restricted to collaborators

In response to this:

/lgtm
/approve

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

.PHONY: unit_clean
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to change Makefile commands you have to change PROW job as well. So for example you want to add 'make unit_clean' you have to add it in .prow.yaml for example like this:

  - name: presubmit-nephio-go-unit-clean
    decorate: true
    run_if_changed: "(\\.go)$"
    spec:
      containers:
      - image: golang:1.20.2
        command:
        - make
        args:
        - unit_clean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@radoslawc Thanks, I shall update the PR

@radoslawc
Copy link
Contributor

/test ?

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

@radoslawc: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@johnbelamaric
Copy link
Member

/ok-to-test

Makefile Outdated
go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}"
else
go test ./... -v -coverprofile ${TEST_COVERAGE_FILE}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there are whitespaces there instead of tabs

@henderiw
Copy link
Contributor

henderiw commented Apr 5, 2023

/ok-to-test

Makefile Outdated
$(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/golangci/golangci-lint:${GOLANG_CI_VER}-alpine golangci-lint run ./... -v
else
golangci-lint run ./... -v
Copy link
Contributor

Choose a reason for hiding this comment

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

golangci-lint binary has to be installed in image used in .prow.yaml for example:

  - name: presubmit-nephio-golangci-lint
    decorate: true
    run_if_changed: "(\\.go)$"
    spec:
      containers:
      - image: golang:1.20.2
        command:
        - "/bin/sh"
        - "-c"
        - |
          wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.2
          make lint

otherwise running it in PROW job will end up with error:

make: golangci-lint: No such file or directory

Makefile Outdated
$(CONTAINER_RUNTIME) run -it -v ${PWD}:/go/src -w /go/src docker.io/securego/gosec:${GOSEC_VER} ./...
else
gosec ./...
Copy link
Contributor

Choose a reason for hiding this comment

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

gosec binary has to be installed in image used in .prow.yaml for example:

  - name: presubmit-nephio-gosec
    decorate: true
    run_if_changed: "(\\.go)$"
    spec:
      containers:
      - image: golang:1.20.2
        command:
        - "/bin/sh"
        - "-c"
        - |
          wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.15.0
          make gosec

otherwise running it in PROW job will end up with error:

make: gosec: No such file or directory

Copy link
Contributor Author

@vjayaramrh vjayaramrh Apr 7, 2023

Choose a reason for hiding this comment

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

@radoslawc I see your comment about gosec here
cc: @johnbelamaric

@radoslawc
Copy link
Contributor

We could build docker image with gosec and golangci-lint based on golang alpine image that we're using. In that way we could have uniform test across all repositories (granted people will use our image).

@johnbelamaric
Copy link
Member

/approve
/lgtm

@radoslawc yes, we probably need some sort of base image for builds as well as for our functions, etc.

@nephio-prow nephio-prow bot added the lgtm label Apr 5, 2023
@nephio-prow
Copy link
Contributor

nephio-prow bot commented Apr 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: electrocucaracha, henderiw, johnbelamaric, rravindran123, vjayaramrh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nephio-prow nephio-prow bot merged commit 23827e6 into nephio-project:main Apr 5, 2023
@vjayaramrh
Copy link
Contributor Author

We could build docker image with gosec and golangci-lint based on golang alpine image that we're using. In that way we could have uniform test across all repositories (granted people will use our image).

Do we need to build or use the images already published by those projects on dockerhub?

@vjayaramrh vjayaramrh deleted the unit_lint_gosec branch April 5, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants