From b1e2be0f39ccb5d792651f6ecd999a8862ddc18e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:58:16 -0400 Subject: [PATCH 1/5] Bump github.com/sashabaranov/go-openai from 1.27.0 to 1.31.0 (#286) Bumps [github.com/sashabaranov/go-openai](https://github.com/sashabaranov/go-openai) from 1.27.0 to 1.31.0. - [Release notes](https://github.com/sashabaranov/go-openai/releases) - [Commits](https://github.com/sashabaranov/go-openai/compare/v1.27.0...v1.31.0) --- updated-dependencies: - dependency-name: github.com/sashabaranov/go-openai dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c80a2d24..0272c7a4 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/client_golang v1.20.2 github.com/rikatz/kubepug v1.4.0 github.com/rs/zerolog v1.32.0 - github.com/sashabaranov/go-openai v1.30.3 + github.com/sashabaranov/go-openai v1.31.0 github.com/shurcooL/githubv4 v0.0.0-20231126234147-1cffa1f02456 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 diff --git a/go.sum b/go.sum index 1c56cb6c..2e24bb8a 100644 --- a/go.sum +++ b/go.sum @@ -930,8 +930,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sashabaranov/go-openai v1.30.3 h1:TEdRP3otRXX2A7vLoU+kI5XpoSo7VUUlM/rEttUqgek= -github.com/sashabaranov/go-openai v1.30.3/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= +github.com/sashabaranov/go-openai v1.31.0 h1:rGe77x7zUeCjtS2IS7NCY6Tp4bQviXNMhkQM6hz/UC4= +github.com/sashabaranov/go-openai v1.31.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= From 2d7b205384f9bced03db1e6e7f037c9850d9a80f Mon Sep 17 00:00:00 2001 From: Joseph Lombrozo Date: Wed, 2 Oct 2024 21:57:19 -0400 Subject: [PATCH 2/5] Fix CI (#290) --- .github/actions/build-image/action.yaml | 12 ++++++++---- .github/workflows/on_pull_request.yaml | 2 ++ .github/workflows/on_push_to_main.yaml | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-image/action.yaml b/.github/actions/build-image/action.yaml index ec7c1cbb..5a426ee1 100644 --- a/.github/actions/build-image/action.yaml +++ b/.github/actions/build-image/action.yaml @@ -5,6 +5,10 @@ inputs: image_tag: description: The image tag required: true + push: + description: True to push image after building, false otherwise + required: false + default: "false" tag_latest: description: Tag latest as well as the provided tag default: "false" @@ -21,7 +25,7 @@ runs: using: composite steps: - - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-qemu-action@v3 with: image: tonistiigi/binfmt:latest platforms: all @@ -32,7 +36,7 @@ runs: with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" } - name: login to registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -42,8 +46,8 @@ runs: shell: bash run: >- ./earthly.sh - --push + ${{ inputs.push == 'true' && '--push' || '' }} +docker-multiarch - ${{ inputs.tag_latest != 'false' && format('--LATEST_IMAGE_NAME=ghcr.io/{0}:latest', github.repository) || '' }} + ${{ inputs.tag_latest != 'false' && format('--LATEST_IMAGE_NAME=ghcr.io/{0}:latest', github.repository) || '' }} --GIT_TAG=${{ inputs.image_tag }} --IMAGE_NAME=ghcr.io/${{ github.repository }}:${{ inputs.image_tag }} diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 4cc4e68d..fa828f6f 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -32,6 +32,7 @@ jobs: - uses: ./.github/actions/build-image id: build-image with: + push: '${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}' image_tag: ${{ env.FS_TAG }} token: ${{ secrets.GITHUB_TOKEN }} @@ -39,3 +40,4 @@ jobs: with: message: | Temporary image available at `${{ steps.build-image.outputs.image }}`. + if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name diff --git a/.github/workflows/on_push_to_main.yaml b/.github/workflows/on_push_to_main.yaml index c3a9ac13..5ecb85f3 100644 --- a/.github/workflows/on_push_to_main.yaml +++ b/.github/workflows/on_push_to_main.yaml @@ -23,6 +23,7 @@ jobs: - uses: ./.github/actions/build-image with: + push: 'true' image_tag: ${{ env.GIT_TAG }} token: ${{ secrets.GITHUB_TOKEN }} From 35dfcf6cf96c66d4893be723f5db45ebd629b047 Mon Sep 17 00:00:00 2001 From: andridzi <45969016+andridzi@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:55:49 +0200 Subject: [PATCH 3/5] fix: Set `success` Git commit status in case of skipped checks (#300) * fix: Set `success` Git commit status in case of skipped checks * do not forget about gitlab --- pkg/commitState.go | 3 +++ pkg/vcs/github_client/client.go | 2 +- pkg/vcs/gitlab_client/status.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/commitState.go b/pkg/commitState.go index 3da4de1a..3658e895 100644 --- a/pkg/commitState.go +++ b/pkg/commitState.go @@ -30,6 +30,7 @@ func (s CommitState) BareString() string { var stateString = map[CommitState]string{ StateNone: "", + StateSkip: "Skipped", StateSuccess: "Passed", StateRunning: "Running", StateWarning: "Warning", @@ -62,6 +63,8 @@ func ParseCommitState(s string) (CommitState, error) { return StateError, nil case "panic": return StatePanic, nil + case "skip", "skipped": + return StateSkip, nil default: return StateNone, fmt.Errorf("unknown commit state: %s", s) diff --git a/pkg/vcs/github_client/client.go b/pkg/vcs/github_client/client.go index 6b53fd78..e88b6769 100644 --- a/pkg/vcs/github_client/client.go +++ b/pkg/vcs/github_client/client.go @@ -181,7 +181,7 @@ func toGithubCommitStatus(state pkg.CommitState) *string { return pkg.Pointer("failure") case pkg.StateRunning: return pkg.Pointer("pending") - case pkg.StateSuccess, pkg.StateWarning, pkg.StateNone: + case pkg.StateSuccess, pkg.StateWarning, pkg.StateNone, pkg.StateSkip: return pkg.Pointer("success") } diff --git a/pkg/vcs/gitlab_client/status.go b/pkg/vcs/gitlab_client/status.go index d17188bb..d3794332 100644 --- a/pkg/vcs/gitlab_client/status.go +++ b/pkg/vcs/gitlab_client/status.go @@ -69,7 +69,7 @@ func convertState(state pkg.CommitState) gitlab.BuildStateValue { return gitlab.Running case pkg.StateFailure, pkg.StateError, pkg.StatePanic: return gitlab.Failed - case pkg.StateSuccess, pkg.StateWarning, pkg.StateNone: + case pkg.StateSuccess, pkg.StateWarning, pkg.StateNone, pkg.StateSkip: return gitlab.Success } From 3d8265207eedff25e4c69d1b3e8d9a4e47009c91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:25:55 -0500 Subject: [PATCH 4/5] Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 (#291) Bumps [github.com/rs/zerolog](https://github.com/rs/zerolog) from 1.32.0 to 1.33.0. - [Commits](https://github.com/rs/zerolog/compare/v1.32.0...v1.33.0) --- updated-dependencies: - dependency-name: github.com/rs/zerolog dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0272c7a4..59e1e06e 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/prometheus/client_golang v1.20.2 github.com/rikatz/kubepug v1.4.0 - github.com/rs/zerolog v1.32.0 + github.com/rs/zerolog v1.33.0 github.com/sashabaranov/go-openai v1.31.0 github.com/shurcooL/githubv4 v0.0.0-20231126234147-1cffa1f02456 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 2e24bb8a..86d55bbe 100644 --- a/go.sum +++ b/go.sum @@ -919,8 +919,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= From 4e317be423e1501240ed2d000a713fbcb33d0c5a Mon Sep 17 00:00:00 2001 From: benjohnson-dev <98194631+benjohnson-dev@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:26:41 -0700 Subject: [PATCH 5/5] fix: add missing `vcs-upload-url` flag for enterprise github (#302) * fix: add missing `vcs-upload-url` flag for enterprise github Signed-off-by: benjohnson-dev * fix: rebuild docs for vcs-upload-url Signed-off-by: benjohnson-dev --------- Signed-off-by: benjohnson-dev --- cmd/root.go | 1 + docs/usage.md | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 470f675b..7e2f90b7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -50,6 +50,7 @@ func init() { ) boolFlag(flags, "persist-log-level", "Persists the set log level down to other module loggers.") stringFlag(flags, "vcs-base-url", "VCS base url, useful if self hosting gitlab, enterprise github, etc.") + stringFlag(flags, "vcs-upload-url", "VCS upload url, required for enterprise github.") stringFlag(flags, "vcs-type", "VCS type. One of gitlab or github. Defaults to gitlab.", newStringOpts(). withChoices("github", "gitlab"). diff --git a/docs/usage.md b/docs/usage.md index 18dae861..b2b97ce3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -68,6 +68,7 @@ The full list of supported environment variables is described below: |`KUBECHECKS_VCS_BASE_URL`|VCS base url, useful if self hosting gitlab, enterprise github, etc.|| |`KUBECHECKS_VCS_TOKEN`|VCS API token.|| |`KUBECHECKS_VCS_TYPE`|VCS type. One of gitlab or github.|`gitlab`| +|`KUBECHECKS_VCS_UPLOAD_URL`|VCS upload url, required for enterprise github.|| |`KUBECHECKS_WEBHOOK_SECRET`|Optional secret key for validating the source of incoming webhooks.|| |`KUBECHECKS_WEBHOOK_URL_BASE`|The endpoint to listen on for incoming PR/MR event webhooks. For example, 'https://checker.mycompany.com'.|| |`KUBECHECKS_WEBHOOK_URL_PREFIX`|If your application is running behind a proxy that uses path based routing, set this value to match the path prefix. For example, '/hello/world'.||