summaryrefslogtreecommitdiff
path: root/communication/slack-config/README.md
blob: 4a3930ab1b26c924dd16039fd1a443778a621c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Slack Config

YAML files in this directory control the state of Slack, via
[Tempelis]. Updating a configuration file will result in Slack being updated
once the change merges. If a change is not legal, a presubmit will fail.

## Users

There is no safe, stable way to derive a specific Slack user from any
human-readable identifier. Instead of using Slack IDs everywhere, a single
mapping from GitHub usernames to Slack IDs is given in `users.yaml`. To reference
a user, they must first be added to `users.yaml`.

## Channels

Channels can be created by adding a new channel in `channels.yaml`. Channels
should be sorted alphabetically. New channels will be created in accordance
with the template specified in `template.yaml`.

Deleting channels is not permitted, but a channel can be archived by specifying
`archived: true`, or unarchived by removing it (or specifying `false`).

To rename a channel, set its `id` property to its current Slack ID, then change
the name.

A fully-specified channel looks like this:

```yaml
- name: slack-admins # mandatory
  id: C4M06S5HS      # optional except when renaming
  archived: false    # optional for unarchived channels
```

## Usergroups

Usergroups are pingable Slack groups. All members of a usergroup can be
automatically added to certain channels. A usergroup must have at least one
member. A usergroup can be removed by deleting it from the configuration.

Some usergroups (e.g. `@test-infra-oncall`) are managed by other tooling. To
prevent Tempelis from trying to deactivate these usergroups, they can be included
on the list and marked as `external: true`. Other usergroups should look like
this:

```yaml
- name: slack-admins               # mandatory, the pingable handle
  long_name: Slack Admins          # mandatory, the human-readable name
  description: Slack Admin Group   # mandatory, a description
  channels:                        # optional, a list of channels for members to auto-join
    - slack-admins
  members:                         # mandatory, a list of at least one member.
    - castrojo                     # member names must be listed in users.yaml.
    - katharine
    - jeefy
    - mrbobbytables
    - alejandrox1
    - jdumars
    - parispitmann
    - coderanger
    - idvoretskyi
    - idealhack
```

[Tempelis]: https://github.com/kubernetes-sigs/slack-infra/tree/main/tempelis