Discussion:
[Qt-creator] [FYI] the new way to retarget gerrit changes
Oswald Buddenhagen
2018-01-08 13:40:15 UTC
Permalink
Either extend the sanity bot, or create a new bot, which listens on
gerrit's event stream.
If the change's owner (or an approver?) posts a comment reading "Please
retarget <branch>", run your script on the server side. You need some
sanity test that ensures this branch exists etc...
... which he implemented, and it's deployed now.

for simplicity, only the change owner may issue the command. for other
cases, you still need to go through an admin. the same is advisable for
batch requests, but do as you wish.

the regex is

/^(?:gerrit-)?bot:\h*(?:please\h+)?move\h+(?:back\h+)?to\h+(?:branch\h+)?([\w.]*\w)\b/im

which boils down to "bot: move to <branch>" at the start of any line of
a gerrit cover message.
Konstantin Tokarev
2018-01-08 13:48:44 UTC
Permalink
Post by Oswald Buddenhagen
    Either extend the sanity bot, or create a new bot, which listens on
    gerrit's event stream.
    If the change's owner (or an approver?) posts a comment reading "Please
    retarget <branch>", run your script on the server side. You need some
    sanity test that ensures this branch exists etc...
... which he implemented, and it's deployed now.
for simplicity, only the change owner may issue the command. for other
cases, you still need to go through an admin. the same is advisable for
batch requests, but do as you wish.
I think batch requests should be automated by adding comments via Gerrit's API
(to minimize your distractions)
Post by Oswald Buddenhagen
the regex is
  /^(?:gerrit-)?bot:\h*(?:please\h+)?move\h+(?:back\h+)?to\h+(?:branch\h+)?([\w.]*\w)\b/im
which boils down to "bot: move to <branch>" at the start of any line of
a gerrit cover message.
Oh, "please" keyword :)
Post by Oswald Buddenhagen
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Regards,
Konstantin
Orgad Shaneh
2018-01-08 13:51:13 UTC
Permalink
Post by Oswald Buddenhagen
Either extend the sanity bot, or create a new bot, which listens on
gerrit's event stream.
If the change's owner (or an approver?) posts a comment reading
"Please
Post by Oswald Buddenhagen
retarget <branch>", run your script on the server side. You need
some
Post by Oswald Buddenhagen
sanity test that ensures this branch exists etc...
... which he implemented, and it's deployed now.
for simplicity, only the change owner may issue the command. for other
cases, you still need to go through an admin. the same is advisable for
batch requests, but do as you wish.
I think batch requests should be automated by adding comments via Gerrit's API
(to minimize your distractions)
That's exactly what was done. Or did I misread your comment?

All you need to do is add a comment in gerrit saying: "bot: move to 5.10"
and you're done.

- Orgad
Konstantin Tokarev
2018-01-08 14:00:36 UTC
Permalink
Post by Orgad Shaneh
Post by Konstantin Tokarev
Post by Oswald Buddenhagen
    Either extend the sanity bot, or create a new bot, which listens on
    gerrit's event stream.
    If the change's owner (or an approver?) posts a comment reading "Please
    retarget <branch>", run your script on the server side. You need some
    sanity test that ensures this branch exists etc...
... which he implemented, and it's deployed now.
for simplicity, only the change owner may issue the command. for other
cases, you still need to go through an admin. the same is advisable for
batch requests, but do as you wish.
I think batch requests should be automated by adding comments via Gerrit's API
(to minimize your distractions)
That's exactly what was done. Or did I misread your comment?
All you need to do is add a comment in gerrit saying: "bot: move to 5.10" and you're done.
I mean, there can be additional script on client side, to add this comment to several changes
(if I usderstood "batch request" correctly)
Post by Orgad Shaneh
- Orgad
-- 
Regards,
Konstantin

Loading...