Skip to content

Commit

Permalink
Enable per-project email notification setup
Browse files Browse the repository at this point in the history
This change allows defining the notification email on a per-project basis.

Signed-off-by: Samuli Seppänen <[email protected]>
  • Loading branch information
mattock committed Oct 1, 2024
1 parent 2abf3fa commit b392776
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,55 @@ docker_url=tcp://172.18.0.1:2375
docker_url=tcp://10.29.32.2:2375
```

# Email notification setup

Buildbot expects a local MTA such as postfix to be configured correctly.
However, there are still several parameters in *master.ini* for configuring
email notification preferences.

You can define an *owner* property for each project separately. It defines an
email address where build failure notifications for that project are sent.

```
# Applies when a project-specific "owner" is missing
[DEFAULT]
[email protected]
[openvpn]
[email protected]
[openvpn3]
[email protected]
[openvpn3-linux]
[email protected]
[ovpn-dco]
[email protected]
```

Note that value of *owner* must not be quoted.

Other settings that affect mail delivery are:

```
[email]
# Send email to this address when a worker goes missing. Only affects "always-on" workers.
notify_on_missing=["[email protected]"]
# Additional recipients who should get all build failure emails.
extra_recipients=["[email protected]"]
# Source address for the emails. Should generally match the SMTP username in
# the local MTA configuration.
[email protected]
# Address of the local MTA as seen by the Buildmaster container. Usually the
# Docker host that also runs Buildbot.
relayhost=172.18.0.1
```

# Development

## Defining image version and name
Expand Down
7 changes: 7 additions & 0 deletions buildbot-host/buildmaster/master-default.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[DEFAULT]
owner=root@localhost

[master]
master_fqdn=buildmaster

Expand All @@ -20,6 +23,7 @@ verified_authors_list=[
]

[openvpn]
owner=openvpn@localhost
repo_url=https://github.com/OpenVPN/openvpn.git
main_branch=master
release_branch=release/2.6
Expand Down Expand Up @@ -50,16 +54,19 @@ packaging_config_opt_combos=[""]
repo_url=https://github.com/OpenVPN/openvpn-build.git

[openvpn3]
owner=openvpn3@localhost
repo_url=https://github.com/OpenVPN/openvpn3.git
branch=master
tree_stable_timer=0

[openvpn3-linux]
owner=openvpn3-linux@localhost
repo_url=https://github.com/OpenVPN/openvpn3-linux.git
branch=master
tree_stable_timer=0

[ovpn-dco]
owner=ovpn-dco@localhost
repo_url=https://github.com/OpenVPN/ovpn-dco.git
branch=master
tree_stable_timer=None
Expand Down
16 changes: 15 additions & 1 deletion buildbot-host/buildmaster/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ verified_authors_list = json.loads(master_config.get("gerrit", "verified_authors
gerrit_user_password = master_config.get("gerrit", "user_password")

# openvpn settings
openvpn_owner = master_config.get("openvpn", "owner")
openvpn_repo_url = master_config.get("openvpn", "repo_url")
openvpn_main_branch = master_config.get("openvpn", "main_branch")
openvpn_release_branch = master_config.get("openvpn", "release_branch")
Expand All @@ -227,18 +228,21 @@ openvpn_tree_stable_timer = None if otst == "None" else int(otst)
openvpn_build_repo_url = master_config.get("openvpn-build", "repo_url")

# openvpn3 settings
openvpn3_owner = master_config.get("openvpn3", "owner")
openvpn3_repo_url = master_config.get("openvpn3", "repo_url")
openvpn3_branch = master_config.get("openvpn3", "branch")
o3tst = master_config.get("openvpn3", "tree_stable_timer")
openvpn3_tree_stable_timer = None if o3tst == "None" else int(o3tst)

# openvpn3-linux settings
openvpn3_linux_owner = master_config.get("openvpn3-linux", "owner")
openvpn3_linux_repo_url = master_config.get("openvpn3-linux", "repo_url")
openvpn3_linux_branch = master_config.get("openvpn3-linux", "branch")
o3ltst = master_config.get("openvpn3-linux", "tree_stable_timer")
openvpn3_linux_tree_stable_timer = None if o3ltst == "None" else int(o3ltst)

# ovpn-dco settings
ovpn_dco_owner = master_config.get("ovpn-dco", "owner")
ovpn_dco_repo_url = master_config.get("ovpn-dco", "repo_url")
ovpn_dco_branch = master_config.get("ovpn-dco", "branch")
odtst = master_config.get("ovpn-dco", "tree_stable_timer")
Expand Down Expand Up @@ -833,12 +837,14 @@ for branch_type, branch_name in openvpn_branches.items():
),
treeStableTimer=openvpn_tree_stable_timer,
builderNames=builder_names["openvpn-smoketest"],
properties={ 'owner': openvpn_owner },
)

openvpn_full_scheduler = schedulers.Dependent(
name=f"openvpn-full-{branch_type}",
upstream=openvpn_smoketest_scheduler,
builderNames=builder_names[f"openvpn_{branch_type}"],
properties={ 'owners': openvpn_owner },
)

openvpn_gerrit_smoketest_scheduler = schedulers.SingleBranchScheduler(
Expand All @@ -858,12 +864,14 @@ for branch_type, branch_name in openvpn_branches.items():
priority=1,
treeStableTimer=openvpn_tree_stable_timer,
builderNames=builder_names["openvpn-smoketest"],
properties={ 'owners': openvpn_owner },
)

openvpn_gerrit_full_scheduler = schedulers.Dependent(
name=f"openvpn-gerrit-full-{branch_type}",
upstream=openvpn_gerrit_smoketest_scheduler,
builderNames=builder_names[f"openvpn_{branch_type}"],
properties={ 'owners': openvpn_owner },
)

c["schedulers"].append(openvpn_smoketest_scheduler)
Expand All @@ -876,12 +884,14 @@ openvpn3_smoketest_scheduler = schedulers.SingleBranchScheduler(
change_filter=util.ChangeFilter(branch=openvpn3_branch, project="openvpn3"),
treeStableTimer=openvpn3_tree_stable_timer,
builderNames=builder_names["openvpn3-smoketest"],
properties={ 'owners': openvpn3_owner },
)

openvpn3_default_scheduler = schedulers.Dependent(
name="openvpn3-default",
upstream=openvpn3_smoketest_scheduler,
builderNames=builder_names["openvpn3"],
properties={ 'owners': openvpn3_owner },
)

c["schedulers"].append(openvpn3_smoketest_scheduler)
Expand All @@ -895,12 +905,14 @@ openvpn3_linux_smoketest_scheduler = schedulers.SingleBranchScheduler(
),
treeStableTimer=openvpn3_linux_tree_stable_timer,
builderNames=builder_names["openvpn3-linux-smoketest"],
properties={ 'owners': openvpn3_linux_owner },
)

openvpn3_linux_default_scheduler = schedulers.Dependent(
name="openvpn3-linux-default",
upstream=openvpn3_linux_smoketest_scheduler,
builderNames=builder_names["openvpn3-linux"],
properties={ 'owners': openvpn3_linux_owner },
)

c["schedulers"].append(openvpn3_linux_smoketest_scheduler)
Expand All @@ -911,12 +923,14 @@ ovpn_dco_smoketest_scheduler = schedulers.SingleBranchScheduler(
change_filter=util.ChangeFilter(branch=ovpn_dco_branch, project="ovpn-dco"),
treeStableTimer=ovpn_dco_tree_stable_timer,
builderNames=builder_names["ovpn-dco-smoketest"],
properties={ 'owners': ovpn_dco_owner },
)

ovpn_dco_default_scheduler = schedulers.Dependent(
name="ovpn-dco-default",
upstream=ovpn_dco_smoketest_scheduler,
builderNames=builder_names["ovpn-dco"],
properties={ 'owners': ovpn_dco_owner },
)

c["schedulers"].append(ovpn_dco_smoketest_scheduler)
Expand Down Expand Up @@ -1034,7 +1048,7 @@ generator = reporters.BuildStatusGenerator(

mn = reporters.MailNotifier(
fromaddr=fromaddr,
sendToInterestedUsers=False,
sendToInterestedUsers=True,
extraRecipients=extra_recipients,
relayhost=relayhost,
generators=[generator, reporters.WorkerMissingGenerator()],
Expand Down

0 comments on commit b392776

Please sign in to comment.