mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] dw_dev2012-09-22 09:49 pm

Release notes

We did our first release from git tonight. It went well, I will chalk that up to all of the hard work from folks like [personal profile] fu and [personal profile] exor674 (and others!) to make sure that everything was in place. [personal profile] fu put together a nice "things we have to do" in [site community profile] dw_staff, so that was very helpful.

Anyway, I wanted to document some things that are important to know for the period between releases. This probably won't apply to most of you, but just in case...

So, we are following the document about a successful git branching model. This is what git flow is based on and it's a really efficient model, so we're using it for doing our features and in this case, our release.

The release process was, in essence:

  • Create a release-1.11.0 branch
  • Make final tweaks in this branch to get things ready for release
  • Push this branch live
  • Merge this branch back in to develop and master
  • Add a release tag with the version number on master

This leaves our repository in this state:

  • develop is still open, you can keep committing things to it (no code freeze, yay!)
  • master has stable tags, so you can always roll back to tags here (easy production rolls!)
  • release-1.11.0 is open for doing fixes on the live release (easy fixing production, yay!)

The thing that is important to know, if you are going to be committing fixes that you intend to go live, is that you need to make your changes on the release-x.xx.x branch -- not on develop. Any code committed to develop will, because of its nature, have to wait until the next code push -- weeks away.

If you have stuff you need to get live sooner (fixes to things broken in the last code push or stability/important fixes), you need to adjust your workflow slightly. It's pretty easy though, and goes something like this:

git checkout -b release-1.11.0 dreamwidth/release-1.11.0

Now make your fixes, as per normal, and submit a pull request. As long as your current branch is the release branch, then you will be able to submit a pull request on the appropriate branch, and we can merge it in and push it out to the site quite easily.

ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 11:07 am (UTC)(link)
Sure!

Went with dw-free and this is where I got the failure message:

git pull dreamwidth develop:develop
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2012-09-23 01:36 pm (UTC)(link)
Hmmm. Okay, that *is* weird. I've usually only seen the nonfastforward error when pushing, not pulling.


Ummm.

This is with a clean repository? That is, you said that you cloned and started from scratch?
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 01:37 pm (UTC)(link)
Yeah but I had the issue with the config files. I'll try again.
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 02:55 pm (UTC)(link)
Ok I tried again and got the same errors so I'm trying again to make sure I didn't miss any step.

Question: when I do cp $LJHOME-old/etc/config* local/etc/ it copies only one file: config.pl. Local and private aren't there, right? I've got them in dw-old in dw-old/ext/local/etc/ but not in dw-old/etc/.

Edit: ok I see local is dw-nonfree. Makes perfect sense. Don't see private, though.
Edited 2012-09-23 15:08 (UTC)
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2012-09-23 03:24 pm (UTC)(link)
Yup,the ones that are yours are in dw-old/ext/local/etc (the ones in dw-free/etc dw-nonfree/etc are sample ones to get you started).

I am officially stumped right now! Can you show me the exact commands you're using (starting from cloning ,etc)?
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 03:29 pm (UTC)(link)
I don't see where private comes from, though. I looked at the repos on GH and I can't see it.

This is what I've done so far:

dh-ninetydegrees@newhack:~/bin$ cd ~/
dh-ninetydegrees@newhack:~$ git clone https://ninetyd@github.com/ninetyd/dw-free.git $LJHOME
Cloning into '/dreamhack/home/8174-ninetydegrees/dw'...
remote: Counting objects: 53805, done.
remote: Compressing objects: 100% (16319/16319), done.
remote: Total 53805 (delta 36803), reused 53680 (delta 36695)
Receiving objects: 100% (53805/53805), 53.48 MiB | 21.76 MiB/s, done.
Resolving deltas: 100% (36803/36803), done.
dh-ninetydegrees@newhack:~$ cd $LJHOME
dh-ninetydegrees@newhack:~/dw$ git remote add dreamwidth https://github.com/dreamwidth/dw-free
dh-ninetydegrees@newhack:~/dw$ git fetch dreamwidth
From https://github.com/dreamwidth/dw-free
* [new branch] develop -> dreamwidth/develop
* [new branch] master -> dreamwidth/master
* [new branch] release-1.11.0 -> dreamwidth/release-1.11.0
dh-ninetydegrees@newhack:~/dw$ git branch --set-upstream develop dreamwidth/develop
Branch develop set up to track remote branch develop from dreamwidth.
dh-ninetydegrees@newhack:~/dw$ git branch --set-upstream master dreamwidth/master
Branch master set up to track remote branch master from dreamwidth.
dh-ninetydegrees@newhack:~/dw$ cd $LJHOME/ext
dh-ninetydegrees@newhack:~/dw/ext$ mkdir -p local/etc
dh-ninetydegrees@newhack:~/dw/ext$ echo "highest" > local/.dir_scope
dh-ninetydegrees@newhack:~/dw/ext$ cp $LJHOME-old/etc/config* local/etc/
dh-ninetydegrees@newhack:~/dw/ext$ cd $LJHOME/ext
dh-ninetydegrees@newhack:~/dw/ext$ git clone https://ninetyd@github.com/ninetyd/dw-nonfree.git
Cloning into 'dw-nonfree'...
remote: Counting objects: 3876, done.
remote: Compressing objects: 100% (1635/1635), done.
remote: Total 3876 (delta 1841), reused 3859 (delta 1824)
Receiving objects: 100% (3876/3876), 4.26 MiB, done.
Resolving deltas: 100% (1841/1841), done.
dh-ninetydegrees@newhack:~/dw/ext$ cd dw-nonfree
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git remote add dreamwidth https://github.com/dreamwidth/dw-nonfree
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git fetch dreamwidth
From https://github.com/dreamwidth/dw-nonfree
* [new branch] develop -> dreamwidth/develop
* [new branch] master -> dreamwidth/master
* [new branch] release-1.11.0 -> dreamwidth/release-1.11.0
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git branch --set-upstream develop dreamwidth/develop
Branch develop set up to track remote branch develop from dreamwidth.
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git branch --set-upstream master dreamwidth/master
Branch master set up to track remote branch master from dreamwidth.
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ cd $LJHOME
dh-ninetydegrees@newhack:~/dw$ bin/checkconfig.pl
[Checking Timezone...]
[Checking for Perl Modules....]
[Checking LJ Environment...]
Use of uninitialized value in concatenation (.) or string at /dreamhack/home/8174-ninetydegrees/dw/cgi-bin/DBI/Role.pm line 245.
Use of uninitialized value in concatenation (.) or string at /dreamhack/home/8174-ninetydegrees/dw/cgi-bin/DBI/Role.pm line 245.

Problem:
* Couldn't get master database handle.
dh-ninetydegrees@newhack:~/dw$
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2012-09-23 03:36 pm (UTC)(link)
Ah! We're talking about the error with the configs, dwu is okay now?

Okay, so config-private.pl isn't in any of the repositories; yours would have been generated for you when your 'hack was setup, because it contains passwords, etc, that are specific to your repository.

Have you tried copying them over from dw-old/ext/local/etc/ ?
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 03:52 pm (UTC)(link)
No, I hadn't done that because I didn't know I was supposed to. checkconfig tells me everything is ok now but dwu (called dwupd for me) still gives the merge thing:

dh-ninetydegrees@newhack:~/dw$ start-apache
Apache started successfully!
dh-ninetydegrees@newhack:~/dw$ dwupd
Already up-to-date.
Updating 871fcef..7771676
Fast-forward
Password for 'https://ninetyd@github.com':
Total 0 (delta 0), reused 0 (delta 0)
To https://ninetyd@github.com/ninetyd/dw-free.git
871fcef..7771676 develop -> develop
Password for 'https://ninetyd@github.com':
Everything up-to-date
Already up-to-date.
Already up-to-date!
GNU nano 2.2.2 File: .git/MERGE_MSG

Merge branch 'master' of https://github.com/dreamwidth/dw-nonfree into develop

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell
Edited 2012-09-23 15:54 (UTC)
(deleted comment)
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2012-09-23 03:46 pm (UTC)(link)
Hmm, it just means that you'll have a folder named dw-free, where you ran the command from, and not a folder named dw in ~.

So maybe you'd want to move that over to the correct name so that apache could find the correct codebase.

But based on that error, I'm not entirely sure that that's what's going on. Unless you already had a ~/dw folder in there?
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 03:49 pm (UTC)(link)
That's not what I have. I do have a folder named dw in ~ and every folder in there.
yvi: Kaylee half-smiling, looking very pretty (Default)

[personal profile] yvi 2012-09-23 03:52 pm (UTC)(link)
I had it when pulling, too. Not sure if my thread on this helps: http://dw-dev-training.dreamwidth.org/39778.html
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 03:58 pm (UTC)(link)
I'm on develop on both repos. Wasn't I supposed to be there then?

I'll definitely try the code Mark gave you because this is driving me crazy.
Edited 2012-09-23 15:58 (UTC)
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-23 04:05 pm (UTC)(link)
Well, this didn't work. I'm still getting the !rejected error. *sigh* I have no idea what's going on but I'll just go do something else because I can't deal with it anymore.

Thanks a lot for trying to help, Yvi!
yvi: Kaylee half-smiling, looking very pretty (Default)

[personal profile] yvi 2012-09-23 04:06 pm (UTC)(link)
Damn :/ I couldn't figure out whether we were having the same problem, but the error did sounds familiar. Too bad :/ I hope you can get it fixed.