Skip to content

Commit

Permalink
feat: make channel ids dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal committed May 2, 2024
1 parent dfd694c commit d427931
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/slack/channels/channels.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ resource "slack_conversation" "wg_channels" {
action_on_destroy = each.value.action_on_destroy
action_on_update_permanent_members = each.value.action_on_update_permanent_members
adopt_existing_channel = each.value.adopt_existing_channel
}

output "wg_channels" {
value = slack_conversation.wg_channels
}
7 changes: 5 additions & 2 deletions .github/workflows/slack/groups/groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ terraform {
}
}

variable "wg_channels" {
description = "Map of working group channels"
}

variable "data_sources" {
default = {
tsc_members_user_ids = []
Expand Down Expand Up @@ -56,7 +60,6 @@ locals {
# Handle will be the name of the group in lowercase and with spaces replaced by hyphens succeded by "wg-"
handle = lookup(lookup(lookup(wg_data, "slack", {}), "group", {}), "handle", "${replace(lower(wg_data.name), " ", "-")}-wg")
users = concat([for member in wg_data.chairpersons : member.slack], [for member in wg_data.members : member.slack])
channels = lookup(wg_data, "channels", [])
}
}
}
Expand All @@ -67,5 +70,5 @@ resource "slack_usergroup" "wg_groups" {
handle = each.value.handle
description = each.value.description
users = each.value.users
channels = each.value.channels
channels = [var.wg_channels[each.value.name].id]
}
3 changes: 2 additions & 1 deletion .github/workflows/slack/slack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "channels" {

module "groups" {
source = "./groups"
depends_on = [ module.users ]
depends_on = [ module.users, module.channels ]
data_sources = module.users.data_sources
wg_channels = module.channels.wg_channels
}
5 changes: 1 addition & 4 deletions WORKING_GROUPS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ working_groups:
# handle: # Optional. The handle of the Slack group in the AsyncAPI workspace. Recommended pattern: wg-<name-in-kebab-case>. Example: maintainers-growth-wg. If not provided, the name of the wg will be used and transformed to follow the recommended pattern. The handle should be unique and not in use by a member, channel, or another group.
# name: # Optional. The name of the Slack group. (If not provided, the name of the group will be autogenerated based on the name of the wg).
# description: # Recommended. The description of the Slack group. (If not provided, the description of the wg will be used).
# channels: # Optional. A list of channel IDs for channels that the user group will be in.
# objectives: # Recommended. List of sentences outlining the objectives of the working group; or Link to a GitHub project, issue, or any other tool where the Working Group outlines their objectives.
# - The AsyncAPI community grows sustainably.
# roadmap_url: https://example.com/xyz # Recommended. Link to a GitHub project, issue, or any other tool where the Working Group outlines their roadmap.
Expand Down Expand Up @@ -97,9 +96,7 @@ working_groups:
handle: wg-developer-experience
description: 'The goal of this group is to empower AsyncAPI user journey trough intuitive onboarding, tools, and a frictionless experience.'
topic: 'Current Roadmap: https://shapeit.app/projects/org/asyncapi/16/cycles/ceb40c9d?issue=I_kwDOLQFNzc5-xigF'
group:
channels:
- "C06G92DN05D"
group:
handle: dx_wg
roadmap_url: https://shapeit.app/projects/org/asyncapi/16
objectives:
Expand Down

0 comments on commit d427931

Please sign in to comment.