Repository: kubernetes-sigs/security-profiles-operator
Pull request #238 (2021-01-27 07:21:16)

Bump github.com/go-logr/logr from 0.3.0 to 0.4.0
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 0.3.0 to 0.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/go-logr/logr/releases">github.com/go-logr/logr's releases</a>.</em></p>
<blockquote>
<h2>v0.4.0</h2>
<ul>
<li>
<p>Adds <code>logr.WithCallDepth()</code></p>
</li>
<li>
<p>Deprecate logr/testing.NullLogger in favor of logr.Discard()</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/go-logr/logr/commit/8fc6c73f3911f11de3d0c18ade9880f1114ae72f"><code>8fc6c73</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/go-logr/logr/issues/36">#36</a> from thockin/eol-null-logger</li>
<li><a href="https://github.com/go-logr/logr/commit/9721152d56161b63aa7bb944d872114486812d10"><code>9721152</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/go-logr/logr/issues/31">#31</a> from thockin/with-call-depth</li>
<li><a href="https://github.com/go-logr/logr/commit/52a060803ca53ec6ed3e772dd16ae2f6fc62e7fc"><code>52a0608</code></a> Add optional CallDepth support</li>
<li><a href="https://github.com/go-logr/logr/commit/85b0f8df8c2f96c6ba50d550908be62babe852e6"><code>85b0f8d</code></a> Effectively EOL testing.NullLogger</li>
<li><a href="https://github.com/go-logr/logr/commit/3dceec2461aff9117a62002c2e57e80e541f9a86"><code>3dceec2</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/go-logr/logr/issues/35">#35</a> from thockin/test-context</li>
<li><a href="https://github.com/go-logr/logr/commit/7efc46107329f0a7f95ca138a24a2a4c14aa3ad7"><code>7efc461</code></a> Add tests for context funcs</li>
<li><a href="https://github.com/go-logr/logr/commit/a9c9b258806f6ccc0a6a5991ebd1cd7f4435e3c0"><code>a9c9b25</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/go-logr/logr/issues/34">#34</a> from thockin/godoc-and-headers</li>
<li><a href="https://github.com/go-logr/logr/commit/4eabc2e5e1a4f11de442201955a26a70e4e291e1"><code>4eabc2e</code></a> Move comments arount for cleaner godoc</li>
<li><a href="https://github.com/go-logr/logr/commit/6a4674cac178241b5af0a586bebd3f60ff119886"><code>6a4674c</code></a> Add missing header comments</li>
<li>See full diff in <a href="https://github.com/go-logr/logr/compare/v0.3.0...v0.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/go-logr/logr&package-manager=go_modules&previous-version=0.3.0&new-version=0.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

k8s-ci-robot: @dependabot[bot]: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our [release note process](https://git.k8s.io/community/contributors/guide/release-notes.md) to remove it.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/238#" title="Author self-approved">dependabot[bot]</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **hasheddan** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @hasheddan` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/security-profiles-operator/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["hasheddan"]} -->
k8s-ci-robot: Hi @dependabot[bot]. Thanks for your PR.

I'm waiting for a [kubernetes-sigs](https://github.com/orgs/kubernetes-sigs/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

JAORMX: /ok-to-test
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/238#" title="Author self-approved">dependabot[bot]</a>*, *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/238#pullrequestreview-577071712" title="LGTM">saschagrunert</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/security-profiles-operator/blob/master/OWNERS)~~ [saschagrunert]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
saschagrunert: /release-note-none

Patch:
diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 000000000..df2db6cb5
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,33 @@
+---
+codecov:
+  notify:
+    after_n_builds: 1
+    require_ci_to_pass: false
+
+coverage:
+  precision: 2
+  round: down
+  range: 50..75
+
+  status:
+    project:
+      default:
+        enabled: true
+        # allowed to drop coverage and still result in a "success" commit status
+        threshold: null
+        if_not_found: success
+        if_no_uploads: success
+        if_ci_failed: error
+    patch:
+      default:
+        enabled: true
+        threshold: null
+        if_not_found: success
+        if_no_uploads: success
+        if_ci_failed: error
+    changes: false
+
+comment:
+  layout: "header, diff"
+  behavior: default
+  require_changes: false
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 32d65f323..dee7fcf9a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,4 +1,4 @@
-name: build
+name: macosbuild
 on: [push, pull_request]
 jobs:
   validate:
@@ -15,3 +15,5 @@ jobs:
           go-version: '^1.15'
       - name: unit test
         run: make test-unit
+      - name: verify
+        run: make verify-go-lint
diff --git a/.golangci.yml b/.golangci.yml
index c3a24f1e1..5b0f8270f 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,10 +1,5 @@
 ---
 run:
-  build-tags:
-    - e2e
-    - netgo
-    - osusergo
-    - seccomp
   concurrency: 6
   deadline: 5m
 linters:
diff --git a/Makefile b/Makefile
index ac117b3ba..a220d352e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,14 @@ BUILDTAGS := netgo osusergo seccomp
 else
 BUILDTAGS := netgo osusergo
 endif
+
+ifneq ($(shell uname -s), Darwin)
+LINT_BUILDTAGS := e2e,netgo,osusergo,seccomp
+else
+LINT_BUILDTAGS := e2e,netgo,osusergo
+endif
+
+
 BUILD_FILES := $(shell find . -type f -name '*.go' -or -name '*.mod' -or -name '*.sum' -not -name '*_test.go')
 export GOFLAGS?=-mod=mod
 GO_PROJECT := sigs.k8s.io/$(PROJECT)
@@ -139,7 +147,7 @@ verify-deployments: deployments ## Verify the generated deployments
 
 .PHONY: verify-go-lint
 verify-go-lint: $(BUILD_DIR)/golangci-lint ## Verify the golang code by linting
-	$(BUILD_DIR)/golangci-lint run
+	$(BUILD_DIR)/golangci-lint run --build-tags $(LINT_BUILDTAGS)
 
 $(BUILD_DIR)/golangci-lint:
 	export \
@@ -154,6 +162,9 @@ $(BUILD_DIR)/golangci-lint:
 
 .PHONY: test-unit
 test-unit: $(BUILD_DIR) ## Run the unit tests
+	# remove all coverage files if exists
+	rm -rf *.out
+	# run the go tests and gen the file coverage-all used to do the integration with coverrals.io
 	$(GO) test -ldflags '$(LDVARS)' -tags '$(BUILDTAGS)' -race -v -test.coverprofile=$(BUILD_DIR)/coverage.out ./internal/...
 	$(GO) tool cover -html $(BUILD_DIR)/coverage.out -o $(BUILD_DIR)/coverage.html
 
diff --git a/go.mod b/go.mod
index c5c59e075..edcbb77f3 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.15
 require (
 	github.com/containers/common v0.32.0
 	github.com/crossplane/crossplane-runtime v0.12.0
-	github.com/go-logr/logr v0.3.0
+	github.com/go-logr/logr v0.4.0
 	github.com/pkg/errors v0.9.1
 	github.com/stretchr/testify v1.7.0
 	github.com/urfave/cli/v2 v2.3.0
diff --git a/go.sum b/go.sum
index 0f5e88ac5..c2a882868 100644
--- a/go.sum
+++ b/go.sum
@@ -226,8 +226,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
 github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
 github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
-github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs=
-github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
+github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc=
+github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
 github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54=
 github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
 github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 000000000..c90a77ce7
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,28 @@
+# Inlcuding the tests with ubuntu to get actual test coverage. The OSX builds skip seccomp tests.
+name: test-coverage
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+jobs:
+  validate:
+    name: Validate 
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: '1.15'
+      - name: Install libseccomp-dev
+        run: |
+          sudo apt update
+          sudo apt install -y libseccomp-dev
+      - name: unit test
+        run: make test-unit
+      - uses: codecov/codecov-action@v1
+        with:
+          files: build/coverage.out
+          flags: unittests 
+          verbose: true