[PR #368] [CLOSED] Add Terraform configuration for PostHog Slack feedback notifications #368

Closed
opened 2026-02-16 02:17:21 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/368
Author: @adrianlyjak
Created: 2/11/2026
Status: Closed

Base: mainHead: claude/slack-feedback-notification-PehCn


📝 Commits (1)

  • 69a07ef Add PostHog Terraform config for Slack feedback notifications

📊 Changes

3 files changed (+127 additions, -0 deletions)

View changed files

infra/terraform-posthog/main.tf (+90 -0)
infra/terraform-posthog/variables.tf (+24 -0)
infra/terraform-posthog/versions.tf (+13 -0)

📄 Description

Summary

This PR adds Terraform infrastructure-as-code to configure a PostHog Hog Function that automatically posts feedback form submissions to a Slack channel.

Key Changes

  • main.tf: Defines a posthog_hog_function resource that creates a "Slack Feedback Notification" destination function

    • Implements custom Hog code to fetch and post messages to Slack's chat.postMessage API
    • Configures message formatting with blocks including feedback submitter name, event type, and a link to view the person in PostHog
    • Filters to trigger only on "survey sent" events
    • Includes error handling for Slack API failures
  • variables.tf: Declares required input variables

    • posthog_api_key: PostHog personal API key (sensitive)
    • posthog_project_id: Target PostHog project/environment
    • slack_bot_token: Slack Bot OAuth token with chat:write scope (sensitive)
    • slack_channel: Target Slack channel ID
  • versions.tf: Specifies Terraform and provider requirements

    • Requires Terraform >= 1.0
    • Requires PostHog provider ~> 1.0.4

Notable Implementation Details

  • Uses a direct Slack bot token approach rather than OAuth integration, allowing full configuration via Terraform variables
  • Implements proper error handling with status code and response body validation
  • Leverages PostHog's templating syntax (e.g., {person.name}, {event.event}) for dynamic message content
  • Includes MIT license headers consistent with project standards

https://claude.ai/code/session_0182eJNyfkXhHPMyUhdaA8Jh


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/368 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 2/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `claude/slack-feedback-notification-PehCn` --- ### 📝 Commits (1) - [`69a07ef`](https://github.com/run-llama/workflows-py/commit/69a07efae2097316e3c2d9b052ced8c9e09e2e82) Add PostHog Terraform config for Slack feedback notifications ### 📊 Changes **3 files changed** (+127 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `infra/terraform-posthog/main.tf` (+90 -0) ➕ `infra/terraform-posthog/variables.tf` (+24 -0) ➕ `infra/terraform-posthog/versions.tf` (+13 -0) </details> ### 📄 Description ## Summary This PR adds Terraform infrastructure-as-code to configure a PostHog Hog Function that automatically posts feedback form submissions to a Slack channel. ## Key Changes - **main.tf**: Defines a `posthog_hog_function` resource that creates a "Slack Feedback Notification" destination function - Implements custom Hog code to fetch and post messages to Slack's `chat.postMessage` API - Configures message formatting with blocks including feedback submitter name, event type, and a link to view the person in PostHog - Filters to trigger only on "survey sent" events - Includes error handling for Slack API failures - **variables.tf**: Declares required input variables - `posthog_api_key`: PostHog personal API key (sensitive) - `posthog_project_id`: Target PostHog project/environment - `slack_bot_token`: Slack Bot OAuth token with chat:write scope (sensitive) - `slack_channel`: Target Slack channel ID - **versions.tf**: Specifies Terraform and provider requirements - Requires Terraform >= 1.0 - Requires PostHog provider ~> 1.0.4 ## Notable Implementation Details - Uses a direct Slack bot token approach rather than OAuth integration, allowing full configuration via Terraform variables - Implements proper error handling with status code and response body validation - Leverages PostHog's templating syntax (e.g., `{person.name}`, `{event.event}`) for dynamic message content - Includes MIT license headers consistent with project standards https://claude.ai/code/session_0182eJNyfkXhHPMyUhdaA8Jh --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:21 -05:00
yindo closed this issue 2026-02-16 02:17:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#368