Ticket #1928 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Add current directory to sys.path for checkConfig

Reported by: dabrahams Owned by:
Priority: major Milestone: 0.8.4
Version: 0.8.3p1 Keywords:
Cc: bhearsum

Description

Since you don't copy directories, this would at least make the code in submodules available.

Change History

comment:1 Changed 2 years ago by dustin

  • Cc bhearsum added
  • Milestone changed from undecided to 0.8.4

This sounds like a good idea, but I'm not clear why checkconfig copies the files at all. Ben, do you remember from way back in 2008?

comment:2 Changed 2 years ago by dabrahams

The comment at that point in the code is pretty clear on why it copies, I think. It makes modifications in that directory.

I believe when you tell buildbot to reconfig it does a checkconfig first and if that fails, it keeps running as-is. I don't think you can do that if you let checkConfig stomp on the directory.

I always wanted to be able to check in my buildbot config and maintain a clean directory w.r.t. VCS, but I suppose that's a different feature request… though implementing it might be enough to eliminate the need for copying on checkconfig

comment:3 Changed 2 years ago by dustin

We keep the metabbotcfg in VC:  https://github.com/buildbot/metabbotcfg, so that's practical already.

Your sys.path suggestion seems like a good on - at any rate, it's not terribly intrusive. I think the better fix would be to not create builder directories; I don't see a problem with creating .pyc files.

comment:4 Changed 2 years ago by dabrahams

I think you misunderstood the comment about VCSes; I'm using Git too, of course! The problem I'm citing is that the working copy that gets checked out on the master is polluted by buildbot droppings. It's not a big deal until you are trying to make something work, start making local changes on the server, and then want to check in. At those times, seeing those other files can be a pain. Magit, for example, lists all of the builder directory files as untracked.

comment:5 Changed 2 years ago by dustin

Take a look at how the metabbotcfg repository is set up - it's a subdirectory of the master directory, so it doesn't get polluted.

comment:6 Changed 2 years ago by dabrahams

I am under the (mis?)impression that the master directory is defined by the location of the master.cfg file. Is that incorrect? If so, the only way to do what you're talking about would be with a symlink. I'm obviously missing something, so could you tell me which files to look in?

comment:7 Changed 2 years ago by dustin

That's exactly it - master.cfg is a symlink to metabbotcfg/master.cfg. I thought that was in the README, but it's not :)

comment:8 Changed 2 years ago by Dustin J. Mitchell

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

include basedir in sys.path during checkconfig

This eliminates the need to copy all of the files in the configuration directory into a temporary directory. Fixes #1928.

Changeset: e2d9ba79dd2d205d26ad6018d8d97d53a8e28d92

Note: See TracTickets for help on using tickets.