public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-prometheus/files/, dev-util/buildbot-prometheus/
@ 2018-03-13 23:56 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2018-03-13 23:56 UTC (permalink / raw
  To: gentoo-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 6345 bytes --]

commit:     c63f7c6af40310a9043d089a4886b6defc4793bd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  6 03:50:35 2018 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Mar 13 23:56:27 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c63f7c6a

dev-util/buildbot-prometheus: Revision bump, patch for >=buildbot-0.9.0

Adjust buildbot dep accordingly

Package-Manager: Portage-2.3.13, Repoman-2.3.3

 .../buildbot-prometheus-17.7.2-r1.ebuild           |  4 ++
 ...ebuild => buildbot-prometheus-17.7.2-r2.ebuild} | 11 ++++-
 ...rate-duration-calculations-to-buildbot-09.patch | 52 ++++++++++++++++++++++
 dev-util/buildbot-prometheus/metadata.xml          |  4 ++
 4 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild b/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild
index a930624175f..f6c6bd792ce 100644
--- a/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild
+++ b/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild
@@ -20,6 +20,10 @@ RDEPEND="dev-python/prometheus_client[${PYTHON_USEDEP}]
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
 	${RDEPEND}"
 
+PATCHES=(
+	"$FILESDIR}/buildbot-prometheus-17.7.2-Migrate-duration-calculations-to-buildbot-09.patch"
+)
+
 python_prepare_all() {
 	sed -i -e "/^install_reqs.*$/d" -e "/^from pip.*$/d" -e "s/requires = .*/requires = ['buildbot', 'prometheus_client']/" setup.py || die
 	distutils-r1_python_prepare_all

diff --git a/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild b/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r2.ebuild
similarity index 66%
copy from dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild
copy to dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r2.ebuild
index a930624175f..67323d1dbef 100644
--- a/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r1.ebuild
+++ b/dev-util/buildbot-prometheus/buildbot-prometheus-17.7.2-r2.ebuild
@@ -16,11 +16,20 @@ KEYWORDS="~amd64"
 IUSE=""
 
 RDEPEND="dev-python/prometheus_client[${PYTHON_USEDEP}]
-	dev-util/buildbot[${PYTHON_USEDEP}]"
+	>=dev-util/buildbot-0.9.0[${PYTHON_USEDEP}]"
 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
 	${RDEPEND}"
 
+PATCHES=(
+	"${FILESDIR}/buildbot-prometheus-17.7.2-Migrate-duration-calculations-to-buildbot-09.patch"
+)
+
 python_prepare_all() {
 	sed -i -e "/^install_reqs.*$/d" -e "/^from pip.*$/d" -e "s/requires = .*/requires = ['buildbot', 'prometheus_client']/" setup.py || die
 	distutils-r1_python_prepare_all
 }
+
+pkg_postinst() {
+	einfo "This version has been patched to be compatible with the current buildbot releases >=0.9.0"
+	einfo "For older buildbot-0.8* releases, please use dev-python/buildbot-prometheus-17.7.2-r1 version"
+}

diff --git a/dev-util/buildbot-prometheus/files/buildbot-prometheus-17.7.2-Migrate-duration-calculations-to-buildbot-09.patch b/dev-util/buildbot-prometheus/files/buildbot-prometheus-17.7.2-Migrate-duration-calculations-to-buildbot-09.patch
new file mode 100644
index 00000000000..0ba69478ac7
--- /dev/null
+++ b/dev-util/buildbot-prometheus/files/buildbot-prometheus-17.7.2-Migrate-duration-calculations-to-buildbot-09.patch
@@ -0,0 +1,52 @@
+From ceddea3f55773e104c628ef6316ce74785d235f3 Mon Sep 17 00:00:00 2001
+From: °R\x04Ó¨\x7f < _â\x03>
+Date: Tue, 6 Mar 2018 02:30:56 +0000
+Subject: [PATCH] Migrate duration calculations to >=buildbot-0.9
+
+---
+ buildbot_prometheus/prometheus.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/buildbot_prometheus/prometheus.py b/buildbot_prometheus/prometheus.py
+index a766f41..ebf41a1 100644
+--- a/buildbot_prometheus/prometheus.py
++++ b/buildbot_prometheus/prometheus.py
+@@ -302,7 +302,7 @@ class Prometheus(service.BuildbotService):
+             build_started = msg['started_at']
+             build_finished = msg['complete_at']
+             build_duration = build_finished - build_started
+-            duration_seconds = build_duration.total_seconds()
++            duration_seconds = build_duration
+             self.g_builds_duration.labels(**labels).set(duration_seconds)
+ 
+             build_status = resolve_results_status(msg['results'])
+@@ -401,7 +401,7 @@ class Prometheus(service.BuildbotService):
+             buildset_started = msg['submitted_at']
+             buildset_finished = msg['complete_at']
+             buildset_duration = buildset_finished - buildset_started
+-            duration_seconds = buildset_duration.total_seconds()
++            duration_seconds = buildset_duration
+             self.g_buildsets_duration.labels(**labels).set(duration_seconds)
+ 
+             bs_success = resolve_results_status(msg['results'])
+@@ -444,7 +444,7 @@ class Prometheus(service.BuildbotService):
+             br_started = msg['submitted_at']
+             br_finished = msg['complete_at']
+             br_duration = br_finished - br_started
+-            duration_seconds = br_duration.total_seconds()
++            duration_seconds = br_duration
+             self.g_build_requests_duration.labels(**labels).set(duration_seconds)
+ 
+             br_success = resolve_results_status(msg['results'])
+@@ -491,7 +491,7 @@ class Prometheus(service.BuildbotService):
+             step_started = msg['started_at']
+             step_finished = msg['complete_at']
+             step_duration = step_finished - step_started
+-            duration_seconds = step_duration.total_seconds()
++            duration_seconds = step_duration
+             self.g_steps_duration.labels(**labels).set(duration_seconds)
+ 
+             step_success = resolve_results_status(msg['results'])
+--
+libgit2 0.24.6
+

diff --git a/dev-util/buildbot-prometheus/metadata.xml b/dev-util/buildbot-prometheus/metadata.xml
index 688a3484930..81ebfb154a1 100644
--- a/dev-util/buildbot-prometheus/metadata.xml
+++ b/dev-util/buildbot-prometheus/metadata.xml
@@ -5,6 +5,10 @@
 		<email>mrueg@gentoo.org</email>
 		<name>Manuel Rüger</name>
 	</maintainer>
+	<maintainer type="person">
+		<email>dolsen@gentoo.org</email>
+		<name>Brian Dolbec</name>
+	</maintainer>
 	<upstream>
 		<remote-id type="pypi">buildbot-prometheus</remote-id>
 		<remote-id type="github">claws/buildbot-prometheus</remote-id>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-13 23:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-13 23:56 [gentoo-commits] repo/gentoo:master commit in: dev-util/buildbot-prometheus/files/, dev-util/buildbot-prometheus/ Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox