Closed littleskunk closed 8 years ago
@super3 What is the goal? Only 1 comment on github, less spam on slack or both?
Your #1 solution seems like the best. Less Gihub spam is the priority. Slack is less of a priority. A few extra Slack message never hurt anyone.
Solution (not pushed to github): Generate a combined comment like this
autobin binaries (only available for team members) last commit: 57cff9a49ea264e5632d5987cf227a2235f51daa driveshare_0.4.2.dmg driveshare_0.4.2.win32.exe driveshare_0.4.2_amd64.deb
Check the existing comments. Full match = Comment is up to date. Nothing to do. Match of the fist 2 lines = Comment for the last commit can be modified. Add the new binary without spam message. Match of the first line = Comment for an old commit must be deleted. Time to create a new comment that will trigger slack message etc. No match = Create a new comment.
Todo: At the moment the script has no wait time. The frist binary will trigger the slack message. Binary 2 and 3 will be added without a new message. The script should wait a short time and upload one message for all 3 binaries.
Done with 72660cf4707c22e7ab774b0a5e27c6c898fe96b1
Wait time is implemented now.
There are 2 different ways to implement that: 1) Remove comments from the build scripts and add a new notification script. The new script should watch for pull requests and wait for binary upload. As soon as all 3 binaries are uploaded the notification script should write one comment. If one script does not work for some reason the notification script should write the comment without the missing binary after a given timeout. Positiv: One comment on github and slack. Negativ: First binary is uploaded after a few minutes but my windows build server could need one hour. The comment for the first binary has to wait. New pull request commit would restart the timer.
2) All 3 scripts still add there comments but delete there old comments. All 3 scripts add all existing binaries to there comment. Positiv: One comment with all 3 binaries on github. No wait time. On github it would look like editing one comment. Negativ: Full spam support for slack.