1 |
commit: c479075032be16a23ebbecf06d5f17bd8881e938 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 9 15:49:39 2021 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 9 15:49:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=c4790750 |
7 |
|
8 |
Move setting of project_build_data |
9 |
|
10 |
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org> |
11 |
|
12 |
buildbot_gentoo_ci/db/builds.py | 1 - |
13 |
buildbot_gentoo_ci/steps/builders.py | 30 ++++++++++++++++-------------- |
14 |
2 files changed, 16 insertions(+), 15 deletions(-) |
15 |
|
16 |
diff --git a/buildbot_gentoo_ci/db/builds.py b/buildbot_gentoo_ci/db/builds.py |
17 |
index 2ad67b8..2cd52bc 100644 |
18 |
--- a/buildbot_gentoo_ci/db/builds.py |
19 |
+++ b/buildbot_gentoo_ci/db/builds.py |
20 |
@@ -40,7 +40,6 @@ class BuildsConnectorComponent(base.DBConnectorComponent): |
21 |
q = tbl.insert() |
22 |
r = conn.execute(q, dict(project_uuid=project_build_data['project_uuid'], |
23 |
version_uuid=project_build_data['version_uuid'], |
24 |
- buildbot_build_id=project_build_data['buildbot_build_id'], |
25 |
status=project_build_data['status'], |
26 |
requested=project_build_data['requested'], |
27 |
created_at=created_at, |
28 |
|
29 |
diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py |
30 |
index 0bed647..63a1ae9 100644 |
31 |
--- a/buildbot_gentoo_ci/steps/builders.py |
32 |
+++ b/buildbot_gentoo_ci/steps/builders.py |
33 |
@@ -189,6 +189,17 @@ class TriggerRunBuildRequest(BuildStep): |
34 |
|
35 |
@defer.inlineCallbacks |
36 |
def run(self): |
37 |
+ self.gentooci = self.master.namedServices['services'].namedServices['gentooci'] |
38 |
+ if self.getProperty('project_build_data') is None: |
39 |
+ project_build_data = {} |
40 |
+ project_build_data['project_uuid'] = self.getProperty('project_data')['uuid'] |
41 |
+ project_build_data['version_uuid'] = self.getProperty("version_data")['uuid'] |
42 |
+ project_build_data['status'] = 'waiting' |
43 |
+ project_build_data['requested'] = False |
44 |
+ project_build_data['id'], project_build_data['build_id'] = yield self.gentooci.db.builds.addBuild( |
45 |
+ project_build_data) |
46 |
+ else: |
47 |
+ project_build_data = self.getProperty('project_build_data') |
48 |
yield self.build.addStepsAfterCurrentStep([ |
49 |
steps.Trigger( |
50 |
schedulerNames=['run_build_request'], |
51 |
@@ -200,7 +211,7 @@ class TriggerRunBuildRequest(BuildStep): |
52 |
'projectrepository_data' : self.getProperty('projectrepository_data'), |
53 |
'use_data' : self.getProperty("use_data"), |
54 |
'fullcheck' : self.getProperty("fullcheck"), |
55 |
- 'project_build_data' : None |
56 |
+ 'project_build_data' : project_build_data |
57 |
} |
58 |
)]) |
59 |
return SUCCESS |
60 |
@@ -233,6 +244,7 @@ class GetProjectRepositoryData(BuildStep): |
61 |
# set Property projectrepository_data so we can use it in the trigger |
62 |
self.setProperty('projectrepository_data', projectrepository_data, 'projectrepository_data') |
63 |
self.setProperty('use_data', None, 'use_data') |
64 |
+ self.setProperty('project_data', project_data, 'project_data') |
65 |
# get name o project keyword |
66 |
project_keyword_data = yield self.gentooci.db.keywords.getKeywordById(project_data['keyword_id']) |
67 |
# if not * (all keywords) |
68 |
@@ -280,22 +292,12 @@ class SetupPropertys(BuildStep): |
69 |
self.setProperty('faild_version_data', None, 'faild_version_data') |
70 |
self.setProperty('rerun', 0, 'rerun') |
71 |
print(self.getProperty("buildnumber")) |
72 |
- if self.getProperty('project_build_data') is None: |
73 |
- project_build_data = {} |
74 |
- project_build_data['project_uuid'] = project_data['uuid'] |
75 |
- project_build_data['version_uuid'] = self.getProperty("version_data")['uuid'] |
76 |
- project_build_data['status'] = 'in-progress' |
77 |
- project_build_data['requested'] = False |
78 |
- project_build_data['buildbot_build_id'] = self.getProperty("buildnumber") |
79 |
- project_build_data['id'], project_build_data['build_id'] = yield self.gentooci.db.builds.addBuild( |
80 |
- project_build_data) |
81 |
- else: |
82 |
- project_build_data = self.getProperty('project_build_data') |
83 |
- yield self.gentooci.db.builds.setSatusBuilds( |
84 |
+ project_build_data = self.getProperty('project_build_data') |
85 |
+ yield self.gentooci.db.builds.setSatusBuilds( |
86 |
project_build_data['build_id'], |
87 |
project_build_data['project_uuid'], |
88 |
'in-progress') |
89 |
- yield self.gentooci.db.builds.setBuildbotBuildIdBuilds( |
90 |
+ yield self.gentooci.db.builds.setBuildbotBuildIdBuilds( |
91 |
project_build_data['build_id'], |
92 |
project_build_data['project_uuid'], |
93 |
self.getProperty("buildnumber")) |