Skip to content

Commit

Permalink
Extract plugins and delete legacy platforms (#1390)
Browse files Browse the repository at this point in the history
* Fix panic in Slack tester
* Extract non-essential plugins
* Remove deprecated platforms long time ago (Legacy Slack and Legacy Teams)
  • Loading branch information
pkosiec authored Feb 22, 2024
1 parent 148a9ed commit 64149cc
Show file tree
Hide file tree
Showing 150 changed files with 378 additions and 13,903 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/process-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
HELM_DOCS_VERSION: 1.11.0
CHART_REPOSITORY: https://charts.botkube.io/
LATEST_PLUGIN_INDEX_URL: https://storage.googleapis.com/botkube-plugins-latest/plugins-index.yaml
LATEST_X_PLUGIN_TPLS_URL: github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=main

on:
workflow_call:
Expand Down Expand Up @@ -54,7 +53,6 @@ jobs:
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_CURRENT_VERSION}/${{ inputs.next-version }}/g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_DEV_VERSION}/${{ inputs.next-version }}/g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_PLUGIN_INDEX_URL}~https://github.com/kubeshop/botkube/releases/download/${{ inputs.next-version }}/plugins-index.yaml~g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_X_PLUGIN_TPLS_URL}~github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=${{ inputs.next-version }}~g" {} +
- name: Set up chart-testing
uses: helm/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
HELM_DOCS_VERSION: 1.11.0
CHART_REPOSITORY: https://storage.googleapis.com/botkube-latest-main-charts
LATEST_PLUGIN_INDEX_URL: https://storage.googleapis.com/botkube-plugins-latest/plugins-index.yaml
LATEST_X_PLUGIN_TPLS_URL: github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=main

jobs:
process-chart:
Expand Down
210 changes: 0 additions & 210 deletions .goreleaser.plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,85 +9,10 @@ before:
- go mod download

builds:
- id: doctor
main: cmd/executor/doctor/main.go
binary: executor_doctor_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: echo
main: cmd/executor/echo/main.go
binary: executor_echo_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: exec
main: cmd/executor/exec/main.go
binary: executor_exec_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: flux
main: cmd/executor/flux/main.go
binary: executor_flux_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: gh
main: cmd/executor/gh/main.go
binary: executor_gh_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: helm
main: cmd/executor/helm/main.go
binary: executor_helm_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
Expand All @@ -103,36 +28,6 @@ builds:
main: cmd/executor/kubectl/main.go
binary: executor_kubectl_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: thread-mate
main: cmd/executor/thread-mate/main.go
binary: executor_thread-mate_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: argocd
main: cmd/source/argocd/main.go
binary: source_argocd_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
Expand All @@ -148,36 +43,6 @@ builds:
main: cmd/source/cm-watcher/main.go
binary: source_cm-watcher_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: github-events
main: cmd/source/github-events/main.go
binary: source_github-events_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: keptn
main: cmd/source/keptn/main.go
binary: source_keptn_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
Expand All @@ -193,21 +58,6 @@ builds:
main: cmd/source/kubernetes/main.go
binary: source_kubernetes_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
- id: prometheus
main: cmd/source/prometheus/main.go
binary: source_prometheus_{{ .Os }}_{{ .Arch }}

no_unique_dist_dir: true
env:
- CGO_ENABLED=0
Expand All @@ -222,89 +72,29 @@ builds:

archives:

- builds: [doctor]
id: doctor
files:
- none*
name_template: "{{ .Binary }}"

- builds: [echo]
id: echo
files:
- none*
name_template: "{{ .Binary }}"

- builds: [exec]
id: exec
files:
- none*
name_template: "{{ .Binary }}"

- builds: [flux]
id: flux
files:
- none*
name_template: "{{ .Binary }}"

- builds: [gh]
id: gh
files:
- none*
name_template: "{{ .Binary }}"

- builds: [helm]
id: helm
files:
- none*
name_template: "{{ .Binary }}"

- builds: [kubectl]
id: kubectl
files:
- none*
name_template: "{{ .Binary }}"

- builds: [thread-mate]
id: thread-mate
files:
- none*
name_template: "{{ .Binary }}"

- builds: [argocd]
id: argocd
files:
- none*
name_template: "{{ .Binary }}"

- builds: [cm-watcher]
id: cm-watcher
files:
- none*
name_template: "{{ .Binary }}"

- builds: [github-events]
id: github-events
files:
- none*
name_template: "{{ .Binary }}"

- builds: [keptn]
id: keptn
files:
- none*
name_template: "{{ .Binary }}"

- builds: [kubernetes]
id: kubernetes
files:
- none*
name_template: "{{ .Binary }}"

- builds: [prometheus]
id: prometheus
files:
- none*
name_template: "{{ .Binary }}"


snapshot:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ gen-grpc-resources:
# Generate plugins YAML index files for both all plugins and end-user ones.
gen-plugins-index: build-plugins
go run ./hack/gen-plugin-index.go -output-path ./plugins-dev-index.yaml
go run ./hack/gen-plugin-index.go -output-path ./plugins-index.yaml -plugin-name-filter 'kubectl|helm|kubernetes|prometheus|exec|doctor|keptn|github-events|flux|argocd'
go run ./hack/gen-plugin-index.go -output-path ./plugins-index.yaml -plugin-name-filter 'kubectl|kubernetes'

gen-docs-cli:
rm -f ./cmd/cli/docs/*
Expand Down
16 changes: 0 additions & 16 deletions cmd/botkube-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,6 @@ func run(ctx context.Context) (err error) {
}

// Run bots
if commGroupCfg.Slack.Enabled {
sb, err := bot.NewSlack(commGroupLogger.WithField(botLogFieldKey, "Slack"), commGroupMeta, commGroupCfg.Slack, executorFactory, analyticsReporter)
if err != nil {
return reportFatalError("while creating Slack bot", err)
}
scheduleBotNotifier(sb)
}

if commGroupCfg.SocketSlack.Enabled {
sb, err := bot.NewSocketSlack(commGroupLogger.WithField(botLogFieldKey, "SocketSlack"), commGroupMeta, commGroupCfg.SocketSlack, executorFactory, analyticsReporter)
if err != nil {
Expand All @@ -303,14 +295,6 @@ func run(ctx context.Context) (err error) {
scheduleBotNotifier(mb)
}

if commGroupCfg.Teams.Enabled {
tb, err := bot.NewTeams(commGroupLogger.WithField(botLogFieldKey, "MS Teams"), commGroupMeta, commGroupCfg.Teams, conf.Settings.ClusterName, executorFactory, analyticsReporter)
if err != nil {
return reportFatalError("while creating Teams bot", err)
}
scheduleBotNotifier(tb)
}

if commGroupCfg.CloudTeams.Enabled {
ctb, err := bot.NewCloudTeams(commGroupLogger.WithField(botLogFieldKey, "CloudTeams"), commGroupMeta, commGroupCfg.CloudTeams, conf.Settings.ClusterName, executorFactory, analyticsReporter)
if err != nil {
Expand Down
19 changes: 0 additions & 19 deletions cmd/executor/doctor/main.go

This file was deleted.

Loading

0 comments on commit 64149cc

Please sign in to comment.