RFR: 243: Merge bot should support merging with certain frequency

Erik Helin ehelin at openjdk.java.net
Mon Jan 27 09:05:07 UTC 2020


On Mon, 27 Jan 2020 07:29:35 GMT, Robin Westberg <rwestberg at openjdk.org> wrote:

>> Hi all,
>> 
>> please review this patch that enables the merge bot to periodically sync
>> branches with a certain frequency. This is implemented by extending the
>> configuration for a merge specification:
>> 
>> "merge": {
>>     "target": "github:openjdk/panama",
>>     "specs": [
>>         {
>> 	    "from": "github:openjdk/jdk:master",
>> 	    "to": "master",
>> 	    "frequency": {
>> 	        "interval": "weekly",
>> 		"weekday": "Friday",
>> 		"hour": "11"
>> 	    }
>> 	}
>>     ]
>> }
>> 
>> The above configuration would merge the `master` branch from the
>> [jdk](https://github.com/openjdk/jdk) repository to the `master` branch in the
>> [panama](https://github.com/openjdk/panama) repository every Friday at 11:00.
>> The merge will only be done once, i.e. it won't be retried until the next Friday
>> if the merge fails (and result in a merge conflict PR).
>> 
>> There is one limitation with the patch and that is that the merge bot only
>> "remember" previous merges in memory. This is problematic if we redeploy the
>> merge bot during 11:00 - 11:59 on a Friday and the merge already has occurred,
>> the merge bot will then do a second merge. This is known limitation and one I
>> think we can live with, I don't foresee it to become a problem in practice.
>> 
>> Thanks,
>> Erik
>> 
>> ## Testing
>> - [x] Added a bunch of new unit tests
> 
> bots/merge/src/main/java/org/openjdk/skara/bots/merge/MergeBotFactory.java line 82:
> 
>> 81:     private static Month toMonth(String s) {
>> 82:         switch (s.toLowerCase()) {
>> 83:             case "january":
> 
> Would perhaps be a little less verbose to use Month.from with an appropriate formatter, but can keep it as-is if you prefer. :)

Yeah, I agree, but since I've already written the verbose version, lets just keep it for now ��

-------------

PR: https://git.openjdk.java.net/skara/pull/381


More information about the skara-dev mailing list