Webtools:CVS Guidelines: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Webtools|< Back to Webtools]]
[[Webtools|< Back to Webtools]]
= General gotchas =
= Gotchas =
* Always update your other code to the latest for that branch before you start your production routine
* Always update your other code to the latest for that branch before you start your production routine
* Don't ever submit a log without a description or corresponding bug number (if applicable) -- blank changelogs should be avoided
* Don't ever submit a log without a description or corresponding bug number (if applicable) -- blank changelogs should be avoided
Line 7: Line 7:
** Be aware of other patches in progress
** Be aware of other patches in progress
** Talk to each other to ensure that your patches won't cause regressions
** Talk to each other to ensure that your patches won't cause regressions
** Run the usual smoke tests and (ideall) some sort of automated script that can spot SNAFUs immedeately
** Run the usual smoke tests and (ideally) some sort of automated script that can spot SNAFUs immedeately
* Don't file IT requests for production updates every hour, and don't email them every 5 minutes (or text-message them either) -- your best bet is to group your updates and push them weekly.  
* Don't file IT requests for production updates every hour, and don't email them every 5 minutes (or text-message them either) -- your best bet is to group your updates and push them weekly.


= Tagging for production =
= General Tagging Rules (quick version) =
* Tag your last-known-working-copy as your ROLLBACK (if one doesn't already exist)
* Whatever is checked out in staging always has the _STAGING tag on it at all times
  [morgamic@khan aus]$ cvs tag -f AUS2_ROLLBACK
* Whatever is checked out in production always has the _PRODUCTION tag on it at all times
* Review LXR logs to make sure each update makes sense
* Any previous _PRODUCTION tag should be tagged w/ an RTM_DATE tag before moving on to the next _PRODUCTION tag
* Apply your patches for the next batch
 
* When you're _SURE_ that this is the final batch of updates, you need to tag it as PRODUCTION, then check that baby in
= Tagging for Staging =
* Check in all the updates/patches you're going to stage.
* Add the STAGING tag to the code you want to stage:
[morgamic@khan aus]$ cvs up -dP
[morgamic@khan aus]$ cvs ci -m 'some message'
[morgamic@khan aus]$ cvs tag -F AUS2_STAGING
 
= Tagging for Production =
* Check in all the updates/patches you're going to check in.
* When you're ready to do a release-to-production rollup, make sure you have a current copy of the source, and tag is with the current date, including the hour/minute:
[morgamic@khan aus]$ cvs up -dP
[morgamic@khan aus]$ cvs tag -f AUS2_RTM_200608081426
 
If on a Unix box, you can use the following trick (preferred):
 
  [morgamic@khan aus]$ cvs tag -f AUS2_RTM_`date +%Y%m%d%H%M`
 
* Find out the diffs between the RTMs; to do this, run:
 
[morgamic@khan aus]$ cvs diff -rAUS2_PRODUCTION -rAUS2_RTM_200608081426
 
* When you're '''SURE''' that this is the patches are correct/make sense, you need to tag it as PRODUCTION:
  [morgamic@khan aus]$ cvs tag -F AUS2_PRODUCTION
  [morgamic@khan aus]$ cvs tag -F AUS2_PRODUCTION
  cvs tag: Tagging .
  cvs tag: Tagging .
Line 30: Line 51:
  [morgamic@khan aus]$ cvs ci
  [morgamic@khan aus]$ cvs ci


= Pushing updates into production =
''Note:'' that if you are starting this standard on a project that hasn't had an RTM tag previously, you will have to do it twice -- once for what's already out there,  with a date approximation, and once for the one you're pushing out.
 
* Confirm that the PRODUCTION tag matches the RTM tag you created
 
[morgamic@khan aus]$ cvs diff -rAUS2_PRODUCTION -rAUS2_RTM_200608081426
[morgamic@khan aus]$ # Should be no output.
 
 
 
= When to push =
* Only initiate a request if you are sure you are not causing a seriuos regression
* Only initiate a request if you are sure you are not causing a seriuos regression
* For major updates, you should contact major parties and discuss the update -- at least briefly -- so they are aware.  When in doubt, just email everyone.  :)
* For major updates, you should contact major parties and discuss the update -- at least briefly -- so they are aware.  When in doubt, just email everyone.  :)
Line 36: Line 66:
= Requesting an update in production =
= Requesting an update in production =
* [https://bugzilla.mozilla.org/enter_bug.cgi?format=it_request&product=mozilla.org File an IT Request] when you are sure you are ready to go
* [https://bugzilla.mozilla.org/enter_bug.cgi?format=it_request&product=mozilla.org File an IT Request] when you are sure you are ready to go
* Assign the appropriate severity -- note that critical or blocker pages the oncall.  
* '''Include in the request the previous RTM tag, so an easy rollback can occur!''' Also include any other rollback instructions.
* Assign the appropriate severity -- note that critical or blocker pages the oncall.
 
= Actually pushing updates =
* Updating production should be a simple step, and should always be consistent if we follow this procedure:
[root@do-stage01]$ cvs up -dP -r AUS2_PRODUCTION
* Most apps are updated on osadm01
* '''AUS2 is a special case''', and the command for pushing is done on '''do-stage01:/opt/aus2/app'''


= After the push =
= After the push =
* Always be available after updates are pushed
* Always be available after updates are pushed
* Tell the community you have made an update -- blog, planet, etc.
* Keep an eye open for what's going on, file an IT request or page sysadmin for a rollback if necessary
= Rolling back =
* Sysadmins, if the developer did things right, you should be able to rollback by using:
* Sysadmins, if the developer did things right, you should be able to rollback by using:
  [root@khan aus]$ cvs up -r AUS2_ROLLBACK
  [root@khan aus]$ cvs up -r AUS2_RTM_[date of original release]
For example:
[root@khan aus]$ cvs up -r AUS2_RTM_200608081426

Latest revision as of 00:11, 31 August 2006

< Back to Webtools

Gotchas

  • Always update your other code to the latest for that branch before you start your production routine
  • Don't ever submit a log without a description or corresponding bug number (if applicable) -- blank changelogs should be avoided
  • Talk to your team
    • Don't duplicate effort
    • Be aware of other patches in progress
    • Talk to each other to ensure that your patches won't cause regressions
    • Run the usual smoke tests and (ideally) some sort of automated script that can spot SNAFUs immedeately
  • Don't file IT requests for production updates every hour, and don't email them every 5 minutes (or text-message them either) -- your best bet is to group your updates and push them weekly.

General Tagging Rules (quick version)

  • Whatever is checked out in staging always has the _STAGING tag on it at all times
  • Whatever is checked out in production always has the _PRODUCTION tag on it at all times
  • Any previous _PRODUCTION tag should be tagged w/ an RTM_DATE tag before moving on to the next _PRODUCTION tag

Tagging for Staging

  • Check in all the updates/patches you're going to stage.
  • Add the STAGING tag to the code you want to stage:
[morgamic@khan aus]$ cvs up -dP
[morgamic@khan aus]$ cvs ci -m 'some message'
[morgamic@khan aus]$ cvs tag -F AUS2_STAGING

Tagging for Production

  • Check in all the updates/patches you're going to check in.
  • When you're ready to do a release-to-production rollup, make sure you have a current copy of the source, and tag is with the current date, including the hour/minute:
[morgamic@khan aus]$ cvs up -dP
[morgamic@khan aus]$ cvs tag -f AUS2_RTM_200608081426

If on a Unix box, you can use the following trick (preferred):

[morgamic@khan aus]$ cvs tag -f AUS2_RTM_`date +%Y%m%d%H%M`
  • Find out the diffs between the RTMs; to do this, run:
[morgamic@khan aus]$ cvs diff -rAUS2_PRODUCTION -rAUS2_RTM_200608081426
  • When you're SURE that this is the patches are correct/make sense, you need to tag it as PRODUCTION:
[morgamic@khan aus]$ cvs tag -F AUS2_PRODUCTION
cvs tag: Tagging .
T README
T htaccess.dist
T index.php
cvs tag: Tagging inc
T inc/aus.class.php
T inc/config-dist.php
T inc/init.php
T inc/patch.class.php
T inc/update.class.php
T inc/xml.class.php
[morgamic@khan aus]$ cvs ci

Note: that if you are starting this standard on a project that hasn't had an RTM tag previously, you will have to do it twice -- once for what's already out there, with a date approximation, and once for the one you're pushing out.

  • Confirm that the PRODUCTION tag matches the RTM tag you created
[morgamic@khan aus]$ cvs diff -rAUS2_PRODUCTION -rAUS2_RTM_200608081426
[morgamic@khan aus]$ # Should be no output.


When to push

  • Only initiate a request if you are sure you are not causing a seriuos regression
  • For major updates, you should contact major parties and discuss the update -- at least briefly -- so they are aware. When in doubt, just email everyone.  :)

Requesting an update in production

  • File an IT Request when you are sure you are ready to go
  • Include in the request the previous RTM tag, so an easy rollback can occur! Also include any other rollback instructions.
  • Assign the appropriate severity -- note that critical or blocker pages the oncall.

Actually pushing updates

  • Updating production should be a simple step, and should always be consistent if we follow this procedure:
[root@do-stage01]$ cvs up -dP -r AUS2_PRODUCTION
  • Most apps are updated on osadm01
  • AUS2 is a special case, and the command for pushing is done on do-stage01:/opt/aus2/app

After the push

  • Always be available after updates are pushed
  • Tell the community you have made an update -- blog, planet, etc.
  • Keep an eye open for what's going on, file an IT request or page sysadmin for a rollback if necessary

Rolling back

  • Sysadmins, if the developer did things right, you should be able to rollback by using:
[root@khan aus]$ cvs up -r AUS2_RTM_[date of original release]

For example:

[root@khan aus]$ cvs up -r AUS2_RTM_200608081426