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 option to rerun kubecheck plan (GitHub Only) #250

Merged
merged 26 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f030675
add support for kubecheck again github comment
KyriosGN0 Jul 26, 2024
f9c1fb3
fix
KyriosGN0 Jul 26, 2024
2cf9223
fix
KyriosGN0 Jul 27, 2024
bdcd11d
fix some mergecat suggestions
KyriosGN0 Jul 27, 2024
ec06a18
unit test and changes to use safer method to access attributes instea…
Greyeye Aug 16, 2024
0fc90d7
gitlab merge comment handler
Greyeye Aug 16, 2024
ca506a6
gitlab unit tests
Greyeye Aug 16, 2024
b9efe7d
fix github action test on forked repos
KyriosGN0 Aug 23, 2024
310a25a
make comment message configureable
KyriosGN0 Sep 10, 2024
fc757b7
fix ci
KyriosGN0 Sep 13, 2024
bd0e151
Update pkg/vcs/github_client/client.go
KyriosGN0 Oct 2, 2024
ad876a3
remove old code
KyriosGN0 Oct 2, 2024
7de15d4
Revert "remove old code"
KyriosGN0 Oct 3, 2024
e58b844
Revert "Update pkg/vcs/github_client/client.go"
KyriosGN0 Oct 3, 2024
934054c
Update pkg/vcs/github_client/client.go
KyriosGN0 Oct 3, 2024
ade1c76
fix test
KyriosGN0 Oct 3, 2024
096aa61
Merge remote-tracking branch 'KyriosGN0/replan' into temp
djeebus Nov 12, 2024
183aea1
try to build/delete, but failures are okay
djeebus Nov 12, 2024
41d8982
refactor code a little
djeebus Nov 12, 2024
b03a127
return errors when useful
djeebus Nov 12, 2024
f45d44b
add some logging
djeebus Nov 12, 2024
77b252b
simplify tests
djeebus Nov 13, 2024
bf9714d
fix location of variables
djeebus Nov 13, 2024
4419163
fix source of real data
djeebus Nov 13, 2024
2ae2b15
Merge remote-tracking branch 'origin/main' into replan
djeebus Nov 13, 2024
945f2d0
Merge remote-tracking branch 'origin/main' into replan
djeebus Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/on_pull-request_closed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
jobs:
remove-temp-image:
runs-on: ubuntu-22.04
continue-on-error: true

# should match env.FS_TAG, in both pr-open.yaml and pr-close.yaml
concurrency: pr-${{ github.event.pull_request.number }}
Expand Down
6 changes: 1 addition & 5 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ packages:
# place your package-specific config here
config:
all: true
github.com/zapier/kubechecks/pkg/generator:
# place your package-specific config here
config:
all: true
github.com/zapier/kubechecks/pkg/affected_apps:
github.com/zapier/kubechecks/pkg/vcs/gitlab_client:
# place your package-specific config here
config:
all: true
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ func init() {
stringFlag(flags, "worst-hooks-state", "The worst state that can be returned from the hooks renderer.",
newStringOpts().
withDefault("panic"))
stringFlag(flags, "replan-comment-msg", "comment message which re-triggers kubechecks on PR.",
newStringOpts().
withDefault("kubechecks again"))

panicIfError(viper.BindPFlags(flags))
setupLogOutput()
Expand Down
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The full list of supported environment variables is described below:
|`KUBECHECKS_OTEL_ENABLED`|Enable OpenTelemetry.|`false`|
|`KUBECHECKS_PERSIST_LOG_LEVEL`|Persists the set log level down to other module loggers.|`false`|
|`KUBECHECKS_POLICIES_LOCATION`|Sets rego policy locations to be used for every check request. Can be common path inside the repos being checked or git urls in either git or http(s) format.|`[./policies]`|
|`KUBECHECKS_REPLAN_COMMENT_MSG`|comment message which re-triggers kubechecks on PR.|`kubechecks again`|
|`KUBECHECKS_REPO_REFRESH_INTERVAL`|Interval between static repo refreshes (for schemas and policies).|`5m`|
|`KUBECHECKS_SCHEMAS_LOCATION`|Sets schema locations to be used for every check request. Can be common paths inside the repos being checked or git urls in either git or http(s) format.|`[]`|
|`KUBECHECKS_SHOW_DEBUG_INFO`|Set to true to print debug info to the footer of MR comments.|`false`|
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/xanzy/go-gitlab v0.105.0
github.com/xanzy/go-gitlab v0.107.0
github.com/yannh/kubeconform v0.6.4
github.com/ziflex/lecho/v3 v3.5.0
go.opentelemetry.io/contrib/instrumentation/runtime v0.53.0
Expand Down
9 changes: 7 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,11 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4=
github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
Expand Down Expand Up @@ -1026,6 +1029,8 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.105.0 h1:3nyLq0ESez0crcaM19o5S//SvezOQguuIHZ3wgX64hM=
github.com/xanzy/go-gitlab v0.105.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI=
github.com/xanzy/go-gitlab v0.107.0 h1:P2CT9Uy9yN9lJo3FLxpMZ4xj6uWcpnigXsjvqJ6nd2Y=
github.com/xanzy/go-gitlab v0.107.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand Down
116 changes: 116 additions & 0 deletions mocks/gitlab_client/mocks/mock_CommitsServices.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading