public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/
Date: Fri,  9 Jul 2021 15:49:33 +0000 (UTC)	[thread overview]
Message-ID: <1625845779.c479075032be16a23ebbecf06d5f17bd8881e938.zorry@gentoo> (raw)

commit:     c479075032be16a23ebbecf06d5f17bd8881e938
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  9 15:49:39 2021 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Fri Jul  9 15:49:39 2021 +0000
URL:        https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=c4790750

Move setting of project_build_data

Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>

 buildbot_gentoo_ci/db/builds.py      |  1 -
 buildbot_gentoo_ci/steps/builders.py | 30 ++++++++++++++++--------------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/buildbot_gentoo_ci/db/builds.py b/buildbot_gentoo_ci/db/builds.py
index 2ad67b8..2cd52bc 100644
--- a/buildbot_gentoo_ci/db/builds.py
+++ b/buildbot_gentoo_ci/db/builds.py
@@ -40,7 +40,6 @@ class BuildsConnectorComponent(base.DBConnectorComponent):
                 q = tbl.insert()
                 r = conn.execute(q, dict(project_uuid=project_build_data['project_uuid'],
                                          version_uuid=project_build_data['version_uuid'],
-                                         buildbot_build_id=project_build_data['buildbot_build_id'],
                                          status=project_build_data['status'],
                                          requested=project_build_data['requested'],
                                          created_at=created_at,

diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py
index 0bed647..63a1ae9 100644
--- a/buildbot_gentoo_ci/steps/builders.py
+++ b/buildbot_gentoo_ci/steps/builders.py
@@ -189,6 +189,17 @@ class TriggerRunBuildRequest(BuildStep):
 
     @defer.inlineCallbacks
     def run(self):
+        self.gentooci = self.master.namedServices['services'].namedServices['gentooci']
+        if self.getProperty('project_build_data') is None:
+            project_build_data = {}
+            project_build_data['project_uuid'] = self.getProperty('project_data')['uuid']
+            project_build_data['version_uuid'] = self.getProperty("version_data")['uuid']
+            project_build_data['status'] = 'waiting'
+            project_build_data['requested'] = False
+            project_build_data['id'], project_build_data['build_id'] = yield self.gentooci.db.builds.addBuild(
+                                                                                            project_build_data)
+        else:
+            project_build_data = self.getProperty('project_build_data')
         yield self.build.addStepsAfterCurrentStep([
                 steps.Trigger(
                     schedulerNames=['run_build_request'],
@@ -200,7 +211,7 @@ class TriggerRunBuildRequest(BuildStep):
                             'projectrepository_data' : self.getProperty('projectrepository_data'),
                             'use_data' : self.getProperty("use_data"),
                             'fullcheck' : self.getProperty("fullcheck"),
-                            'project_build_data' : None
+                            'project_build_data' : project_build_data
                         }
                 )])
         return SUCCESS
@@ -233,6 +244,7 @@ class GetProjectRepositoryData(BuildStep):
                 # set Property projectrepository_data so we can use it in the trigger
                 self.setProperty('projectrepository_data', projectrepository_data, 'projectrepository_data')
                 self.setProperty('use_data', None, 'use_data')
+                self.setProperty('project_data', project_data, 'project_data')
                 # get name o project keyword
                 project_keyword_data = yield self.gentooci.db.keywords.getKeywordById(project_data['keyword_id'])
                 # if not * (all keywords)
@@ -280,22 +292,12 @@ class SetupPropertys(BuildStep):
         self.setProperty('faild_version_data', None, 'faild_version_data')
         self.setProperty('rerun', 0, 'rerun')
         print(self.getProperty("buildnumber"))
-        if self.getProperty('project_build_data') is None:
-            project_build_data = {}
-            project_build_data['project_uuid'] = project_data['uuid']
-            project_build_data['version_uuid'] = self.getProperty("version_data")['uuid']
-            project_build_data['status'] = 'in-progress'
-            project_build_data['requested'] = False
-            project_build_data['buildbot_build_id'] = self.getProperty("buildnumber")
-            project_build_data['id'], project_build_data['build_id'] = yield self.gentooci.db.builds.addBuild(
-                                                                                            project_build_data)
-        else:
-            project_build_data = self.getProperty('project_build_data')
-            yield self.gentooci.db.builds.setSatusBuilds(
+        project_build_data = self.getProperty('project_build_data')
+        yield self.gentooci.db.builds.setSatusBuilds(
                                                     project_build_data['build_id'],
                                                     project_build_data['project_uuid'],
                                                     'in-progress')
-            yield self.gentooci.db.builds.setBuildbotBuildIdBuilds(
+        yield self.gentooci.db.builds.setBuildbotBuildIdBuilds(
                                                     project_build_data['build_id'],
                                                     project_build_data['project_uuid'],
                                                     self.getProperty("buildnumber"))


             reply	other threads:[~2021-07-09 15:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 15:49 Magnus Granberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-25 11:46 [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/ Magnus Granberg
2021-09-20 23:28 Magnus Granberg
2021-04-13 14:24 Magnus Granberg
2021-04-10  1:03 Magnus Granberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1625845779.c479075032be16a23ebbecf06d5f17bd8881e938.zorry@gentoo \
    --to=zorry@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox