Simplest Enterprise Continuous Integration Solutions

Saturday, October 16, 2010

BugZilla: BugZilla 3.0.6 Configuration


# configure BugZilla as administrator

# Parameters Link

Required Settings

            Maintainer: bugzilla@fedora12.local.lab
            Urlbase: http://fedora12.local.lab

Administrative Policies

            Allowbugdeletion: off -> on

User Authentication

            Requirelogin: off -> on
            Createemailregrexp: .* 

Bug Change Policies

            Letsubmitterchoosepriority: on -> off
            Letsubmitterchoosemilestone: on -> off
            Commentoncreate: off -> on
            Commentonreopen: off -> on

Bug fields

            Defaultpriority: P5 -> P3
            Defaultseverity: enhancement -> normal

Group Security

            Makeproductgroups: off -> on
            Useentrygroupdefault: off -> on

Email

            Mail_delivert_method: Sendmail -> SMTP

Query Defaults

            Specific_search_allow_enpty_words: off -> on

User Matching

            Usemenuforusers: off -> on

Default Preferences Link

After changing a  bug

            Show next bug in my list -> Show the updated bug

Products Link


Field Value Link

Resolution:

            CREATION, UNIT-TEST

# Custom Configuration 

# UNIT-TEST with comment template:

Add below code into bugzilla/template/en/default/bug/edit.html.tmpl  line 75

    /* Adds the Code Complete fields to the `comment' textarea */
  function codeComplete() {
      var codeCompleteText = "Solution Description  (component(s) modified: MAC,phyD, phy, etc):\n";

      codeCompleteText += "Affected files:\n";
      codeCompleteText += "Branch where fix is located:\n";
      codeCompleteText += "Root branch (Where did the above branch originate from?) and revision:\n";
      codeCompleteText += "Dependencies:\n";
      codeCompleteText += "Code reviewed by:\n";
      codeCompleteText += "How was the fix tested:\n";
      codeCompleteText += "List the test cases used and/or built:\n";
      codeCompleteText += "Were the new test case put under revision control:\n";
      codeCompleteText += "What criteria is there to conclude the original issue is fixed:\n";
      codeCompleteText += "Instructions to allow Testers to Verify:\n";

      /* <textarea id="comment"> */
      var textarea = document.getElementById('comment');
      textarea.value = codeCompleteText + textarea.value;

      textarea.focus();
  }

Change bugzilla/template/en/default/bug/knob.html.tmpl line 190

          onchange="document.changeform.knob[[% knum %]].checked=true; if (this.value == 'UNIT-TEST') {codeComplete();}">
Instead of
          onchange="document.changeform.knob[[% knum %]].checked=true">

# Creation with Comment template:

Change bugzilla/template/en/default/bug/create.html.tmpl line 463

         defaultcontent = "Product:\nVersion:\nHardware platform:\nHardware revision:\nPCT or Base Station:\nPCT or Base Station software version:\n\nOverview: More detailed restatement of summary.\n\nProduct Impact:\n\nSteps to Reproduce: Minimized, easy-to-follow steps that will trigger the bug. Include any special setup steps. What is the frequency of occurrence?\n\nActual Results: What the application did after performing the above steps.\n\nExpected Results: What the application should have done, were the bug not present.\n\nBuild Date & Platform: Date and platform of the build in which you first encountered the bug.\n\nAdditional Builds and Platforms: Whether or not the bug takes place on other platforms (or browsers, if applicable).\n\nAdditional Information: Any other useful information.\n\nDoes a work around exist for the problem? If so, include steps to work around.\n\nDo you have a proposed solution to the problem? If so, include the appropriate information.\n\nAttach logs and describe as appropriate:"
Instead of
         defaultcontent = defaultcontent

# Reassign to “ASSIGNED” instead of “NEW”

Change bugzilla/process_bug.cgi line 1182

        ChangeStatus('ASSIGNED');
Instead of
        ChangeStatus('NEW');

# Resolution FIXED with comment template:

change
 to

Add below code into bugzilla/template/en/default/bug/edit.html.tmpl  line 97

    /* Adds the daily Regression fields to the `comment' textarea */
  function dailyRegression() {
      var dailyRegressionText = "Daily Regression Description:\n";

      dailyRegressionText += "Which daily build load did you test:\n";
      dailyRegressionText += "Daily build load compiled branch name and revision:\n";
      dailyRegressionText += "Dependencies:\n";
      dailyRegressionText += "How was the fix tested:\n";
      dailyRegressionText += "List the test cases used and/or built:\n";
      dailyRegressionText += "Were the new test case put under revision control:\n";
      dailyRegressionText += "What criteria is there to conclude the original issue is fixed:\n";
      dailyRegressionText += "Instructions to allow Testers to Verify:\n";

      /* <textarea id="comment"> */
      var textarea = document.getElementById('comment');
      textarea.value = dailyRegressionText + textarea.value;

      textarea.focus();
  }

Change bugzilla/template/en/default/bug/knob.html.tmpl line 190

        onchange="document.changeform.knob[[% knum %]].checked=true; if (this.value == 'UNIT-TEST') {codeComplete();}; if (this.value == 'FIXED') {dailyRegression();}">
Instead of
        onchange="document.changeform.knob[[% knum %]].checked=true; if (this.value == 'UNIT-TEST') {codeComplete();}">

# Custom fields

cf_found_in_rel



cf_closed_in_rel





cf_plannedrel

 

cf_action





cf_grouping



chgrp –R apache custom
/var/www/html/bugzilla/checksetup.pl

Saturday, October 9, 2010

BugZilla: BugZilla 3.0.6 on Fedora12


[root@fedora12 ~]# uname -a
Linux fedora12.local.lab 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686 i386 GNU/Linux

# install Apache

[root@fedora12 ~]# yum install httpd
[root@fedora12 ~]# service httpd restart

# configure httpd

insert /etc/httpd/conf/httpd.conf with

Alias /bugzilla/ "/var/www/html/bugzilla/"

<Directory /var/www/html/bugzilla>
    AddHandler cgi-script .cgi
    Options +Indexes +ExecCGI +FollowSymLinks
    DirectoryIndex index.cgi
    AllowOverride Limit
</Directory>

# Change
DocumentRoot “/var/www/html” -> DocumentRoot “/var/www/htrml/bugzilla” for fixing firefox browser issue

# install PostgreSQL

# make sure /usr/bin/pg_config existence for DBI:Pg installation
[root@fedora12 ~]# yum install postgresql-devel               
[root@fedora12 ~]# yum install postgresql-server
# check version postgresql-8.4.5-1.fc12.i686
[root@fedora12 ~]# rpm –q postgresql                                

[root@fedora12 ~]# service postgresql initdb

[root@fedora12 ~]# su – postgres

Edit /var/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
host all bugs 127.0.0.1 255.255.255.255 md5
# "local" is for Unix domain socket connections only
local   all         all                               md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

[root@fedora12 ~]# service postgresql restart

# add Postgres user

[root@fedora12 ~]# createuser -U postgres -dAP bugs
[root@fedora12 ~]# service postgresql restart
[root@fedora12 ~]# psql -h 127.0.0.1 -U bugs –W

# install bugzilla-3.0.6

[root@fedora12 ~]# cd /usr/local
[root@fedora12 ~]# tar –xvf /tmp/bugzilla-3.0.6.tzr.bzip to /usr/local
[root@fedora12 ~]# chgrp –R apache /usr/local/bugzilla-3.0.6
[root@fedora12 ~]# ln -s /usr/local/bugzilla-3.0.6 /var/www/html/bugzilla

# run checksetup.pl

[root@fedora12 ~]# /var/www/html/bugzilla/checksetup.pl --check-modules





yum install perl-CPAN
/usr/bin/perl -MCPAN -e 'install "Email::Send"'
/usr/bin/perl -MCPAN -e 'install "Email::MIME"'
/usr/bin/perl -MCPAN -e 'install "Template"'
/usr/bin/perl -MCPAN -e 'install "Email::MIME::Modifier"'
/usr/bin/perl -MCPAN -e 'install "DBI"'
/usr/bin/perl -MCPAN -e 'install "Date::Format"'

[root@fedora12 ~]# /usr/bin/perl -MCPAN -e 'install "DBD::Pg"'

Edit /var/www/html/bugzilla/localconfig
$db_pass = 'bugzilla';

[root@fedora12 ~]# /var/www/html/bugzilla/checksetup.pl
 







# Troubleshooting:

[root@fedora12 ~]# cd /var/www/html/bugzilla
./testserver.pl http://fedora12.local.lab/bugzilla
TEST-OK Webserver is running under group id in $webservergroup.
TEST-OK Got front picture.
Use of uninitialized value $response in pattern match (m//) at ./testserver.pl line 110.
Use of uninitialized value $response in pattern match (m//) at ./testserver.pl line 110.
TEST-FAILED Webserver is not executing CGI files.
TEST-OK Webserver is preventing fetch of http://fedora12.local.lab/bugzilla/localconfig.
TEST-OK GD version 2.45, libgd version 2.0.34; Major versions match.
TEST-OK GD library generated a good PNG image.
TEST-OK Chart library generated a good PNG image.
TEST-OK Template::Plugin::GD is installed.
[root@fedora12 ~]# chcon -R -t httpd_sys_content_t /var/www/html/bugzilla/

# configure SELinux

[root@fedora12 ~]# system-config-selinux
Status: enforcing -> permissive
Or
Boolean: httpd_can_network_connect_db uncheck -> checked

Enable send email

Boolean: httpd_can_sendmail uncheck -> checked

# BugZilla 3.0.6


Saturday, September 11, 2010

Apache Ant Mail Task

mail_build.xml Ant buildfile contains below contents:
<project name="ant_mail" default="all">
   <target name="mail">
      <mail mailhost="smtp.acme.com" mailport="25" subject="[Ant Mail Notification]: ${my_ant_mail_subject}"
         from="me@acme.com"
         tolist="somebody1@acme.com,some_group1@acme.com"
         cclist="somebody2@acme.com,somegroup2@acme.com"
         encoding="mime" messagemimetype="text/html">
         <message>${my_ant_mail_subject} bla bla =<br><br>
         Regards,<br>
         </message>
      </mail>
   </target>
</project>

Invoked as: 
<full_path_to>/ant -buildfile <full_path_to>/mail_build.xml mail -Dmy_ant_mail_subject="My Email Subject"

Note:
mail.jar and activation.jar existences may require in Ant installation lib folder.

Saturday, September 4, 2010

CruiseControl: CruiseControl 2.8.4 Configuration


[root@fedora12 ~]# uname -a
LINUX FEDORA12.LOCAL.LAB 2.6.31.5-127.FC12.I686.PAE #1 SMP SAT NOV 7 21:25:57 EST 2009 I686 I686 I386 GNU/LINUX

# ANT_HOME

[root@fedora12 ~]# which ant
/usr/bin/ant
[root@fedora12 ~]# ant -version
Apache Ant version 1.7.1 compiled on April 16 2010
[root@fedora12 ~]# echo "export ANT_HOME=/usr/bin/ant" >> /etc/profile
[root@fedora12 ~]# source !$
source /etc/profile
[root@fedora12 ~]# env | grep ANT_HOME
ANT_HOME=/usr/bin/ant

# CruiseControl config/xml

[root@fedora12 ~]# cat /opt/cruisecontrol/config.xml
  <project name="my_cc_project">
    <listeners>
      <currentbuildstatuslistener File="logs/${project.name}/status.txt" />
    </listeners>
    <schedule Interval="300">
      <ant BuildFile="projects/${project.name}/${project.name}_build.xml" AntHome="apache-ant-1.7.1" UseLogger="true" ShowAntOutput="true" UseQuiet="false" />
    </schedule>
    <log>
      <merge Dir="projects/${project.name}/target/test-results" />
    </log>
    <modificationset>
      <filesystem Folder="/mnt/smb_shanred/drop_zone/my_cc_project" UserName="bldmastr" IncludeDirectories="false" />
    </modificationset>
    <publishers>
      <onsuccess>
        <htmlemail MailHost="smtp.fedora12.local.lab" ReturnAddress="cc_admin@fedora12.local.lab" ReturnName="CrusieControl Administrator" SubjectPrefix="[Cruise Control]:" SkipUsers="true" SpamWhileBroken="false">
          <always address="cc_admin@fedora12.local.lab" />
        </htmlemail>
      </onsuccess>
      <onfailure>
        <htmlemail MailHost="smtp.fedora12.local.lab" SubjectPrefix="[Cruise Control]:" ReturnAddress="cc_admin@fedora12.local.lab" ReturnName="CrusieControl Administrator" SkipUsers="true">
          <always address="cc_admin@fedora12.local.lab" />
        </htmlemail>
      </onfailure>
    </publishers>
    <property value="/opt/cruisecontrol" name="cc.dir" />
    <property environment="env" />
  </project>

# CrusieControl project build.xml

[root@fedora12 ~]# cat /opt/cruisecontrol/projects/my_cc_project/my_cc_project_build.xml
<project name="my_cc_project" default="all">


    <property environment="env"/>
    <!-- global configuration -->
    <property name="staging_area_dir" value="/staging_area"/>
    <property name="my_projects_dir" value="/projects"/>
    <property name="drop_zone_dir" value="/mnt/smb_shared/drop_zone/my_cc_project"/>
    <property name="latest_dir" value="/mnt/smb_shared/release_zone/latest"/>


    <!-- local configuration -->
    <property name="project.name" value="my_cc_project"/>
    <property name="my_shortname" value="mcp"/>
    <property name="my_targetos" value="linux"/>
    <property name="my_staging_area_dir" value="${staging_area_dir}/linux/my_cc_project"/>
    <property name="my_staging_area_parent_dir" value="${staging_area_dir}/linux"/>
    <property name="my_project_dir" value="${projects_dir}\Installers\${my_shortname}"/>
    <property name="my_script_dir" value="${projects_dir}\mfg_scripts"/>
    <property name="my_latest_dir" value="${latest_dir}/mcp"/>


    <target name="all" depends="run, copy_readme"/>


    <target name="clean">
        <delete dir="${my_staging_area_dir}" quiet="true"/>
        <delete file="${my_project_dir}/buildlog.xml" quiet="true"/>
    </target>


    <target name="pre-run">
        <mkdir dir="${my_latest_dir}"/>
    </target>


    <target name="generate-manifest">
        <fileset id="manifest.path" dir="${my_staging_area_dir}">
            <exclude name="**/*manifest.txt"/>
        </fileset>


        <pathconvert targetos="${my_targetos}" pathsep="${line.separator}" property="manifest.path.targetos" refid="manifest.path">
           <map from="${my_staging_area_dir}/" to=""/>
        </pathconvert>
        <echo file="${my_staging_area_dir}/manifest.txt">${manifest.path.targetos}</echo>
        <!-- below is for enable the rollback testing -->
        <!--
        <echo file="${my_staging_area_dir}/manifest.txt" append="true">${line.separator}make_rollback</echo>
        -->
    </target>


    <!-- ant invoke cmd: /usr/bin/perl -c ${my_shortname} -d ${drop_zone_dir} -s ${my_staging_area_parent_dir} -r ${my_latest_dir} -p ${project.name} -->
    <target name="run" depends="clean, pre-run">
        <exec executable="/usr/bin/perl">
            <arg value="${my_script_dir}/launch_build.pl"/>
            <arg value="-c"/>
            <arg value="${my_shortname}"/>
            <arg value="-d"/>
            <arg value="${drop_zone_dir}"/>
            <arg value="-s"/>
            <arg value="${my_staging_area_parent_dir}"/>
            <arg value="-r"/>
            <arg value="${my_latest_dir}"/>
            <arg value="-p"/>
            <arg value="${project.name}"/>
        </exec>
    </target>


    <target name="copy_readme">
        <copy file="${my_project_dir}/${my_shortname}_readme.txt" todir="${my_latest_dir}" overwrite="yes"/>
    </target>
</project>



Saturday, August 28, 2010

CruiseControl: CruiseControl 2.8.4 on Fedora12

[root@fedora12 ~]# uname -a
Linux fedora12.local.lab 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686 i386 GNU/Linux

# install ant

[root@fedora12 ~]# yum install ant

# get java install path

[root@fedora12 ~]# which java
/usr/bin/java

# get java version

[root@fedora12 ~]# java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

# install cruisecontrol-bin-2.8.4.zip

[root@fedora12 ~]# cd /usr/local
[root@fedora12 ~]# unzip /tmp/crusiecontrol-bin-2.8.4.zip

# edit cruisecontrol.sh and insert below after line 70

JAVA_HOME="/usr/default/java"
PATH=${JAVA_HOME}/bin:${PATH}

#Update below 2 lines for custom ports

EXEC="$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX    4JMBeanServerBuilder -Dcc.library.dir=$LIBDIR -Djetty.logs=$JETTY_LOGS -jar $LAUNCHE    R $@ -jmxport 8000 -webport 8080 -rmiport 1099"
echo $EXEC
$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX4JMBea    nServerBuilder "-Dcc.library.dir=$LIBDIR" "-Djetty.logs=$JETTY_LOGS" -jar "$LAUNCHER    " $@ -jmxport 8000 -webport 8080 -rmiport 1099 &

EXEC="$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX    4JMBeanServerBuilder -Dcc.library.dir=$LIBDIR -Djetty.logs=$JETTY_LOGS -jar $LAUNCHE    R $@ -jmxport 8100 -webport 8180 -rmiport 1199"
echo $EXEC
$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX4JMBea    nServerBuilder "-Dcc.library.dir=$LIBDIR" "-Djetty.logs=$JETTY_LOGS" -jar "$LAUNCHER    " $@ -jmxport 8100 -webport 8180 -rmiport 1199 &

# create symbolic link

[root@fedora12 ~]# sudo ln –s /usr/local/cruisecontrol-bin-2.8.4 /opt/cruisecontrol
/opt/cruisecontrol/cruisecontrol.sh

# CruiseControl dashboard 



Saturday, August 7, 2010

Enterprise Linux: SVN + SSH on Fedora12


[root@fedora12 ~]# uname -a
Linux fedora12.local.lab 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686 i386 GNU/Linux

[root@fedora12 ~]# umask 002
[root@fedora12 ~]# yum install subversion
[root@fedora12 ~]# yum update sqlite

# go to root of repositories

[root@fedora12 ~]# mkdir –p /srv/svn_repo/
[root@fedora12 ~]# chown -R root:svn /srv/svn_repo
[root@fedora12 ~]# chmod -R 775 /srv/svn_repo

# user supplementary group for access control

[root@fedora12 ~]# id qxie
uid=506(qxie) gid=506(users) groups=506(users),502(svn)

# enable Subversion+SSH - hide root of repositories

[root@fedora12 ~]# mv /usr/bin/svnserve /usr/bin/svnserve.bin
[root@fedora12 ~]# cat /usr/bin/svnserve
#!/bin/sh
# wrap in order to put root in by default
exec /usr /bin/svnserve.bin -r /srv/svn_repo "$@"
[root@fedora12 ~]# chmod 755 /usr/bin/svnserve

# create repo for my_project

[root@fedora12 ~]# svnadmin create /srv/svn_repo/my_project

# edit /srv/svn_repo/my_project/conf/svnserve.conf with below uncomments

anon-access = none
auth-access = write

[qxie@fedora12 ~]$ svn list svn+ssh://qxie@fedora12.local.lab/my_project

# source tree is going to import

[root@fedora12 ~]# find /tmp/svn_import/
/tmp/svn_import/
/tmp/svn_import/test_cases
/tmp/svn_import/test_cases/tags
/tmp/svn_import/test_cases/branches
/tmp/svn_import/test_cases/truck
/tmp/svn_import/test_cases/truck/test_cases
/tmp/svn_import/test_cases/truck/test_cases/dir
/tmp/svn_import/test_cases/truck/test_cases/dir/case2.txt
/tmp/svn_import/test_cases/truck/test_cases/case1.txt

# svn import

[qxie@fedora12 ~]$ cd /tmp/svn_import
[qxie@fedora12 svn_import]$ svn import test_cases svn+ssh://qxie@fedora12.local.lab/my_project -m "initial commit"
[qxie@fedora12 ~]$ svn list svn+ssh://qxie@fedora12.local.lab/my_project
branches/
tags/
truck/

# create branch

[qxie@fedora12 ~]$ svn copy svn+ssh://qxie@fedora12.local.lab/my_project/truck svn+ssh://qxie@fedora12.local.lab/my_project/branches/dev_1_br -m "creating dev_1_br"

# create tag

svn copy svn+ssh://qxie@fedora12.local.lab/my_project/truck svn+ssh://qxie@fedora12.local.lab/my_project/tags/tag_R1.0 -m "creating tag R1.0"

# rapdisvn GUI

[root@fedora12 ~]# yum install rapdisvn


# checkout with rev

[qxie@fedora12 ~]$ svn co -r2 svn+ssh://qxie@fedora12.local.lab/my_project/branches/dev_1_br r2

svn log

[svn_user@fedora12 ~]$ svn log -r1:2
------------------------------------------------------------------------
r1 | qxie | 2010-08-07 12:44:11 -0400 (Sat, 07 Aug 2010) | 1 line

initial commit
------------------------------------------------------------------------
r2 | qxie | 2010-08-07 12:46:17 -0400 (Sat, 07 Aug 2010) | 1 line

creating dev_1_br

# svn info

[qxie@fedora12 ~]$ svn info
Path: .
URL: svn+ssh://qxie@fedora12.local.lab/my_project/branches/dev_1_br
Repository Root: svn+ssh://qxie@fedora12.local.lab/my_project
Repository UUID: cbc29f11-edc8-4111-9b23-d15b91d85c83
Revision: 2
Node Kind: directory
Schedule: normal
Last Changed Author: qxie
Last Changed Rev: 2
Last Changed Date: 2010-08-07 12:46:17 -0400 (Sat, 07 Aug 2010)
[qxie@fedora12 ~]$ svn info -r2 svn+ssh://qxie@fedora12.local.lab/my_project/branches/dev_1_br
Path: dev_1_br
URL: svn+ssh://qxie@fedora12.local.lab/my_project/branches/dev_1_br
Repository Root: svn+ssh://qxie@fedora12.local.lab/my_project
Repository UUID: cbc29f11-edc8-4111-9b23-d15b91d85c83
Revision: 2
Node Kind: directory
Last Changed Author: qxie
Last Changed Rev: 2
Last Changed Date: 2010-08-07 12:46:17 -0400 (Sat, 07 Aug 2010)