GitHub增加拉取請求草稿功能
GitHub增加拉取請求草稿功能
News from: iThome & The GitHub Blog.
對於暫時沒有被合併需求,或是還沒開始撰寫程式碼,開發者僅想要先與其他成員進行討論,則可以先使用拉取請求草稿,需要時再轉為正式拉取請求。
GitHub現在提供開發者簡單方便的拉取請求草稿(Draft Pull Requests)功能,開發者可以在原本創建拉取請求的綠色按鈕旁找到下拉箭頭,點擊新增的創建拉取請求草稿選項,就能開始使用拉取請求草稿。拉取請求草稿無法被合併,除非作者改變其狀態為準備審核(Ready for Review)才能被合併。
GitHub提到,雖然他們認為開發者有好點子時,就能創建拉取請求開始與其他協作者溝通對話,即便這個拉取請求最後因為特定原因關閉,或是程式碼整個重構了,也都是合作的一部分。不過,如果開發者發出請求的目的只是想要開啟對話,而程式碼尚未在任何可被評斷的狀態,或是在黑客松活動中,開發者希望其他人可以查看他的程式碼並給予回饋,甚至是開發者還沒有任何程式碼,僅是想要開啟與其他協作者的討論。這些暫時沒有合併需求的拉取請求,就能使用拉取請求草稿。
開發者只要在原本拉取請求的按鈕,點擊旁邊的下拉箭頭,就能創建拉取請求草稿。拉取請求草稿可以讓開發者清楚的標記程式開發工作的進度,其樣式與原本的拉取請求不同,有很清楚的視覺提示其處於草稿狀態,拉取請求草稿無法被合併,開發者需要點選拉取請求中的準備審核按鈕以移除草稿狀態,並在專案設定中允許合併。
而在程式碼儲存庫中有CODEOWNERS檔案的管理員,其創建的拉取請求草稿將不會對審查者發出通知,除非拉取請求草稿被標記為準備審查。
-----------------------------------------------------------------------------
開發者只要在原本拉取請求的按鈕,點擊旁邊的下拉箭頭,就能創建拉取請求草稿。拉取請求草稿可以讓開發者清楚的標記程式開發工作的進度,其樣式與原本的拉取請求不同,有很清楚的視覺提示其處於草稿狀態,拉取請求草稿無法被合併,開發者需要點選拉取請求中的準備審核按鈕以移除草稿狀態,並在專案設定中允許合併。
而在程式碼儲存庫中有CODEOWNERS檔案的管理員,其創建的拉取請求草稿將不會對審查者發出通知,除非拉取請求草稿被標記為準備審查。
-----------------------------------------------------------------------------
At GitHub, we’ve always felt that you should be able to open a pull request to start a conversation with your collaborators as soon as your brilliant idea or code is ready to take shape. Even if you end up closing the pull request for something else, or refactoring the code entirely, a good pull request is as much about collaboration as it is about code.
But what if you want to signal that a pull request is just the start of the conversation and your code isn’t in any state to be judged? Perhaps the code is for a hackathon project. You have no intention of ever merging it, but you’d still like people to check it out locally and give you feedback. Or perhaps you’ve opened a pull request without any code at all in order to get the discussion started.
Tag your work in progress
With draft pull requests, you can clearly tag when you’re coding a work in progress. Now when you open a pull request, a dropdown arrow appears next to the “Create pull request” button. Toggle the dropdown arrow whenever you want to create a draft instead.
A draft pull request is styled differently to clearly indicate that it’s in a draft state. Merging is blocked in draft pull requests. Change the status to “Ready for review” near the bottom of your pull request to remove the draft state and allow merging according to your project’s settings. Also, if you have a CODEOWNERS file in your repository, a draft pull request will suppress notifications to those reviewers until it is marked as ready for review.
留言
張貼留言