Newbie Guide for Windows People Working on Minor Bugs

= Install and Set Things Up =

This may seem like a lot of things to do before you can really get started, things you're probably not familiar with but 1) you can do it 2) you'll only have to do this once.

Get a Dreamhack
What's a Dreamhack? To put it simply, it's an online mirror of the Dreamwidth site which is set up for any developer, beginner or experienced, who asks for it. This way, you don't have to go through the complicated process of installing the Dreamwidth code on your computer.


 * Apply for a Dreamhack by filling this form. The two important fields are 'Your Desired Username' and 'Your email address'. Note that your username is the name you'll use to log in to your Dreamhack; it's not the name of your account over there so no need to agonize over it. ;) Your e-mail address is used to send you a welcome e-mail which contains important information as well as maintenance/issue alerts and reinstall e-mails if you need to reinstall so it does matter. Also, some people like having an e-mail account specifically devoted to development. It's up to you.


 * Once you're done, you should get an e-mail with your login username and a password. Don't lose it. Once you've gotten this e-mail, you need to install two programs to be able to manage your Dreamhack: PuTTY and WinSCP.

Install PuTTY
What for? PuTTY will allow you to start and stop your Dreamhack, update it when changes are made (either by you or other developers) and generate patches.


 * Download PuTTY - choose the 'Windows installer for everything except PuTTYtel' .exe file - and install it.


 * Run PuTTY. In the configuration window, enter "hack.dreamwidth.net" for the host name. Go to Connection/Data and enter the username/login given to you in the welcome e-mail. It should be something like dh-username.


 * Click on Open. If you get a pop-up message about a key, click Yes.


 * Enter the password given to you in the welcome e-mail when asked. Note that no characters are displayed and the cursor won't move. It's normal.


 * Change your password by typing:


 * And that's it for now. :)

Install WinSCP
What for? WinSCP will allow you to browse and edit your Dreamhack files.


 * Install WinSCP. During the installation, you may be asked about the mode you prefer: Commander and Explorer. Commander works like an FTP client: a partitioned window with your computer files on one side and the Dreamhack files on the other. Explorer will only display your Dreamhack files and works like Windows's Explorer. I prefer this mode because I don't need to access any files on my computer but choose what's best for you.


 * Use "hack.dreamwidth.net" for the host name. Enter your username and password (the new one!). Click on Save then on Login.

Protect Your Config Files

 * Follow the steps outlined at Back Up Your Configs. This will make sure you always have clean copies of your config files in /config-backup.


 * In PuTTY, copy paste the code given to you in the box.


 * Follow the steps outlined at Protect your configs from updates. This will create new folders with copies of your config files so that you can safely edit them.


 * In PuTTY, copy paste the code given to you.
 * In WinSCP, go to.
 * In the right-sided window, right-click and select New/File. Call it . Type the code given to you in the second box then save.
 * Go back to PuTTY and copy/paste the code given to you in the third box.

Create Scripts for Routine Tasks

 * Create the dwu, dws and dwdb scripts as explained in Scripting. U is for Update, S is for Synchronize, DB is for Database.


 * Go to WinSCP and create the three files in  (again by right-clicking) with the code given to you in the boxes. For dwu, use the code from the second box.
 * Go to PuTTY and make them executable using the  command as explained. The code you need to type is bolded and is above each box of code.

Manage Your System Account

 * Your default Dreamhack account is called system. Go to PuTTY and type this to set its password:


 * Log in to your Dreamhack (http://www.yourusername.hack.dreamwidth.net/) using system and your new password.


 * Go to http://www.yourusername.hack.dreamwidth.net/admin/priv/. Click on 'payments' type 'system' in the User field then click on 'Make Changes'. The system account now has the ability (i.e. privilege or priv) to give paid time to any account.


 * Go to http://www.yourusername.hack.dreamwidth.net/admin/pay. Type 'system' in the Edit user field and click on Go. Make your account a seed one.

Get Rid of Invite Codes

 * Go to WinSCP, to, and double-click on  . Find   and change 1 to  . Save your file.


 * Go to PuTTY and type this to make the changes go live on your Dreamhack:

Create a Bugzilla account

 * Simply click here.


 * As mark explained here, go to Name and Password and enter your name following this format: . 'Name' can be your real name, a nickname, your username again, etc. You don't have to give your real name if you don't want to.

Finish Setting Up Your Dreamhack

 * The final and last step is to create files and folders for patches.


 * In PuTTY, type this to create files and folders in :


 * In WinSCP, open  and add this:


 * Change the second username to your Bugzilla name and the e-mail address to your Bugzilla address. Save the file.


 * In PuTTY again, type this to create files and folders in :


 * In WinSCP, open  and add this:


 * Change the second username to your Bugzilla name and the e-mail address to your Bugzilla address. Save the file.

= How All of This Works =

PuTTY, WinSCP or Bugzilla ?

 * You use PuTTY to update your Dreamhack code, make your changes go live on your Dreamhack, create patches and manage patches.


 * You use WinSCP to edit Dreamhack files.


 * You use Bugzilla to find bugs, file bugs, and upload patches.

Folders and Files You Work With

 * Your Dreamhack has two parts:
 * the live part
 * the repository part ( and  ).


 * What you see on http://www.yourusername.hack.dreamwidth.net/ is the live part.


 * But you work with in the repositories: you edit repository files and you create patches in repository folders.

Updating Your Repository Code

 * Code is committed by developers all the time. You must regularly update your repositories by running the 'Update' script:


 * Note that this won't update your Dreamhack. You need to make the changes go live with the next step:

Making Changes Go Live on Your Dreamhack

 * To do that, you use the 'Synchronize' and 'DataBase' scripts:

= Before You Fix Anything =

Find or File a Bug

 * To find: you can use predefined searches such as unassigned effort-minor.


 * Some of these bugs won't appear to require 'minor' effort to you. It's normal. Try to find small bugs among them: minor modifications to be done on one of the site pages (text to be modified; elements to be added, removed or moved; elements to be hidden from some categories of users, etc.).


 * To file: make sure it's not already been filed using simple search or advanced search then use this form to file a new bug. Fill and edit the fields as needed.


 * To assign a bug to yourself, enter your Bugzilla e-mail address in Assign To and set the status to ASSIGNED.


 * To make this easier, you can also use of fu 's Greasemonkey scripts: Dreamwidth Bug Grabber. Click on (grab!) next to Assign To and this will edit it and Status for you. Click on Save Changes of course.

Create a Patch

 * Open PuTTY and update everything by running the three scripts. You need to work with the latest code.


 * Go to dw-free by typing this:


 * If you need to go to dw-nonfree, type this instead:


 * Create a new patch by typing this (change NUMBER and PATCHNAME of course):

= Edit Files =

Use WinSCP to open the file(s) you need to edit.


 * If you're working on site pages, you're working on .bml files. These are in  or one of the subsequent folders. You'll see that their names correspond to the URLs of site pages. These files may use .pm modules/widgets which are in   or.


 * For text strings which are not in  files, see.


 * For more specific searches, you can use the grep command:

Interesting options:

-E: match using extended regular expressions -F: match using fixed strings -r: recursive -i: case insensitive -l: filename only -n: add relative line number

Examples:


 * This will search for "find this text" in all files.


 * This will search for files containing "print_entry" in the /s2layers folder.


 * If WinSCP is not using your favorite editor, go to View/Preferences/Editors. Click on Add/External Editor and Browse. At the end don't forget to click on Up to make it the default editor.

= Test Your Changes on Your Dreamhack =


 * In PuTTY, stop your Dreamhack:


 * Synchronize your live code and update your database:


 * Start your Dreamhack again:


 * Go to your Dreamhack and test. Edit the files again in WinSCP if more changes are needed. Go through these steps again to test your new changes.

= Upload Your Patch =

Update & Save Your Patch

 * In PuTTY, go to dw-free or dw-nonfree ( or  )


 * Type this to update your patch file:


 * Go to your patch directory in WinSCP (e.g. ) and save a copy of your patch on your computer.

Upload Your Patch to Bugzilla

 * Log in to Bugzilla and open your bug.


 * Click on 'Add an Attachment' to attach your patch. Add a description, check 'patch' and set Flags/Commit and Flags/Review to ?. Feel free to add a comment if you have questions or remarks. Click on Submit.


 * To help you with this, you can use one of fu 's Greasemonkey scripts: Dreamwidth Patch Upload Defaults. This will automatically check patch and set the flags for you.


 * Wait for someone to review and commit your patch. You're done. :)

= Getting Back to Default Code =


 * Pop your patch out of the pile with:


 * Then delete it:


 * If you don't remember its exact name you can use . This will list all the patches you have in your patch queue.


 * And finally use  and   to remove changes from your Dreamhack.

= More: Importing a Patch from Bugzilla =


 * Sometimes you need to import someone else's patch to work something out. Either because you need to add something to the patch or because it blocks your own bug as you're working on the same code.


 * In PuTTY, go to dw-free/dw-nonfree and create a new patch using.


 * Download the patch file using the  command. "imported_patch" is the name the file will have. URL is the Bugzilla URL of the patch (http://bugs.dwscoalition.org/attachment.cgi?id=XXXX).


 * Apply the patch using the  command:


 * Incorporate the changes to your patch:


 * You've made the patch your own and you can now easily modify it, delete it or create a new patch on top of it.

= More: Importing a Patch from Your Dreamhack =


 * Sometimes you want to unapply a patch and save it to reapply it later.


 * In PuTTY, create a new folder for your saved patches using the  command:


 * In WinSCP, copy/paste your patch into this new folder.


 * In PuTTY, go to dw-free/dw-nonfree and pop and delete your patch using  and.


 * When you're ready to apply it again, type


 * Then apply the patch:

= More: Tips and Tricks =


 * If your repositories won't update properly with, you may need to go to dw-free/dw-nonfree and remove all your local changes with   then run   again.


 * If your live code won't sync with your repository code, it may be because the files you've edited got saved using your computer time and not distant time. As the system relies on timestamps to see which files need to be updated, updates won't happen if live files seem to be more recent than repository files. Quickest trick is to change your computer time, open and save your files again so they get a later timestamp, refresh your patch and sync again. Also, make sure to check the DST options in WinSCP (Environment section).


 * If there's something wrong with your patch queue (it says the patch is not in the series or you can't delete a patch) don't forget that you can start over: delete the patches folder with WinSCP and recreate it again in PuTTY using.


 * If something's really wrong you can also rebuild you Dreamhack and start over.


 * To see what's string of text is used in a page append  to the page URL.


 * As denise explained here, you need to delete old text strings and create new ones when you edit .text files or en.dat instead of simply editing the text. If the change isn't critical - the string doesn't need to be renamed or the text change is minor - it's better to notify the site copy team so that text can be changed locally and the original file left alone.


 * If text you've modified doesn't appear on the site after a code push, append  to make sure it's using the right string. If it is and it still doesn't display after a while, comment on dw_maintenance . Someone may have forgotten to do something. :)

= References =


 * Bash commands
 * HG commands