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-24 07:00 pm (UTC)(link)
Ok I'm not sure everything's alright today. my non-free seems to match dw's non-free but I'm not sure my free does. Both graphs look different for develop and I get "Your branch is ahead of 'dreamwidth/develop' by 18 commits." and "Your branch is ahead of 'dreamwidth/master" by 5 commits.' when I update. :/

Edit: I could reset things so they match thanks to the code you've give me above and dwu didn't give me any warnings this time but I still don't understand why this happens and I have to keep doing that. I'm not doing anything. I haven't created any branch or done any coding. I just open my software and pull updates with dwu.
Edited 2012-09-24 19:10 (UTC)
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-24 07:54 pm (UTC)(link)
I did that only after I'd 'fixed' my free repo. I hadn't done anything before that. Hadn't even loaded PuTTY (terminal I use on Windows) since yesterday. I just ran it, entered my password, switched to LJHOME, checked which branches I was on (develop) then ran the dwu script. It fetched some changes (I can't remember what it said but I didn't expect things to go wrong then so I didn't pay too much attention :/). Updated the database. Ran dwu again and that's where I got the 'ahead' messages.

This is my dwu script:

#!/bin/bash
stop-apache

cd $LJHOME

# pull changes from dreamwidth
git checkout develop
git pull --ff dreamwidth develop
git checkout master
git pull --ff dreamwidth master

# push them to Github forks
git push origin develop
git push origin master

# change to dw-nonfree
cd $LJHOME/ext/dw-nonfree

# pull changes from dw-nonfree
git checkout develop
git pull --ff dreamwidth develop
git checkout master
git pull --ff dreamwidth master

# push them to Github forks
git push origin develop
git push origin master

start-apache

This is my dwdb script:

#!/bin/bash
$LJHOME/bin/upgrading/update-db.pl -r -p --innodb && \
$LJHOME/bin/upgrading/update-db.pl -r --cluster=all --innodb && \
$LJHOME/bin/upgrading/texttool.pl load
Edited (sorry; english is hard now) 2012-09-24 20:09 (UTC)
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-24 09:01 pm (UTC)(link)
Sorry I was unclear: that was before I did all that.

I did all the steps I mentioned in my previous comment. When I saw the 'ahead' message and my graph didn't match the one for dreamwidth/dw-free I did this:


git checkout develop
git fetch dreamwidth
git reset --hard dreamwidth/develop
git push --force origin develop

git checkout master
git fetch dreamwidth
git reset --hard dreamwidth/master
git push --force origin master

Checked my branches, my graph, ran dwu to make sure everything was ok and it was then. That's when I created the release branch to fix a bug in Librarian's Dream. So everything is fine now but it wasn't before. And I don't understand why because I hadn't done anything on my end. So now it feels my repos are going to keep 'breaking' every time I fetch updates.
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-24 09:06 pm (UTC)(link)
No, I had the new version. Have had it since yesterday.

And it was only the free repo this time, not the nonfree one.
Edited 2012-09-24 21:06 (UTC)
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-24 09:10 pm (UTC)(link)
Ok. I've expanded the number of lines I can scrollback to in case this happens again.
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2012-09-26 05:59 pm (UTC)(link)
Ok so this is what I did today and I got the 'ahead' messages again. The first time I ran dwu (dwupd for me) I accidentally hit some key so I had to run it again if that matters.

dh-ninetydegrees@newhack:~$ cd $LJHOME
dh-ninetydegrees@newhack:~/dw$ status
...
dw-free
...
* develop
master
release-1.11.0
...
dw-nonfree
...
develop
* master
dh-ninetydegrees@newhack:~/dw$ switch
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ checkout develop
-bash: checkout: command not found
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git checkout develop
Switched to branch 'develop'
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ switch
dh-ninetydegrees@newhack:~/dw$ dwupd
Already on 'develop'
remote: Counting objects: 108, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 79 (delta 62), reused 55 (delta 38)
Unpacking objects: 100% (79/79), done.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Updating b556839..f3ec800
Fast-forward
bin/upgrading/s2layers/librariansdream/layout.s2 | 41 ++++++++++++++++++++++++-----------------
bin/upgrading/s2layers/paperme/layout.s2 | 34 +++++++++++++++++++++++++---------
cgi-bin/DW/Controller/Entry.pm | 10 ++++++----
cgi-bin/LJ/S2.pm | 7 ++-----
cgi-bin/LJ/Tags.pm | 18 ++++++++++++++++++
htdocs/js/jquery.postform.js | 7 ++++++-
schemes/common.tt | 10 +++++-----
views/entry/form.tt | 8 +++++++-
views/entry/form.tt.text | 2 ++
9 files changed, 95 insertions(+), 42 deletions(-)
Switched to branch 'master'
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 2 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Updating ad92f6a..21f0c64
Fast-forward
bin/upgrading/s2layers/core2.s2 | 2 +-
bin/upgrading/s2layers/librariansdream/layout.s2 | 41 ++++++++++++++++++++++++-----------------
bin/upgrading/s2layers/paperme/layout.s2 | 34 +++++++++++++++++++++++++---------
bin/upgrading/s2layers/siteviews/layout.s2 | 2 +-
bin/upgrading/s2layers/siteviews/themes.s2 | 6 ------
cgi-bin/DW/Controller/Entry.pm | 10 ++++++----
cgi-bin/LJ/S2.pm | 25 ++++++++++++++++++-------
htdocs/js/jquery.cuttag-ajax.js | 7 -------
htdocs/js/jquery.postform.js | 7 ++++++-
htdocs/stc/celerity/celerity.css | 4 ++--
htdocs/stc/entrypage.css | 1 +
htdocs/stc/gradation/gradation.css | 4 ++--
htdocs/stc/lynx/lynx.css | 4 ++--
htdocs/stc/replypage.css | 2 +-
schemes/common.tt | 10 +++++-----
views/entry/form.tt | 8 +++++++-
views/entry/form.tt.text | 2 ++
17 files changed, 103 insertions(+), 66 deletions(-)

Password for 'https://ninetyd@github.com':
dh-ninetydegrees@newhack:~/dw$ dwupd
httpd (no pid file) not running
Switched to branch 'develop'
Your branch is ahead of 'dreamwidth/develop' by 17 commits.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
Your branch is ahead of 'dreamwidth/master' by 22 commits.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Already up-to-date.
Password for 'https://ninetyd@github.com':
Counting objects: 108, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (79/79), done.
Writing objects: 100% (79/79), 9.39 KiB, done.
Total 79 (delta 61), reused 0 (delta 0)
To https://ninetyd@github.com/ninetyd/dw-free.git
b556839..f3ec800 develop -> develop
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.27 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://ninetyd@github.com/ninetyd/dw-free.git
ad92f6a..21f0c64 master -> master
Already on 'develop'
From https://github.com/dreamwidth/dw-nonfree
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
From https://github.com/dreamwidth/dw-nonfree
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Apache started successfully!

dh-ninetydegrees@newhack:~/dw$ dwupd
Switched to branch 'develop'
Your branch is ahead of 'dreamwidth/develop' by 17 commits.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
Your branch is ahead of 'dreamwidth/master' by 22 commits.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Switched to branch 'develop'
From https://github.com/dreamwidth/dw-nonfree
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
From https://github.com/dreamwidth/dw-nonfree
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Apache started successfully!


After that I ran dwdb and everything looked normal there (it's too long to paste; sorry).
ninetydegrees: Art: self-portrait (mobilize)

[personal profile] ninetydegrees 2012-09-27 03:32 pm (UTC)(link)
Awesome! Thank you! It looks like it works so *crossing fingers* to make it last. Should I update the wiki too?
ninetydegrees: Art: deep-sea diver in a field (suit up)

[personal profile] ninetydegrees 2012-09-27 04:28 pm (UTC)(link)
Yay! Guinea pigging again!