12.5 參與 Mozilla Firefox OS 開發的流程

  Firefox OS 所有的 bug 都是在 Bugzilla@Mozilla 平台上管理的。因此,第一步當然是先到 Bugzilla 認領一個您想修的 bug (建議從簡單的 good first bug 開始)。或者,您也可以在 Bugzilla 上建立一個新的 bug。
  接下來,有一些前置作業要完成。請先在 GitHub 上 fork 它所屬的 repository,例如 Firefox OS 的前端 Gaia:mozilla-b2g/gaia。接著請回到您的本地端,執行以下指令:
$ git clone https://github.com/username/gaia.git
$ git remote add upstream https://github.com/mozilla-b2g/gaia.git
  # check if you have added 'mozilla-b2g/gaia' as 'upstream'
$ git remote -v
  每次開始修 bug 之前,請記得從 upstream 抓取更新,使您的本地端 repository 保持在最新狀態。請執行以下指令:
$ git remote update
  # do not use 'git merge upstream/master'
  # use the following command instead
$ git rebase upstream/master
  然後就可以開始修 bug 囉。為了維持簡潔明瞭的 commit log,您應該將所有變更提交為單一一個 commit。您可以參考以下指令:
$ git add filename
  # your commit message should be in the following form
  # Bug id - Description of your patch r=reviewer
$ git commit -m 'your commit message'
$ git push origin master
  再次提醒您,如果您提交了超過一個 commit,請務必將其合併為單一一個 commit。您可以參考以下指令:
  # show the commit history
$ git log
  # n: the number of commits you want to squash
  # please replace 'n' with any positive integer
$ git rebase -i HEAD~n
  # into interactive mode
  # step i. replace 'pick' with 'squash' except for the first line
  # step ii. modify commit messages
$ git log
  # now you should see n commits combined into a single commit
  最後,請至 Mozilla 的 GitHub repository 提出 pull request。同樣地,pull request 的標題必需符合 "Bug id - Description of your patch r=reviewer" 的形式。這時系統應該會自動為您在 Bugzilla 上新增一個 attachment,其檔案名稱即為該 pull request 的網址。請在 attachment 上指定 review flag 給相關負責人。
  負責人檢查過您提交的程式碼後,請到 Bugzilla 為該 bug 新增一個 keyword "checkin-needed",讓系統自動處理您的 pull request。現在就只要等候您的 pull request 被 merge,然後再前往 Bugzilla 將該 bug 的 status 變更為 RESOLVED FIXED,就完成囉。
如何測試 Firefox OS?
  Firefox OS 的架構分為:Gonk > Gecko > Gaia。Gonk 是系統核心,以 Linux Kernel 為基礎。而 Gaia 則是 Firefox OS 的前端,完全採用 HTML、CSS、JavaScript 等網頁程式語言來撰寫。要測試 Firefox OS 最簡單的方法是直接在 Firefox 瀏覽器上模擬。您只要開啟 Firefox,點選右上角的開啟選單 > 開發者 > WebIDE,選擇一個 Runtime (若選單中未出現 Firefox OS,則需先安裝一個 Firefox OS 模擬器),就可以直接執行 Firefox OS 囉。