Ability to run [job-name] when a tag is pushed to Gerrit

Hi, this was discussed loong time ago.. how much effort would it take for oVirt CI infra to support running e.g. [build-artifacts] when a git tag is pushed to Gerrit repo? Imagine the following situation: 1, new tag is pushed -or- existing tag gets updated (force push) 2, CI infra detects the new/updated tag and runs [job-name-here] on the relevant (tagged) commit I'm asking this because in oVirt Dashboard, we're making releases from tagged commits, so we basically: - merge patch that prepares the (stable) branch for release - tag the release-prep patch & push tag to Gerrit - re-trigger [build-artifacts] for the release-prep patch Thanks, Vojtech

On 12 December 2016 at 18:48, Vojtech Szocs <vszocs@redhat.com> wrote:
this was discussed loong time ago.. how much effort would it take for oVirt CI infra to support running e.g. [build-artifacts] when a git tag is pushed to Gerrit repo?
Its just a YAML patch to copy the existing build_artifacts job, give it a new name and change the trigger configuration. But the trigger may be a little tricky, since the Jenkins Gerrit trigger does not have a specific event for tags, instead it has a "Reference updated" event. So we may need to play a little with filtering to ensure this gets called only for tag updates and not for branch updates... I guess you will need our (infra) help, do we have a Jira ticket to track this? -- Barak Korren bkorren@redhat.com RHCE, RHCi, RHV-DevOps Team https://ifireball.wordpress.com/

I've started [1], didn't got time to finish it though, But the idea is to allow anyone who wants to build artifacts from a patch to do so by add comment "ci please build". There is already an open Jira on it [2], though maybe its not exactly the same use case. I was suggestion what you are saying as preparation for automating official builds, but we didn't got around to do it yet, and currently the focus and priority is on oVirt Gating, but if its something simple like [1] we can probably work with developers to add it if it has lot of value. Lets star with [1] and see if it answer some of the existing needs. [1] https://gerrit.ovirt.org/#/c/68017/ [2] https://ovirt-jira.atlassian.net/browse/OVIRT-920 On Mon, Dec 12, 2016 at 7:10 PM, Barak Korren <bkorren@redhat.com> wrote:
On 12 December 2016 at 18:48, Vojtech Szocs <vszocs@redhat.com> wrote:
this was discussed loong time ago.. how much effort would it take for oVirt CI infra to support running e.g. [build-artifacts] when a git tag is pushed to Gerrit repo?
Its just a YAML patch to copy the existing build_artifacts job, give it a new name and change the trigger configuration.
But the trigger may be a little tricky, since the Jenkins Gerrit trigger does not have a specific event for tags, instead it has a "Reference updated" event. So we may need to play a little with filtering to ensure this gets called only for tag updates and not for branch updates...
I guess you will need our (infra) help, do we have a Jira ticket to track this?
-- Barak Korren bkorren@redhat.com RHCE, RHCi, RHV-DevOps Team https://ifireball.wordpress.com/ _______________________________________________ Infra mailing list Infra@ovirt.org http://lists.phx.ovirt.org/mailman/listinfo/infra
-- Eyal Edri Associate Manager RHV DevOps EMEA ENG Virtualization R&D Red Hat Israel phone: +972-9-7692018 irc: eedri (on #tlv #rhev-dev #rhev-integ)

----- Original Message -----
From: "Eyal Edri" <eedri@redhat.com> To: "Barak Korren" <bkorren@redhat.com> Cc: "Vojtech Szocs" <vszocs@redhat.com>, "infra" <infra@ovirt.org> Sent: Monday, December 12, 2016 7:16:44 PM Subject: Re: Ability to run [job-name] when a tag is pushed to Gerrit
I've started [1], didn't got time to finish it though, But the idea is to allow anyone who wants to build artifacts from a patch to do so by add comment "ci please build".
As Barak pointed below, to address my original request, we could have some (e.g. "on-tag-push") job trigger that could be used in job conf. If I'm reading [a] correctly, Jenkins Gerrit trigger (Jenkins plugin) doesn't explicitly support "tag pushed" event, which is strange (?), there is only "Ref Updated" which should include tag pushes. [a] https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger#GerritTrigger-Tri... So if it's not very feasible to implement e.g. "on-tag-push" trigger, I'm OK with [2] - posting Gerrit comment on (already merged & tagged) patch to re-trigger the build-artifacts job.
There is already an open Jira on it [2], though maybe its not exactly the same use case.
I was suggestion what you are saying as preparation for automating official builds, but we didn't got around to do it yet, and currently the focus and priority is on oVirt Gating, but if its something simple like [1] we can probably work with developers to add it if it has lot of value. Lets star with [1] and see if it answer some of the existing needs.
Agreed, +1 on OVIRT-920.
[1] https://gerrit.ovirt.org/#/c/68017/ [2] https://ovirt-jira.atlassian.net/browse/OVIRT-920
On Mon, Dec 12, 2016 at 7:10 PM, Barak Korren <bkorren@redhat.com> wrote:
On 12 December 2016 at 18:48, Vojtech Szocs <vszocs@redhat.com> wrote:
this was discussed loong time ago.. how much effort would it take for oVirt CI infra to support running e.g. [build-artifacts] when a git tag is pushed to Gerrit repo?
Its just a YAML patch to copy the existing build_artifacts job, give it a new name and change the trigger configuration.
But the trigger may be a little tricky, since the Jenkins Gerrit trigger does not have a specific event for tags, instead it has a "Reference updated" event. So we may need to play a little with filtering to ensure this gets called only for tag updates and not for branch updates...
I guess you will need our (infra) help, do we have a Jira ticket to track this?
-- Barak Korren bkorren@redhat.com RHCE, RHCi, RHV-DevOps Team https://ifireball.wordpress.com/ _______________________________________________ Infra mailing list Infra@ovirt.org http://lists.phx.ovirt.org/mailman/listinfo/infra
-- Eyal Edri Associate Manager RHV DevOps EMEA ENG Virtualization R&D Red Hat Israel
phone: +972-9-7692018 irc: eedri (on #tlv #rhev-dev #rhev-integ)

On 14 December 2016 at 19:18, Vojtech Szocs <vszocs@redhat.com> wrote:
If I'm reading [a] correctly, Jenkins Gerrit trigger (Jenkins plugin) doesn't explicitly support "tag pushed" event, which is strange (?), there is only "Ref Updated" which should include tag pushes.
Its not the Gerrit trigger that is at fault here, its just the way the event that Gerrit sends looks like. Which is to mean, Gerrit doesn't have a specific event for tags.
So if it's not very feasible to implement e.g. "on-tag-push" trigger, I'm OK with [2] - posting Gerrit comment on (already merged & tagged) patch to re-trigger the build-artifacts job.
Well, it may be feasible, but we don`t have any pre-existing experience doing that, so it'll take some trial and error to get done right, and perhaps some limitations may need to be in place (For example, on the format that tag string can have, so we can differentiate if from branches). -- Barak Korren bkorren@redhat.com RHCE, RHCi, RHV-DevOps Team https://ifireball.wordpress.com/

----- Original Message -----
From: "Barak Korren" <bkorren@redhat.com> To: "Vojtech Szocs" <vszocs@redhat.com> Cc: "Eyal Edri" <eedri@redhat.com>, "infra" <infra@ovirt.org> Sent: Thursday, December 15, 2016 5:45:54 PM Subject: Re: Ability to run [job-name] when a tag is pushed to Gerrit
On 14 December 2016 at 19:18, Vojtech Szocs <vszocs@redhat.com> wrote:
If I'm reading [a] correctly, Jenkins Gerrit trigger (Jenkins plugin) doesn't explicitly support "tag pushed" event, which is strange (?), there is only "Ref Updated" which should include tag pushes.
Its not the Gerrit trigger that is at fault here, its just the way the event that Gerrit sends looks like. Which is to mean, Gerrit doesn't have a specific event for tags.
Right, Jenkins Gerrit trigger just listens to events published through Gerrit's event stream.
So if it's not very feasible to implement e.g. "on-tag-push" trigger, I'm OK with [2] - posting Gerrit comment on (already merged & tagged) patch to re-trigger the build-artifacts job.
Well, it may be feasible, but we don`t have any pre-existing experience doing that, so it'll take some trial and error to get done right, and perhaps some limitations may need to be in place (For example, on the format that tag string can have, so we can differentiate if from branches).
Ideally, one could specify tag name prefix in Jenkins job YAML :-) Also, found this: http://stackoverflow.com/a/21605984 I'm also OK with what Eyal proposed: manually triggering the build job [build-artifacts] by posting a comment on Gerrit web.
-- Barak Korren bkorren@redhat.com RHCE, RHCi, RHV-DevOps Team https://ifireball.wordpress.com/
participants (3)
-
Barak Korren
-
Eyal Edri
-
Vojtech Szocs