Skip to content

Refactor Botkube stack into 9 stacks. One each for cluster - environment. #3305

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

feoh
Copy link
Contributor

@feoh feoh commented Jun 16, 2025

feat: Refactor Botkube stack into 9 stacks. One each for cluster - environment.

Mostly done by Claude Code aside from the Slack channel bit which I wrote.

What are the relevant tickets?

mitodl/hq#7186

Description (What does it do?)

Refactor Botkube stack into 9 stacks, one per cluster X environment

feoh added 3 commits June 16, 2025 17:02
feat: Refactor stack into 9 stacks. One each for cluster - environment.

Mostly done by Claude Code aside from the Slack channel bit which I
wrote.
@feoh feoh requested a review from Copilot June 24, 2025 15:23
@feoh feoh self-assigned this Jun 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Botkube Pulumi project into nine separate stacks—one per cluster-environment—introduces a dynamic Slack channel name based on the active stack, and renames the Pulumi project for consistency.

  • Derive slack_channel from get_stack() and wire it into the Helm chart instead of a hard-coded channel
  • Rename project from ol-infrastructure-botkube-application to ol-infrastructure-botkube
  • Add per-environment Pulumi config files under operations, infrastructure, and applications, plus SOPS secrets files

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ol_infrastructure/applications/botkube/main.py Compute and log Slack channel from stack; inject into chart
src/ol_infrastructure/applications/botkube/Pulumi.yaml Rename Pulumi project
src/ol_infrastructure/applications/botkube/Pulumi.operations.botkube.QA.yaml New QA operations stack config
src/ol_infrastructure/applications/botkube/Pulumi.operations.botkube.Production.yaml New Production operations stack config
src/ol_infrastructure/applications/botkube/Pulumi.operations.botkube.CI.yaml New CI operations stack config
src/ol_infrastructure/applications/botkube/Pulumi.infrastructure.botkube.QA.yaml New QA infrastructure stack config
src/ol_infrastructure/applications/botkube/Pulumi.infrastructure.botkube.Production.yaml New Production infrastructure stack config
src/ol_infrastructure/applications/botkube/Pulumi.infrastructure.botkube.CI.yaml New CI infrastructure stack config
src/ol_infrastructure/applications/botkube/Pulumi.applications.botkube.QA.yaml New QA application stack config
src/ol_infrastructure/applications/botkube/Pulumi.applications.botkube.Production.yaml New Production application stack config
src/ol_infrastructure/applications/botkube/Pulumi.applications.botkube.CI.yaml New CI application stack config
src/bridge/secrets/botkube/secrets.qa.yaml Add encrypted QA Slack tokens
src/bridge/secrets/botkube/secrets.production.yaml Add encrypted Production Slack tokens
Comments suppressed due to low confidence (2)

src/bridge/secrets/botkube/secrets.qa.yaml:1

  • [nitpick] The environment suffix in this file name is lowercase (qa), but other Pulumi config files use uppercase (QA). Consider using a consistent casing for environment identifiers across all filenames.
---

src/ol_infrastructure/applications/botkube/Pulumi.operations.botkube.QA.yaml:1

  • [nitpick] There is a lot of duplication across the per-environment operations, infrastructure, and applications YAML files. You might consider generating these configs via a script or templating engine to reduce repeated boilerplate.
---

feoh and others added 2 commits June 24, 2025 13:35
@@ -139,6 +139,11 @@
lambda ns: check_cluster_namespace(botkube_namespace, ns)
)

pulumi_stack = get_stack()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an existing utility called "parse_stack" that we typically use to pull out stack name components. That being said, we probably want to just put the slack channel in the stack config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants