(English version here)
æè¡é¨ã¢ãã¤ã«åºç¤ã°ã«ã¼ãã®ã´ã¡ã³ãµã³(@vincentisambart)ã§ããä»æ¥ã¯æè¿ä½ã£ããã¼ã«ãDokumiãã®è©±ããããã¨æãã¾ãã
ç´¹ä»
ä»é¨ç½²ã®ã¨ã³ã¸ãã¢ã®ä»äºããã£ã¨æ¥½ã«ãããã¨ããæè¡é¨ã®éè¦ãªç®çã®1ã¤ã§ãããã®ä¸ã§ãDokumiã¯ã¢ãã¤ã«éçºè ã®ã³ã¼ãã¬ãã¥ã¼ã®è² è·ãæ¸ããããã®ãã¼ã«ã§ãã
ãªããæ¯å³ãã¨ããååã«ãããã¨è¨ãã¨ã人éãã¬ãã¥ã¼ããåã«ãã³ã¼ãã«æ¯(ãã°ãä¸èªç¶ãªã³ã¼ããªã©)ãå ¥ã£ã¦ãããã©ããæ¯å³ãããã¼ã«ã ããã§ããå¥ã®è¨èã§è¨ãã¨ãå°ãé²åããCIç¨ã®lintãã¼ã«ã§ãããpull requestãåºã度ã«ãJenkinsããã®pull requestã«Dokumiãããã¾ããç¾å¨ã¯Dokumiã¯iOSã¢ããªã ãã«å¯¾å¿ãã¦ãã¦ãã¾ãããä»å¾ã¯Androidã¢ããªã¸ã®å¯¾å¿ãèãã¦ãã¾ãã
ç¾æç¹ã§Dokumiã¯ä»¥ä¸ã®ãã¨ããã£ã¦ãã¾ãã
- éç解æ(Xcodeã®ãAnalyzeãæ©è½)ãããã¾ãã
- èªåãã¹ããèµ°ããã¾ãã
- ã³ãããããããã©Xcodeã®ãã¼ã¸ã§ã³ãã¼ã¿ããå¤ãã£ã¦ããªãXIB/Storyboardãã¡ã¤ã«ãææãã¾ãã
- pull requestã«milestoneãæå®ããã¦ããªãã¨ãããææãã¾ãã
- éç解æãèªåãã¹ããèµ°ãããããã«ã¢ããªããã«ãããã®ã§ããã«ãä¸ã«åºã¦ããè¦åãã¨ã©ã¼ãåæã«æ¾ãã¾ãã
以ä¸ã®ãã£ããã£ã¼ã§è¦ãããããã«ãDokumiã¯ãGitHub Enterpriseã¨é£åãã¦ãææãpull requestã®ã³ã¡ã³ãã¨ãã¦æ稿ãã¾ããææã®å¯¾è±¡ããã®pull requestã§å¤ããè¡ã§ããã°ãè¡ã«ã³ã¡ã³ããä»ãã¾ãã対象ãå¤ãã£ã¦ããªãè¡ã§ããã°ãpull requestã¨é¢ä¿ãããããªãã®ã¯æ®éã®ã³ã¡ã³ãã«ã¾ã¨ãã¦æ稿ãã¾ããpull requestã¨é¢ä¿ãªããããªãã®(ä¾ãã°ãã®pull requestã§å¤ãã£ã¦ããªããã¡ã¤ã«ã«åºãè¦å)ã¯ç¡è¦ããã¾ãã
ã¡ãªãã
Xcodeã®TestãAnalyzeã¯ãéçºè ãèªåèªèº«ã§ããããã¨ãã§ãã¾ãããæéããããããããã®ãå¿ããæãããã¾ããã¾ãã gitã«å¤æ´ãå ¥ããã®ãå¿ãããã¨ãããã¾ãããªã®ã§Dokumiã¯ãã¹ã¦ã®pull requestã«å¼·å¶çã«ããã¾ããå ã¿ã«Xcodeã®éç解æã®ãé°ã§äººéãã¬ãã¥ã¼ããã³ã¼ãã§ãä¸å ·åãå¤ãªã³ã¼ããè¦ã¤ãããã¨ãã§ããã®ã§ãã£ã¦ã¿ããã¨ããããããã¾ãã
ã¾ããç´æ¥GitHub Enterpriseã®pull requestã«ã³ã¡ã³ããä»ããã¡ãªããã大ããã¨æãã¾ããpull requestã®åº¦ã«èªåãã¹ããèµ°ãããã®ã¯ã以åããè¡ããã¦ãã¾ããããããã失æãããã¹ããç¥ãã«ã¯ãJenkinsã®ãã°ã®xcodebuildã®åºåãè¦ããããªããç°¡åã§ã¯ããã¾ããã§ããã
å®ã¯å ã Dokumiã®çµæã¯ã¦ã§ããã¼ã¸ã¨ãã¦æ´ãããã¨æã£ã¦ããããã©ãè¯ããã¶ã¤ã³ãæãã¤ããªãã£ããããããããã¶ã¤ãã¼ã«é ¼ãã§ããªâ¦ã¨æã£ã¦ããããåã«ãæ®éã®äººéã®ã¬ãã¥ã¼ã¨åãããã«ããã°ããã ãã ã¨æ°ã¥ãã¾ããã
å°ã£ããã¨
GitHubã®APIã使ã£ã¦å®è£ ãããã¨ããæã«ãç¹å®ã®è¡ã«ã³ã¡ã³ããä»ããã«ã¯ç¾æç¹(2015å¹´6æé )ã®APIã§ã¯ä¸è¶³ãã¦ããã¨ãããããã¨æ°ã¥ãã¾ããã
ç¹å®ã®è¡ã«ã³ã¡ã³ããä»ããã¨ã³ããã¤ã³ãã®èª¬æãè¦ãã¨ãæå®ããå¿ è¦ããã®ã¯ãThe line index in the diff to comment on.ãã§ãããã¡ã¤ã«ã®è¡çªå·ã§ã¯ãªãdiffã®ä¸ã®è¡çªå·ã§ãããdiffããè¨ç®ãããããªãâ¦ããã¦ããã ãã ã£ããã¾ã ãããããããAPIã§diffãåå¾ããæ¹æ³ããªãâ¦
GitHubã¯pull requestã®URLã«.diffã.patchãä»ããã¨diffãåå¾ã§ããã®ã§ããããã®diffã¯pull requestã®ã³ã¡ã³ãã«ä½¿ããã¦ããdiffã¨ç¸éãããã¾ãï¼ãã¡ã¤ã«åå¤æ´ã®å¯¾å¿ãéãã¾ãã.diff/.patchã§åå¾ã§ããdiffã¯ãã¡ã¤ã«åå¤æ´ãï¼
- æ§ãã¡ã¤ã«åã®åé¤
- æ°ãã¡ã¤ã«åã®è¿½å
ã«ãªãã¾ããpull requestã®ã³ã¡ã³ãã§ä½¿ããã¦ããdiffã¯ãã¡ã¤ã«åå¤æ´ãï¼
- ãã¡ã¤ã«åå¤æ´èªä½
- å¤ãã£ã¦ããè¡ã ãã®è¿½å ã»åé¤
ã«ãªãã¾ããgitãã³ãã³ãã©ã¤ã³ã§ä½¿ãã¨ãgit diff
ã« --find-renames
(ç¥ãã¦-M
) ãä»ãããã©ããã®éãã¨åãã§ãã
GitHubã®APIã§åå¾ã§ããdiffã« find-renames
ãæå®ã§ããªããªãã©ãããã°ããã®ã§ããããããã¾Dokumiã¯ã¬ãã¸ããªãæå
ã§cloneãã¦ãRuggedã¨ããã©ã¤ãã©ãªã使ã£ã¦diffãè¨ç®ãã¾ããããè¨ç®ã®ããæ¹ãGitHubã®ã¨éã£ã¦ããã°ããºã¬ãåºã¦ããå¯è½æ§ãããã¾ãããããã§ã大ããªåé¡ã«ãªããªãã§ãããã
pull requestã§new-feature
ãmaster
ã«ãã¼ã¸ãããã¨ä»®å®ããã¨ãåã®ç解ãåã£ã¦ããã°ãpull requestã®ãã¼ã¸ã«åºã¦ããdiffãã³ãã³ãã©ã¤ã³ã§è¦ããã¨ãã¯ï¼
$ git diff --find-renames `git merge-base new-feature master`..new-feature
質åã³ã¼ãã¼
ã©ã®è¨èªã§å®è£ ããã¦ãã¾ããï¼ Rubyã§ãããåèªèº«ãæããRubyã使ã£ã¦ãã¾ããã社å ã«ã¯Rubyã¨ã³ã¸ãã¢ãå¤ãããã§ãã
ã©ããã£ã¦è¦åãã¨ã©ã¼ãæ¾ã£ã¦ããã®ã§ããï¼ ä¸»ã«æ£è¦è¡¨ç¾ã使ã£ã¦xcodebuildã®åºåããæ¾ã£ã¦ããã ãã§ããéç解æã®ææã¯xcodebuild analyzeããã«ããã£ã¬ã¯ããªã«çæããplistãã¡ã¤ã«ãè¦ã¦ãã¾ãã
ãªã¼ãã³ã½ã¼ã¹åã®äºå®ã¯ããã¾ããï¼
ã¾ã æªå®ã§ããã©ã®ç°å¢ã§ãåãããã«ããã«ã¯ã³ã¹ããé«ãã¨æãã¾ãããä»äººã使ããªããã®ããªã¼ãã³ã½ã¼ã¹ããæå³ããã¾ãæããªãã§ãããã§ãå®è£
ã«é¢ãã質åããã°ãçããã¾ããã½ã¼ã¹ã³ã¼ããGitHubã«ã¦å
¬éããã¾ããã