Skip to content

Commit c7be471

Browse files
Oded-Bhnnsgstfssnyzdann
authored
Argocd diff (#4)
Optionally add ArgoCD "diff" comment on PRs Light refactoring of the promotion logic to allow ArgoCD functionality to re-use of generateListOfRelevantComponents --------- Co-authored-by: Hannes Gustafsson <[email protected]> Co-authored-by: Yazdan Mohammadi <[email protected]>
1 parent 05a8c31 commit c7be471

File tree

11 files changed

+2256
-290
lines changed

11 files changed

+2256
-290
lines changed

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
FROM golang:1.21.5 as test
2+
FROM golang:1.22.2 as test
33
ARG GOPROXY
44
ENV GOPATH=/go
55
ENV PATH="$PATH:$GOPATH/bin"
@@ -8,7 +8,6 @@ COPY . ./
88
RUN make test
99

1010
FROM test as build
11-
# FROM golang:1.21.5 as build
1211
ARG GOPROXY
1312
ENV GOPATH=/go
1413
ENV PATH="$PATH:$GOPATH/bin"

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ This is how this warning looks in the PR:
110110
<img src="https://user-images.githubusercontent.com/1616153/219383563-8b833c17-7701-45b6-9471-d937d03142f4.png" width="50%" height="50%">
111111
<!-- markdownlint-enable MD033 -->
112112

113+
### ArgoCD integration
114+
115+
Telefonistka can compare manifests in PR branches to live objects in the clusters and comment on the difference in PRs
116+
117+
<!-- markdownlint-disable MD033 -->
118+
<img width="50%" alt="image" src="https://github.com/commercetools/telefonistka/assets/1616153/fe38dc7a-2dea-4461-a0bf-3b07531135a9">
119+
<!-- markdownlint-enable MD033 -->
120+
113121
### Artifact version bumping from CLI
114122

115123
If your IaC repo deploys software you maintain internally you probably want to automate artifact version bumping.

docs/installation.md

+8
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ Environment variables for the webhook process:
8787

8888
`TEMPLATES_PATH` Telefonistka uses Go templates to format GitHub PR comments, the variable override the default templates path("templates/"), useful for environments where the container workdir is overridden(like GitHub Actions) or when custom templates are desired.
8989

90+
`ARGOCD_SERVER_ADDR` Hostname and port of the ArgoCD API endpoint, like `argocd-server.argocd.svc.cluster.local:443`, default is `localhost:8080"`
91+
92+
`ARGOCD_TOKEN` ArgoCD authentication token.
93+
94+
`ARGOCD_PLAINTEXT` Allows disabeling TLS on ArgoCD API calls. (default: `false`)
95+
96+
`ARGOCD_INSECURE` Allow disabeling server certificate validation. (default: `false`)
97+
9098
Behavior of the bot is configured by YAML files **in the target repo**:
9199

92100
## Repo Configuration

go.mod

+155-27
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,195 @@
11
module github.com/wayfair-incubator/telefonistka
22

3-
go 1.21
3+
go 1.22
4+
5+
toolchain go1.22.1
46

57
require (
68
github.com/alexliesenfeld/health v0.8.0
7-
github.com/bradleyfalzon/ghinstallation/v2 v2.8.0
9+
github.com/argoproj/argo-cd/v2 v2.11.0-rc1
10+
github.com/argoproj/gitops-engine v0.7.1-0.20240411122334-1ade3a199867
11+
github.com/bradleyfalzon/ghinstallation/v2 v2.10.0
812
github.com/go-test/deep v1.1.0
913
github.com/google/go-github/v52 v52.0.0
10-
github.com/google/go-github/v53 v53.2.0
11-
github.com/google/go-github/v54 v54.0.0
12-
github.com/google/go-github/v55 v55.0.0
1314
github.com/hashicorp/golang-lru/v2 v2.0.7
1415
github.com/hexops/gotextdiff v1.0.3
1516
github.com/migueleliasweb/go-github-mock v0.0.22
16-
github.com/prometheus/client_golang v1.17.0
17-
github.com/shurcooL/githubv4 v0.0.0-20230704064427-599ae7bbf278
17+
github.com/mikefarah/yq/v4 v4.43.1
18+
github.com/prometheus/client_golang v1.19.0
19+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
20+
github.com/shurcooL/githubv4 v0.0.0-20240120211514-18a1ae0e79dc
1821
github.com/sirupsen/logrus v1.9.3
1922
github.com/spf13/cobra v1.8.0
20-
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
21-
golang.org/x/oauth2 v0.15.0
23+
golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8
24+
golang.org/x/oauth2 v0.19.0
2225
gopkg.in/yaml.v2 v2.4.0
23-
gopkg.in/yaml.v3 v3.0.1
26+
k8s.io/apimachinery v0.26.11
2427
)
2528

2629
require (
27-
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
30+
cloud.google.com/go/compute v1.25.1 // indirect
31+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
32+
dario.cat/mergo v1.0.0 // indirect
33+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
34+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
35+
github.com/Masterminds/semver/v3 v3.2.1 // indirect
36+
github.com/Microsoft/go-winio v0.6.1 // indirect
37+
github.com/ProtonMail/go-crypto v1.0.0 // indirect
2838
github.com/a8m/envsubst v1.4.2 // indirect
2939
github.com/alecthomas/participle/v2 v2.1.1 // indirect
40+
github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1 // indirect
3041
github.com/beorn7/perks v1.0.1 // indirect
31-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
32-
github.com/cloudflare/circl v1.3.3 // indirect
42+
github.com/blang/semver/v4 v4.0.0 // indirect
43+
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
44+
github.com/bombsimon/logrusr/v2 v2.0.1 // indirect
45+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
46+
github.com/chai2010/gettext-go v1.0.2 // indirect
47+
github.com/cloudflare/circl v1.3.7 // indirect
48+
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
49+
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
50+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
51+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
3352
github.com/dimchansky/utfbom v1.1.1 // indirect
53+
github.com/docker/distribution v2.8.2+incompatible // indirect
3454
github.com/elliotchance/orderedmap v1.5.1 // indirect
55+
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
56+
github.com/emirpasic/gods v1.18.1 // indirect
57+
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
58+
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
59+
github.com/fatih/camelcase v1.0.0 // indirect
3560
github.com/fatih/color v1.16.0 // indirect
61+
github.com/felixge/httpsnoop v1.0.4 // indirect
62+
github.com/fvbommel/sortorder v1.1.0 // indirect
63+
github.com/go-errors/errors v1.5.1 // indirect
64+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
65+
github.com/go-git/go-billy/v5 v5.5.0 // indirect
66+
github.com/go-git/go-git/v5 v5.12.0 // indirect
67+
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
68+
github.com/go-logr/logr v1.4.1 // indirect
69+
github.com/go-logr/stdr v1.2.2 // indirect
70+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
71+
github.com/go-openapi/jsonreference v0.21.0 // indirect
72+
github.com/go-openapi/swag v0.23.0 // indirect
73+
github.com/go-redis/cache/v9 v9.0.0 // indirect
74+
github.com/gobwas/glob v0.2.3 // indirect
3675
github.com/goccy/go-json v0.10.2 // indirect
3776
github.com/goccy/go-yaml v1.11.3 // indirect
77+
github.com/gogo/protobuf v1.3.2 // indirect
3878
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
39-
github.com/golang/protobuf v1.5.3 // indirect
40-
github.com/google/go-github/v50 v50.1.0 // indirect
79+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
80+
github.com/golang/protobuf v1.5.4 // indirect
81+
github.com/google/btree v1.1.2 // indirect
82+
github.com/google/gnostic v0.7.0 // indirect
83+
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
84+
github.com/google/go-cmp v0.6.0 // indirect
4185
github.com/google/go-github/v56 v56.0.0 // indirect
86+
github.com/google/go-github/v60 v60.0.0 // indirect
4287
github.com/google/go-querystring v1.1.0 // indirect
88+
github.com/google/gofuzz v1.2.0 // indirect
89+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
90+
github.com/google/uuid v1.6.0 // indirect
4391
github.com/gorilla/mux v1.8.0 // indirect
92+
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
93+
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
94+
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
95+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
96+
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
97+
github.com/imdario/mergo v0.3.16 // indirect
4498
github.com/inconshreveable/mousetrap v1.1.0 // indirect
99+
github.com/itchyny/gojq v0.12.13 // indirect
100+
github.com/itchyny/timefmt-go v0.1.5 // indirect
101+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
45102
github.com/jinzhu/copier v0.4.0 // indirect
103+
github.com/jonboulle/clockwork v0.4.0 // indirect
104+
github.com/josharian/intern v1.0.0 // indirect
105+
github.com/json-iterator/go v1.1.12 // indirect
106+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
107+
github.com/kevinburke/ssh_config v1.2.0 // indirect
108+
github.com/klauspost/compress v1.17.8 // indirect
109+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
46110
github.com/magiconair/properties v1.8.7 // indirect
111+
github.com/mailru/easyjson v0.7.7 // indirect
47112
github.com/mattn/go-colorable v0.1.13 // indirect
48113
github.com/mattn/go-isatty v0.0.20 // indirect
49-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
50-
github.com/mikefarah/yq/v4 v4.43.1 // indirect
114+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
115+
github.com/moby/spdystream v0.2.0 // indirect
116+
github.com/moby/term v0.5.0 // indirect
117+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
118+
github.com/modern-go/reflect2 v1.0.2 // indirect
119+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
120+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
121+
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
122+
github.com/onsi/gomega v1.31.0 // indirect
123+
github.com/opencontainers/go-digest v1.0.0 // indirect
124+
github.com/opencontainers/image-spec v1.1.0 // indirect
125+
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
51126
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
52-
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
53-
github.com/prometheus/common v0.44.0 // indirect
54-
github.com/prometheus/procfs v0.11.1 // indirect
55-
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect
127+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
128+
github.com/pjbgf/sha1cd v0.3.0 // indirect
129+
github.com/pkg/errors v0.9.1 // indirect
130+
github.com/prometheus/client_model v0.6.1 // indirect
131+
github.com/prometheus/common v0.52.3 // indirect
132+
github.com/prometheus/procfs v0.13.0 // indirect
133+
github.com/r3labs/diff v1.1.0 // indirect
134+
github.com/redis/go-redis/v9 v9.5.1 // indirect
135+
github.com/robfig/cron/v3 v3.0.1 // indirect
136+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
137+
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect
138+
github.com/skeema/knownhosts v1.2.2 // indirect
56139
github.com/spf13/pflag v1.0.5 // indirect
140+
github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
141+
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
142+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
143+
github.com/xanzy/ssh-agent v0.3.3 // indirect
144+
github.com/xlab/treeprint v1.2.0 // indirect
57145
github.com/yuin/gopher-lua v1.1.1 // indirect
58-
golang.org/x/crypto v0.21.0 // indirect
59-
golang.org/x/net v0.22.0 // indirect
60-
golang.org/x/sys v0.18.0 // indirect
146+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.50.0 // indirect
147+
go.opentelemetry.io/otel v1.25.0 // indirect
148+
go.opentelemetry.io/otel/metric v1.25.0 // indirect
149+
go.opentelemetry.io/otel/trace v1.25.0 // indirect
150+
go.starlark.net v0.0.0-20240408152805-3f0a3703c02a // indirect
151+
golang.org/x/crypto v0.22.0 // indirect
152+
golang.org/x/mod v0.17.0 // indirect
153+
golang.org/x/net v0.24.0 // indirect
154+
golang.org/x/sync v0.7.0 // indirect
155+
golang.org/x/sys v0.19.0 // indirect
156+
golang.org/x/term v0.19.0 // indirect
61157
golang.org/x/text v0.14.0 // indirect
62-
golang.org/x/time v0.3.0 // indirect
158+
golang.org/x/time v0.5.0 // indirect
159+
golang.org/x/tools v0.20.0 // indirect
63160
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
64-
google.golang.org/appengine v1.6.7 // indirect
65-
google.golang.org/protobuf v1.31.0 // indirect
161+
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
162+
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect
163+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
164+
google.golang.org/grpc v1.63.2 // indirect
165+
google.golang.org/protobuf v1.33.0 // indirect
166+
gopkg.in/inf.v0 v0.9.1 // indirect
66167
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
168+
gopkg.in/warnings.v0 v0.1.2 // indirect
169+
gopkg.in/yaml.v3 v3.0.1 // indirect
170+
k8s.io/api v0.26.11 // indirect
171+
k8s.io/apiextensions-apiserver v0.26.10 // indirect
172+
k8s.io/apiserver v0.26.11 // indirect
173+
k8s.io/cli-runtime v0.26.11 // indirect
174+
k8s.io/client-go v0.26.11 // indirect
175+
k8s.io/component-base v0.26.11 // indirect
176+
k8s.io/component-helpers v0.26.11 // indirect
177+
k8s.io/klog/v2 v2.120.1 // indirect
178+
k8s.io/kube-aggregator v0.26.4 // indirect
179+
k8s.io/kube-openapi v0.0.0-20240403164606-bc84c2ddaf99 // indirect
180+
k8s.io/kubectl v0.26.4 // indirect
181+
k8s.io/kubernetes v1.26.11 // indirect
182+
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
183+
layeh.com/gopher-json v0.0.0-20190114024228-97fed8db8427 // indirect
184+
oras.land/oras-go/v2 v2.5.0 // indirect
185+
sigs.k8s.io/controller-runtime v0.14.7 // indirect
186+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
187+
sigs.k8s.io/kustomize/api v0.17.1 // indirect
188+
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
189+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
190+
sigs.k8s.io/yaml v1.4.0 // indirect
67191
)
192+
193+
replace sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.12.1
194+
195+
replace sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.9

0 commit comments

Comments
 (0)