Merge lp:~gesha/linaro-license-protection/remove-artifacts-from-upload into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Georgy Redkozubov
Status: Merged
Merged at revision: 157
Proposed branch: lp:~gesha/linaro-license-protection/remove-artifacts-from-upload
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 35 lines (+7/-3)
2 files modified
scripts/publish_to_snapshots.py (+5/-1)
tests/test_publish_to_snapshots.py (+2/-2)
To merge this branch: bzr merge lp:~gesha/linaro-license-protection/remove-artifacts-from-upload
Reviewer Review Type Date Requested Status
Paul Sokolovsky Approve
Review via email: mp+145580@code.launchpad.net

Description of the change

If BUILD-INFO.txt is not present among artifacts being published, we don't publish them. To avoid possible artifacts leakage with this branch we remove unpublished artifacts from upload dir.

To post a comment you must log in.
Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

<pfalcon> gesha: I wanted to ask before, what kind of error reporting this gets back to the user? Will jenkins job which does publishing for example will get something into its build log?
<pfalcon> gesha: because otherwise I may suggest for example instead of just removing all files and publishing nothing, publish a text file saying "nothing was published because of lack of BUILDINFO.txt, please add it"
<gesha> pfalcon, right now it shows only "BUILD-INFO.txt is not present in artifacts being published" but add info about nothing published is a good idea
<gesha> will add

159. By Georgy Redkozubov

Notify user that nothing was published

Revision history for this message
Georgy Redkozubov (gesha) wrote :

Added user notification.

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2013-01-29 16:08:02 +0000
3+++ scripts/publish_to_snapshots.py 2013-01-30 11:31:21 +0000
4@@ -397,7 +397,11 @@
5 return FAIL
6 ret = publisher.check_buildinfo(build_dir_path)
7 if ret != PASS:
8- print "BUILD-INFO.txt is not present in artifacts being published"
9+ print "BUILD-INFO.txt is not present in build."
10+ print "WARNING: Nothing was published because BUILD-INFO.txt is absent."
11+ # Remove artifacts from upload dir
12+ if os.path.isdir(build_dir_path):
13+ shutil.rmtree(build_dir_path)
14 return FAIL
15 ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)
16 if ret != PASS:
17
18=== modified file 'tests/test_publish_to_snapshots.py'
19--- tests/test_publish_to_snapshots.py 2013-01-29 16:08:02 +0000
20+++ tests/test_publish_to_snapshots.py 2013-01-30 11:31:21 +0000
21@@ -744,7 +744,7 @@
22 file = open(file_name, "w")
23 file.close()
24
25- self.assertEqual(PASS, self.publisher.check_buildinfo(build_dir))
26+ self.assertEqual(PASS, self.publisher.check_buildinfo(build_path))
27
28 def test_check_buildinfo_no_file(self):
29 self.publisher = SnapshotsPublisher()
30@@ -756,4 +756,4 @@
31 build_path = os.path.join(self.uploads_path, build_dir)
32 os.makedirs(build_path)
33
34- self.assertEqual(FAIL, self.publisher.check_buildinfo(build_dir))
35+ self.assertEqual(FAIL, self.publisher.check_buildinfo(build_path))

Subscribers

People subscribed via source and target branches