sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
Sophie ([personal profile] sophie) wrote in [site community profile] dw_dev2013-06-26 03:47 pm

Dreamhack reinstallation dilemma

As most people here will know, I'm the maintainer of the Dreamhacks service which allows you to have a Dreamwidth development environment quickly and easily.

Some people will also know that lately the reinstallation script hasn't been working for some time. It's been broken ever since the move to git and GitHub, and I recently put a check in there so that anybody trying to use it won't accidentally end up with an unuseable 'hack. (By the way, if anybody does have an unuseable 'hack because of this, please feel free to let me know and I'll gladly reinstall you by hand!)

Although it should be fairly easy to get the reinstaller script working again, I've been running into some issues that I'm not entirely sure how to address. If you have a Dreamhack account, please read inside the cut as this could quite possibly affect you.



The point of the reinstaller script back in the Mercurial days was so that if you end up with a 'hack that you didn't know how to fix, it would be possible to easily get back to a working state by reinstalling your Dreamhack account as if you were a completely new user, without you having to worry about bothering anybody. You'd lose your work in the process unless you had backed it up, but you'd be pretty much guaranteed a working 'hack and being able to get back to somewhere you knew. A lot of people used it and I've heard from a lot of people that it was really helpful.

It worked because the previous setup procedure for Dreamhacks meant getting a completely fresh copy of the code straight from the official repository, so unless any bugs had been committed into the official codebase, it would be guaranteed to work as expected.

However, this isn't the case any more - the setup process for Dreamhacks now involves forking the official repository and setting up the Dreamhack to pull from that repository instead. As a result, if you've already pushed the commits that broke your Dreamhack to your own repository, a reinstall wouldn't help because it'd just pull the broken commits straight back down. It may not even fix a broken repository, depending on the situation; all in all, there's no guarantee any more that the reinstall process would get you to a known state any more. It would all depend on what you had pushed to the repo before you reinstalled.

I have an idea for how this might be fixable, but it would require a fair amount of code on my part and I want to be sure that it's worth it, so I thought I'd come to you guys for ideas!

My own idea involves something I've been planning for a while anyway - the ability to link Dreamhack SSH accounts with GitHub via OAuth. It would take some work, but with this in place it would be possible to have a reinstallation process that could (after making VERY clear what it would do) delete your dw-free/dw-nonfree repositories on GitHub and re-fork them automatically, either as part of the process or (more likely) as a separate script which you could run beforehand. The reinstallation could then proceed using these newly re-forked repositories, and the end result would be almost exactly the same as what you would have had under the old script - code that comes straight from the horse's mouth, as it were, and an almost-sure guarantee that you would get a working 'hack out of it, bar any bugs in the official codebase.

It's probable that something like this would be best implemented as two scripts - the reinstallation script as it is right now (or at least as it would be if it were working) that uses your current GitHub repositories, and a script you could run beforehand if you wanted to to do the deleting/re-forking. I think this would be the best way, personally, because the main reason to have the reinstall process is to make it quick, easy, and not require many spoons. While having two commands to run does take some more spoons, I believe that it's worth it to stop people from accidentally wiping out all their work (since people wouldn't normally expect a reinstallation on the Dreamhack machine to affect GitHub).

However, these are just my ideas. It's quite possible that people here have better ideas, and that's why I'm here. Do you have any ideas about how the reinstallation script should work? Is the process I've outlined too easy to accidentally activate, too difficult to work with, or something else? Things like that. The Dreamhack machine is your resource and I want to make it as easy as I can to hack on the code while not getting in your way. How can I do that in this case?
chebe: (Default)

[personal profile] chebe 2013-08-23 07:48 am (UTC)(link)
Ah yes, perfect. Thanks again. Maybe just add a line to Version Control saying you should be in $LJHOME?