Ticket #341 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

FileUpload: automatically create target directory

Reported by: gward Owned by:
Priority: major Milestone: 0.7.9
Version: 0.7.8 Keywords:
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 Download (621 bytes) - added by gward 5 years ago.
Patch to implement this feature (from mailing list; untested by me)
341-filedownload.patch Download (1.3 KB) - added by dustin 5 years ago.
good point; might as well make FileDownload? do the same thing

Change History

Changed 5 years ago by gward

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

comment:1 Changed 5 years ago by dustin

  • Keywords review added

comment:2 Changed 5 years ago by dustin

  • Keywords review, devtree added; review removed
  • 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@…> 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.

comment:3 Changed 5 years ago 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.

comment:4 Changed 5 years ago 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

Changed 5 years ago by dustin

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

comment:5 Changed 5 years ago by warner

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

comment:6 Changed 5 years ago by warner

  • Status changed from new to closed
  • Resolution set to fixed

released, in buildbot-0.7.9

comment:7 Changed 4 years ago by dustin

  • Keywords review, devtree removed
Note: See TracTickets for help on using tickets.