Ticket #341 (closed enhancement: fixed)

Opened 3 months ago

Last modified 2 months ago

FileUpload: automatically create target directory

Reported by: gward Assigned to:
Priority: major Milestone: 0.7.9
Component: buildprocess Version: 0.7.8
Keywords: review, devtree Cc:

Description

From a message on the buildbot-devel mailing list:

I am using buildbot and I wish to ship files from the slave to distinct dir on the master depending on the current date eg.

f.addStep(FileUpload(
  slavesrc="~//releases_ui_tests_3.2_branch/summary_reports.log",
  masterdest="~/summary_logs/2008-08-26/summary_reports.log"))

As can be seen on the master the 2008-08-26 part of the path changes every day...

Is there any way, via buildbot, I can have the buildmaster automatically create these dir so the FileUpload? command can succeed (as the dir for the next day i.e 2008-08-27 does not exist on the master)

Attachments

buildbot-ticket-341.patch (0.6 kB) - added by gward on 08/28/08 10:03:35.
Patch to implement this feature (from mailing list; untested by me)
341-filedownload.patch (1.3 kB) - added by dustin on 08/30/08 16:08:09.
good point; might as well make FileDownload? do the same thing

Change History

08/28/08 10:03:35 changed by gward

  • attachment buildbot-ticket-341.patch added.

Patch to implement this feature (from mailing list; untested by me)

08/30/08 13:18:20 changed by dustin

  • keywords set to review.

08/30/08 14:17:00 changed by dustin

  • keywords changed from review to review, devtree.
  • milestone changed from undecided to 0.7.9.

Looks good. I made one modification, changing os.path.isdir to os.path.exists -- that way we won't try to mkdirs if there is a file of the same name. Ted Zlatanov <tzz@lifelogs.com> suggested this.

http://repo.or.cz/w/buildbot.git?a=shortlog;h=refs/remotes/dustin/bug341

This has no tests, but FileUpload? in general has no tests, so I'm inclined to just take it.

08/30/08 14:53:35 changed by dustin

I also added a line to make the filename absolute first -- this fixes the case where the filename is unqualified (e.g., "test.diff"), which happens to be tickled by the unit tests.

08/30/08 15:08:29 changed by jimmyj_in

We will also have to update the buildbot manual for this change.

Section 6.1.7, the last line reads as:

"Remember that neither of these commands will create missing directories for you."

We will have to update this to indicate that FileUpload? will now create directories if they do not exist.

Thanks

Jimmy

08/30/08 16:08:09 changed by dustin

  • attachment 341-filedownload.patch added.

good point; might as well make FileDownload? do the same thing

09/03/08 15:22:51 changed by warner

this pair of patches looks good to me.. dustin, go ahead and push

09/16/08 11:54:11 changed by warner

  • status changed from new to closed.
  • resolution set to fixed.

released, in buildbot-0.7.9