From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 91F4613933E for ; Fri, 9 Jul 2021 15:49:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DA598E0A8F; Fri, 9 Jul 2021 15:49:36 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AE3E5E0A8F for ; Fri, 9 Jul 2021 15:49:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5C3A8342BA8 for ; Fri, 9 Jul 2021 15:49:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E4CBD63F for ; Fri, 9 Jul 2021 15:49:33 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1625845779.c479075032be16a23ebbecf06d5f17bd8881e938.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/db/builds.py buildbot_gentoo_ci/steps/builders.py X-VCS-Directories: buildbot_gentoo_ci/steps/ buildbot_gentoo_ci/db/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: c479075032be16a23ebbecf06d5f17bd8881e938 X-VCS-Branch: master Date: Fri, 9 Jul 2021 15:49:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bff9aca1-495a-4c39-9260-be1a6a7878f0 X-Archives-Hash: cdd0540bab0f71a0c8410b5da0458295 commit: c479075032be16a23ebbecf06d5f17bd8881e938 Author: Magnus Granberg gentoo org> AuthorDate: Fri Jul 9 15:49:39 2021 +0000 Commit: Magnus Granberg gentoo 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 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"))