1 |
commit: e01a8423d8cc9371320ea0016107d13c3a7dd991 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 29 00:33:07 2021 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 29 00:33:07 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=e01a8423 |
7 |
|
8 |
Change code in TriggerCheckForCPV for trigging |
9 |
|
10 |
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org> |
11 |
|
12 |
buildbot_gentoo_ci/steps/update_db.py | 50 +++++++++++++++++------------------ |
13 |
1 file changed, 25 insertions(+), 25 deletions(-) |
14 |
|
15 |
diff --git a/buildbot_gentoo_ci/steps/update_db.py b/buildbot_gentoo_ci/steps/update_db.py |
16 |
index d35a967..b84e256 100644 |
17 |
--- a/buildbot_gentoo_ci/steps/update_db.py |
18 |
+++ b/buildbot_gentoo_ci/steps/update_db.py |
19 |
@@ -181,40 +181,40 @@ class TriggerCheckForCPV(BuildStep): |
20 |
# check if git_change is a string or a list |
21 |
if not isinstance(self.git_changes, list): |
22 |
return FAILURE |
23 |
- self.success = True |
24 |
addStepUpdateCPVData = [] |
25 |
for change_data in self.git_changes: |
26 |
# make a trigger for all cpv in the list |
27 |
for cpv in change_data['cpvs']: |
28 |
+ self.success = True |
29 |
+ if change_data['repository'] != self.getProperty("repository_data")['name']: |
30 |
+ log.msg("%s don't match" % change_data['repository']) |
31 |
+ self.success = False |
32 |
+ # Trigger cpv builds and update db if we are working with ebuilds |
33 |
# check that cpv is valied |
34 |
if catpkgsplit(cpv) is None: |
35 |
log.msg("%s is not vaild package name" % cpv) |
36 |
self.success = False |
37 |
- else: |
38 |
- if change_data['repository'] != self.getProperty("repository_data")['name']: |
39 |
- log.msg("%s don't match" % change_data['repository']) |
40 |
- self.success = False |
41 |
- else: |
42 |
- revision_data = {} |
43 |
- revision_data['author'] = change_data['author'] |
44 |
- revision_data['committer'] = change_data['committer'] |
45 |
- revision_data['comments'] = change_data['comments'] |
46 |
- revision_data['revision'] = change_data['revision'] |
47 |
- # call update_cpv_data |
48 |
- addStepUpdateCPVData.append( |
49 |
- steps.Trigger( |
50 |
- schedulerNames=['update_cpv_data'], |
51 |
- waitForFinish=False, |
52 |
- updateSourceStamp=False, |
53 |
- set_properties={ |
54 |
- 'cpv' : cpv, |
55 |
- 'project_data' : self.getProperty("project_data"), |
56 |
- 'repository_data' : self.getProperty("repository_data"), |
57 |
- 'revision_data' : revision_data, |
58 |
- } |
59 |
- ) |
60 |
+ if self.success: |
61 |
+ revision_data = {} |
62 |
+ revision_data['author'] = change_data['author'] |
63 |
+ revision_data['committer'] = change_data['committer'] |
64 |
+ revision_data['comments'] = change_data['comments'] |
65 |
+ revision_data['revision'] = change_data['revision'] |
66 |
+ addStepUpdateCPVData.append( |
67 |
+ steps.Trigger( |
68 |
+ schedulerNames=['update_cpv_data'], |
69 |
+ waitForFinish=False, |
70 |
+ updateSourceStamp=False, |
71 |
+ set_properties={ |
72 |
+ 'cpv' : cpv, |
73 |
+ 'project_data' : self.getProperty("project_data"), |
74 |
+ 'repository_data' : self.getProperty("repository_data"), |
75 |
+ 'revision_data' : revision_data, |
76 |
+ } |
77 |
) |
78 |
- yield self.build.addStepsAfterCurrentStep(addStepUpdateCPVData) |
79 |
+ ) |
80 |
+ print(addStepUpdateCPVData) |
81 |
+ yield self.build.addStepsAfterCurrentStep(addStepUpdateCPVData) |
82 |
if self.success is False: |
83 |
return FAILURE |
84 |
return SUCCESS |