參考資料來源
http://solar.ee.cyu.edu.tw/linux/opentools/c1359.html
Bug tracking system臭蟲追蹤也是一種程式歷史紀錄, 一個程式開發一定會有bug,對於後來維護人員,需要知道發生什麼原因, 怎麼解決的,是誰負責的等等資訊。 gnats是GNU發展的一套臭蟲追蹤系統,也包含了臭蟲回報(bug report)
通常臭蟲回報是developer與tester之間溝通的管道與記錄, 但也可以用在顧客的回報系統中, 這在customer這邊是非常快速的紀錄系統,客戶可以直接從web回報問題, 問題的紀錄也同時進入公司內部的系統。 產品經理可以根據這個在系統上的資訊,指派一個工程師來負責, 非常方便。所以他不僅可以用做程式臭蟲追蹤,也可以成為專案管理軟體。
gnats可以用普通的email就可以自動做回報的工作,也可以client/server的回報, 一個問題回報在gnats的術語叫PR(problem report)。一個PR通常有ID識別, 日期,狀態(open/closed),機密等級(confidential)等等元素
PR記錄也可以彙整進RDBMS(資料庫)
GNATS_ROOT是gnats管理的database目錄所在 如果是從source自己compile安裝的在 prefix/share/gnats/gnats-db 如果是rpm或deb這樣的distribution套件方法安裝 也可能在/var/lib/gnats/gnats-db下 這下面的檔案是gnats用來管理的
gnats-adm 目錄 gnats-queue 目錄 pending
|
gnats-adm下面的檔案很重要
categories config 這個檔案記錄了gnats的一些default值 重要 responsible states submitters
|
安裝gnats prefix/share/gnats或/var/lib/gnats放了需要管理的project名單(categories) 裡面的檔案就是host名字也就是site(因為這是拿來做tech support) 每個檔案裡放了需要回報的專案名稱 例如我有一個檔 /var/lib/gnats/zeus的內容
表示zues這台機器(site)管了gcc gdb這兩個project的問題回報
使用email回報時必需用email alias,在`/etc/aliases'裡 , 在gnats的機器建立一個email alias, 用像vacation的方法pipe到queue-pr這隻script來
gnats-admin: gnats bugs: "| /usr/lib/gnats/queue-pr -q" query-pr: "| /usr/lib/gnats/mail-query"
或者小心目錄不一樣,總之要找到queue-pr mail-query的程式所在
bugs: "| exec-prefix/libexec/gnats/queue-pr -q"
|
gnats這個帳號應該已經設起來了,Home 目錄可以設在GNATS_ROOT bugs可以亂取名字的只是用email的To:這個欄位要填的收件人就對 有可能是/etc/mail/aliases,設完後給個
使用client/server方法時必需有gnatsd這隻deamon
/etc/services support 1529/tcp # GNATS
/etc/inetd.conf support stream tcp nowait gnats /usr/sbin/tcpd /usr/lib/gnats/gnatsd
|
同樣的目錄可能不同distribution不一樣
有下面四隻程式會被用到
send-pr 回報問題的人用的(tester, customer) query-pr developer查詢整個database,通常是給查詢條件(regular express), 找出一群符合條件的PR。例如PR狀態是還open的(表示問題還沒解決)。 edit-pr developer修改PR(problem report) view-pr developer看某一特定pr
|
一個PR的應該有大致的元件如下 1. Mail headers 像電子郵件開頭的協定字串。 2. GNATS fields 一個field就是像資料庫內的欄位,例如姓名,年齡這種欄位。 由'>'開始最後有個':'. 一個field的資料形態有可能是 文字(TEXT), 數字(ENUMERATED其實是c裡面的enum所以可以是代表數字的文字), 或多行文字(MULTITEXT), 在命令列上下send-pr,會去叫出vi來
SEND-PR: -*- send-pr -*- SEND-PR: Lines starting with `SEND-PR' will be removed SEND-PR: automatically as well as all comments (the text SEND-PR: below enclosed in `<' and `>'). SEND-PR: SEND-PR: Please consult the document `Reporting Problems SEND-PR: Using send-pr' if you are not sure how to fill out SEND-PR: a problem report. SEND-PR: SEND-PR: Choose from the following categories: SEND-PR: apache bfd binutils SEND-PR: bison build byacc To: support-site Subject: complete this field From: your-login@your-site Reply-To: your-login@your-site X-send-pr-version: send-pr 3.11 X-GNATS-Notify:
>Submitter-Id: your submitter-id >Originator: your name here >Organization: your organization >Confidential:[ yes | no ] (one line) ->回答yes/no只有一行不能多行 >Synopsis: synopsis of the problem (one line) >Severity: [non-critical | serious | critical](one line) >Priority: [ low | medium | high ] (one line) >Category: name of the product (one line) >Class: [sw-bug | doc-bug | change-request | support] >Release: release number (one line) >Environment: machine, os, target, libraries (multiple lines) ......
|
SEND-PR:是註解欄會自動消失的,不會進database裡面,跟那個CVS很像。 apache bfd binutils.... 這些是在prefix/share/gnats下的檔案內容的project, 這也是>Category要填的值, 其中在郵件的`Subject:' 和在GNATS欄位中的`>Synopsis:' 通常是一樣的值, 只是mail的主題,通常是問題摘要
To: bugs@xxx (就是上面email aliases的address) Subject: 就是問題的摘要 From: xxx@host
>Submitter-Id: 系統會自動給這個PR 一個ID >Originator: 你的名字 >Organization: 你的單位 >Confidential:[ yes | no ] (one line) >Synopsis: 可以跟Mail Header的Subject一樣 >Severity: [non-critical | serious | critical](one line) >Priority: [ low | medium | high ] (one line) >Category: name of the product (one line) >Class: [sw-bug | doc-bug | change-request | support] >Release: release number (one line) >Environment: machine, os, target, libraries (multiple lines) ......
|
其餘欄位就照著提示填, 把每一欄位填完後離開editor會問你要不要送出
用query-pr去看gnats database結果
query-pr --full 全部資訊都輸出 --summary 只印出重要資訊 --sql 輸出成SQL格式
-c "category" (專案名稱) -C "confidential" -e "severity" -r "responsible" (誰負責的) -s "state" (open/closed/ gnats-id (每個PR都有個ID來識別)
edit-pr gnats-id view-pr gnats-id
|
emacs上有gnats的命令,請下send-pr命令
後記:公司的Bug tracking system要增加一個專案名稱,搞了我三天,原來是linux的權限問題,因為這個系統已經架好,只是要增加名稱,原來的負責架設的人終於出差回來,所以問題也迎刃而解,還是要好好學習linux。
1 則留言:
很久沒看到新的大作了...是不是該再來一篇啦...
張貼留言