-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
None
-
None
After creating the new repository for the riscv-port project, the first new branch created was never notified to the mailing list even though branch notification was turned on.
After investigating, this looks to be a bootstrapping issue with new repositories. For this repository, like for most other project repositories, we configure a branch filter for notifications to avoid notifying for events on the master branch like this:
"branches": "^(?!master).*$",
This means that until another branch is created, the RepositoryWorkItem will not see any branches in the repo and will subsequently never initiate the BranchHistory file in the "DB" repo.
When the first new branch is created, RepositoryWorkItem::run sees it, and uses it to initialize the BranchHistory for the repo, but when doing so, it assumes this is the initial state of the branch history and does not send out any notifications.
I'm thinking we need to initiate the BranchHistory the first time a RepositoryWorkItem is run for a repo, regardless of if any branches are found, and just handle an empty file in the DB repo. Then when a new branch is created, it will be notified as expected. Handling an empty history may be complicated due to how it's currently modelled. We could also consider tracking all branches found regardless of filter. That would likely give us better behavior if we ever changed the filter on a repo.
A possible workaround would be to initially deploy the Skara notifier configuration without the branches filter, to get the branch history initialized, and then shortly after add it and redeploy the Skara bot.
After investigating, this looks to be a bootstrapping issue with new repositories. For this repository, like for most other project repositories, we configure a branch filter for notifications to avoid notifying for events on the master branch like this:
"branches": "^(?!master).*$",
This means that until another branch is created, the RepositoryWorkItem will not see any branches in the repo and will subsequently never initiate the BranchHistory file in the "DB" repo.
When the first new branch is created, RepositoryWorkItem::run sees it, and uses it to initialize the BranchHistory for the repo, but when doing so, it assumes this is the initial state of the branch history and does not send out any notifications.
I'm thinking we need to initiate the BranchHistory the first time a RepositoryWorkItem is run for a repo, regardless of if any branches are found, and just handle an empty file in the DB repo. Then when a new branch is created, it will be notified as expected. Handling an empty history may be complicated due to how it's currently modelled. We could also consider tracking all branches found regardless of filter. That would likely give us better behavior if we ever changed the filter on a repo.
A possible workaround would be to initially deploy the Skara notifier configuration without the branches filter, to get the branch history initialized, and then shortly after add it and redeploy the Skara bot.
- duplicates
-
SKARA-1979 MailingListNotifier will not send an email notification when the first branch of some repos is created
-
- Resolved
-
- relates to
-
SKARA-1452 Can never notify on first commit
-
- Resolved
-