samueldr / github-to-irc

MIT License
0 stars 1 forks source link

Coalesce PR merge + push ? #3

Open samueldr opened 6 years ago

samueldr commented 6 years ago

The best bet would be some kind of heuristics where

When we get one of:

The bot could wait some time collecting relevant events (all the same listed previously) and build its own kind of pseudo-event like "CoalescedMerge" so it will spam the channel a bit less.

That list of events if not always ordered the same way.


For this, we need:

samueldr commented 6 years ago

Sample messages:

Showing all three event types!

[22:08:27] [{^_^}] [nixpkgs] @grahamc closed pull request #36610 → librime: 1.2.9 -> 1.2.10 → https://git.io/vAxAW
[22:08:27] [{^_^}] [nixpkgs] @grahamc pushed 3 commits to master: https://git.io/vxvf7
[22:08:31] [{^_^}]  → 1c99ffcb by @sifmelcara: librime: 1.2.9 -> 1.3.0
[22:08:31] [{^_^}]  → cbf735e3 by @sifmelcara: brise: change platforms to linux only
[22:08:31] [{^_^}]  → e065aa94 by @grahamc: Merge pull request #36808 from sifmelcara/update/librime
[22:08:31] [{^_^}] [nixpkgs] @grahamc merged pull request #36808 → librime: 1.2.9 -> 1.3.0 → https://git.io/vxe89

Showing only two event types

[00:43:05] [{^_^}] [nixpkgs] @Ericson2314 merged pull request #36841 → callCabal2nix: Use host platform rather than build platform for evaluation of Cabal files → https://git.io/vxvfG
[00:43:05] [{^_^}] [nixpkgs] @Ericson2314 pushed 2 commits to master: https://git.io/vxvtC
[00:43:06] [{^_^}]  → f34e136a by @kmicklas: callCabal2nix: Use host platform rather than build platform for evaluation of Cabal files
[00:43:10] [{^_^}]  → 13c5a570 by @Ericson2314: Merge pull request #36841 from obsidiansystems/cabal2nix-system-hostPlatform
[06:54:33] [{^_^}] [nixpkgs] @7c6f434c merged pull request #35122 → dar: 2.5.9 -> 2.5.14 → https://git.io/vA8sl
[06:54:34] [{^_^}] [nixpkgs] @7c6f434c pushed 3 commits to master: https://git.io/vxv2r
[06:54:34] [{^_^}]  → 242e7727 by @Izorkin: dar: 2.5.9 -> 2.5.14
[06:54:38] [{^_^}]  → 3bca698d by @Izorkin: dar 2.5.14: fix build on Darwin
[06:54:38] [{^_^}]  → 1e4358e5 by @7c6f434c: Merge pull request #35122 from Izorkin/dar-2.5.14

Showing no merge commits

[03:50:13] [{^_^}] [nixpkgs] @bjornfor pushed commit from @ryantm to master « sdcc: 3.6.0 -> 3.7.0 »: https://git.io/vxvZe
[03:50:39] [{^_^}] [nixpkgs] @bjornfor closed pull request #36685 → sdcc: 3.6.0 -> 3.7.0 → https://git.io/vAhZo

With another message interleaved

(and no merge commit)

[04:05:08] [{^_^}] [nixpkgs] @7c6f434c pushed commit from @pjan to master « youtube-dl: 2018.03.03 -> 2018.03.10 »: https://git.io/vxvZ5
[04:07:25] [{^_^}] [nixpkgs] @Izorkin opened pull request #36849 → nftables: 0.8.2 -> 0.8.3 → https://git.io/vxvnf
[04:08:02] [{^_^}] [nixpkgs] @7c6f434c closed pull request #36843 → updates youtube-dl → https://git.io/vxvJw
samueldr commented 6 years ago

We probably cannot coalesce push events without merge commits.

samueldr commented 6 years ago

Meanwhile, looking at my logs, it looks like the github bot didn't report merge events for pull requests, only open and close (possibly reopen)

samueldr commented 6 years ago
[08:43:58] <gchristensen> what about dropping any push events where any commit message contains "Merge pull request #35122"
[08:47:15] <samueldr> dropping them only when the tip (last) commit is the merge event, otherwise this could hide other kind of (larger) push events