OSSã¸ã®ã¡ãã£ã¨ããã³ã³ããªãã¥ã¼ã·ã§ã³ã«æåããã®ã§ãã©ãããæµãã§ã³ã³ããªãã¥ã¼ãããã®ãããã°ã«ç°¡åã«æµããã¾ã¨ãã¦ã¿ããã¨æãã¾ããOSSæ´»åãã¦ã¿ãããã©ã©ãããæµãã§ãããã®ãæ°ã«ãªã£ã¦ããæ¹ã®åèã«ãªãã°å¹¸ãã§ãããªãä»åã®ä¿®æ£Pull Requestã¯ãã¡ãã§ãã
çµç·¯
GitHub App の権限で Songmu/tagpr を利用する - stefafafan の fa は3つです ã¨ãã«ãæ¸ããã®ã§ãããå人çã«ä½ã£ãã©ã¤ãã©ãªã«ãã¡ãã® Songmu/tagpr ãå°å ¥ããã便å©ã«ãªã£ãã®ã§ããã®ã¾ã¾ã¯ã¦ãªã§éç¨ãã¦ãã以ä¸ã®ãªãã¸ããªã¨ãã§ã使ã£ã¦ã¿ã¦ã¯ã©ããã¨ããã°ãã¼ã ã®æ¹ã«ç´¹ä»ãã¾ããï¼èªåã¯ããã°ãã¼ã ã§ã¯ãªãã®ã§ãããSlackã®éè«ãã£ã³ãã«ã§ããããã«ç´¹ä»ãã¾ããï¼ã
ãã®ãã¨è»½ãã¦ã©ãããã¦ãããããªãã次ã®ãªãªã¼ã¹ãã¼ã¸ã§ã³ã v0.0.1 ã«ãªã£ã¦ãã¾ãåé¡ãããå°å
¥ã«æéåã£ã¦ãããã¨ãããã¨ã«æ°ã¥ãã¾ãããèªåã§ä½¿ã£ãã¨ãã¯ããããå°ãã¯ãªãã£ãã®ã§ä¸æè°ã ãªãã¨æããªããéããã¦ãã¾ããï¼æ¬æ¥ãªããã¾åå¨ããã¿ã°ã®æ¬¡ã®ãã¼ã¸ã§ã³ãå¤å¥ãã¦åã£ã¦æ¬²ããï¼ã
github.com
ãããããªãã¨æã£ãã®ã¨ãç´¹ä»ããå´ã¨ãã¦ãªããç³ã訳ãªãã®ãããªãã®ããã£ãã®ã§èªåã§åå ã軽ã調ã¹ã¦ã¿ããã¨ã«ãã¾ããã
ä¸å ·åã®ç¹å®ããã³ä¿®æ£ã¾ã§ã®æµã
èªåãä»åã¯ãã¾ãã¾ä¸æãããã¾ããããä¸è¬åããã¨ä»¥ä¸ã®ãããªæµãã§é²ããã¨OSSã«éããä¸å ·åã®åå ã®ç¹å®ãä¿®æ£ã¾ã§æã£ã¦ãããã¨æãã¾ãã
- ç¶æ³ã®ææ¡
- 仮説ãç«ã¦ã
- åé¡ç¹ãçµãè¾¼ã
- ç¶æ³ãåç¾ã§ããæå°ã®å®è£ ãç¨æ
- 失æãããã¹ããæ¸ã
- å®è£ ãä¿®æ£ãã
ç¶æ³ã®ææ¡
ä»åã®å ´åã¯ããv1.2.0ã®ã¿ã°ãææ°ãªããã次ã«v1.2.1ã®ã¿ã°ãæãããæ³å®ãªã®ã«ãv0.0.1ã«ãªã£ã¦ãããã¨ããç¶æ³ã§ããã
ããã¦GitHub Actionsä¸ã§ä»åã®OSSã¯åä½ããã®ã§ãå½è©²ã®Actionsã®ãã°ã確èªãã¾ããããã°ãã¿ãã¨ããããç¾è¡ãã¼ã¸ã§ã³ã v0.0.0 ã¨èª¤å¤å¥ãã¦ãã¾ã£ã¦ãããã¨ãããã¨ããªãã¨ãªããããã¾ãããã¾ããä¸è¨ã® hatena/hatenablog-workflows ãªãã¸ããªã§ã¯ãã®Actionsãå度å®è¡ãã¦ãã¾ããããä½åº¦ãã£ã¦ãæ¯åãç¾è¡ãã¼ã¸ã§ã³ã v0.0.0 ã¨èª¤å¤å¥ãã¦ãã¾ã£ã¦ãããã«ãªã£ã¦ãã¾ããã
ããã«ç°å¢ã«ã¤ãã¦ããã£ã¦ãããã¨ã¯ãèªåããã¨ã㨠Songmu/tagpr ãå°å ¥ãã hatena/godash ã¨ãããªãã¸ããªã§ã¯ãtagpr ã® v1.1.2 ã使ã£ã¦ãããåé¡ã¯ãªãã hatena/hatenablog-workflows ã§ã¯ v1.1.3 ã使ã£ã¦ããã¨ãããã¨ããããã¾ããã
仮説ãç«ã¦ã
ããã£ã¦ãããã¨ãã仮説ãç°¡åã«ç«ã¦ã¾ããä»åã¯ä»¥ä¸ã®ãããªãã¨ãèãã¾ããã
- hatena/hatenablog-workflows ã®ä½ãããã®è¨å®ã Songmu/tagpr ã®æ³å®ããªããã®ã«ãªã£ã¦ãã
- æããã¦ããã¿ã°ã®å½¢å¼ãä½ãããããã®ãããããªãï¼ (v1.2.0 ã¿ãããªå½¢å¼ã§æããã¦ãããå®ã¯vãå ¨è§ã ã£ãããç¹æ®ãªç©ºç½æåãå«ã¾ãã¦ããããã«ãã¼ã¹ã«å¤±æãã¦ããã¨ã)
- v1.2.0 ã¿ãããªã¿ã°ã¨ v1 ã¿ã°ãæ··åãã¦ãããã©ããã ã¨ä½ãåé¡ã«ãªãã®ãããããªãï¼
- Songmu/tagpr v1.1.3 ã«ä½ãããBreaking changeãå
¥ã£ã¦ãã
- v1.1.2 ã§ã¯å°ãªãã¨ãä»ãªãã¸ããªã§ã¯æ³å®éãã®æåã ã£ããã
大ããäºåããã¨ãèªåãã¡ã®ãªãã¸ããªå´ã®åé¡ãªã®ããOSSå´ãªã®ãã¨ãªãã¾ãããã¡ããOSSã«ä¸å ·åãå ¥ã£ã¦ãããã¨ã¯æ®éã«ããã¾ããã大åã®å ´åã¯å©ç¨ããã¦ããã£ã¦ããå´ã®è¨å®ãã¹ãªã©ã ã£ããããä¸ã«ãæ å ±ä¸è¶³ã®ã¾ã¾issueãªã©ãç«ã¦ã«ãã£ã¦ãè¿·æãªã®ã§ã¾ãã¯èªåãã¡ã®ãªãã¸ããªãçãã¾ãã
åé¡ç¹ãçµãè¾¼ã
ä¸è¨ã®ä»®èª¬ããã¨ã«åé¡ç¹ãçµãè¾¼ã¿ã¾ãã
ä»åãã¹ã¦GitHub Actionsä¸ã§åãã¦ããã®ã§ããã°ã«åºåãããæååãªã©ããã Songmu/tagpr ã®ãªãã¸ããªãæ¤ç´¢ããªãã¨ãªã該å½ã®å¦çãå®è¡ããã¦ãããã¤ã³ããè¦ã¤ãã¾ãã
æçµçã«ã¯ä»¥ä¸ã®ã³ã¼ãã«è¾¿ãçãã¾ããã latestSemverTag
ã¨ããé¢æ°ã®æ»ãå¤ããã¨ã«ç¾è¡ã¿ã°ãå¤å¥ããå¤å¥ã«å¤±æããã v0.0.0 ã¨ãããã¨ããå¦çãããã¾ãããä¸å¿ãã®æç¹ã§ v0.0.0 ã¨æ¸ãã¦ããã®ã§ç¸å½ããããã§ããããªãã¸ããªã®ã³ã¼ãå
¨é¨ãææ¡ãã¦ããããã§ã¯ãªãã®ã§ãããããã¯ããããé«ããã¨ããã¤ããã§è¦ãã¦ãããªããã³ã¼ãã®å¦çã軽ã追ãã¾ããã
github.com
ç¾è¡ã®ã¿ã°ã®ãã¼ã¸ã§ã³ãå¤å¥ããã³ã¼ãã¯ãèªåãä¿®æ£ãå ããåã¯ä»¥ä¸ã®å½¢ã¨ãªã£ã¦ãã¾ããã Songmu/gitsemvers ã¨ããããã«å¥ã®ã©ã¤ãã©ãªã§git tagãã対象ã®ãã¼ã¸ã§ã³ä¸è¦§ãåå¾ãã¦ãããtagpr ã®è¨å®ã§ vPrefix ãæå¹ãã©ããããã¨ã«æåã«ããããããã¼ã¸ã§ã³ãè¿ãã¨ããå®è£
ã«ãªã£ã¦ãã¾ããã
github.com
仮説ã«æ¸ãã¦ãããæããã¦ããã¿ã°ã®å½¢å¼ãä½ãããããã®ãããããªããããv1.2.0 ã¿ãããªã¿ã°ã¨ v1 ã¿ã°ãæ··åãã¦ãããã©ããã ã¨ä½ãåé¡ã«ãªãã®ãããããªããã®èã¨ãã¦ãSongmu/gitsemvers ããæ£ããå¤ãè¿ã£ã¦ããã®ãï¼ãã¨ããã®ãæ°ã«ãªã£ãã®ã§ãæå ã«go install ãã¦æ§åã確èªãã¾ããã
$ go install github.com/Songmu/gitsemvers/cmd/git-semvers@latest $ cd /path/to/hatenablog-workflows $ git-semvers v1.2.0 v1.1.3 v1.1.2 v1.1.1 v1.1.0 v1 v1.0.0
å°ãªãã¨ãæå
㧠git-semvers ãå®è¡ãã¦ãä½ãããããªã¨ããã¯ãªãã®ã§ãlatestSemverTag
ã®å®è£
ã®ç¶ããã¿ã¦ã¿ããã¨ã«ãã¾ãããç¹ã« vPrefix
ã®ç®æãèªãã§ãã¦ããããããããGo Playgroundã§è§¦ããªããå®é¨ãã¾ãããããã¦è§¦ã£ã¦ããä¸ã§éãã¾ããããvPrefixã¯Configã«æå®ã§ãã *bool ãªè¨å®ã ãã©ãä»åã¯è¨å®ãã¡ã¤ã«ãä½ããã«Songmu/tagprãå°å
¥ãããã¨ãã¦ãããããããã¦è¨å®ã nil ãªå ´åã«æå³ããªãæåã«ãªã£ã¦ããã®ã§ã¯ãªãããã
ç¶æ³ãåç¾ã§ããæå°ã®å®è£ ãç¨æ
latestSemverTag
ã®å®è£
ãv1.1.3ã§å¤ãã£ã¦ããã®ããã£ã¦ã¨ã¦ãæªããã¨ãããã¨ã§ãå¼ãç¶ãGo Playgroundã§ç¶æ³ãåç¾ã§ããã確èªãã¾ããã
ã¾ã㯠v1.1.2 æç¹ã®å®è£
ã§ããhttps://go.dev/play/p/GNga-fRcit7
Config ã® vPrefix è¨å®ã®æç¡ãçå½ã«é¢ããããã¨ã«ãã常ã«ææ°ã®ã¿ã°ã®ãã¼ã¸ã§ã³ãè¿ãã¦ãããã¨ã確èªã§ãã¾ããã
次㫠v1.1.3 æç¹ã®å®è£
ã§ããhttps://go.dev/play/p/4cNyuN3lcrt
Config ã® vPrefix ã true ã®å ´åã¯vå§ã¾ãã®æåã®ã¿ã°ãè¿ãããfalseã®å ´åã¯vããå§ã¾ããªãæåã®ã¿ã°ãè¿ãã¨ããã®ã¯ v1.1.3 ã®æå³éãã®æåã«ãªã£ã¦ãããã¨ã¯ç¢ºèªãã¾ãããä¸æ¹ã§è¨å®ã nil ã㤠v ããã¯ãã¾ãã¿ã°ãããªãå ´åã¯ç©ºæåãè¿ããã¨ããããã¾ãããä»åã®ä¸å
·åã®ã±ã¼ã¹ã«ãããã¾ãã
ãã Songmu/tagpr ã»ããã¢ããã§æåã«ã¾ã .tagpr
ãã¡ã¤ã«ãä½ã£ã¦ vPrefix ãã»ãããã¾ãããã¨ããæé ã«ãªã£ã¦ããã®ã§ããã°ãã®å®è£
ã®ã¾ã¾ã§ããã§ãããå¥ã«READMEã¿ã¦ãããã¯ãªã£ã¦ããªãã®ã¨ãä½ããªãã¦ãååã»ããã¢ããæ㯠.tagpr
ãã¡ã¤ã«ãä½ããããããããã¯æããæå³ããªãæåã ã¨å¤æãã¾ããã
失æãããã¹ããæ¸ã
ããã¾ã§ããã£ãã®ã§ããã£ãããªã®ã§ä¿®æ£Pull Requestãä½ã£ã¦ãã¾ãããã§ãã幸ãä»åã¯åå ¥ã£ã¦ããPull Requestããã®ã¾ã¾åèã«ãªãã¾ããã
ä¸è¨Pull Request㧠TestLatestSemverTag
ã¨ãããã¹ããçãã¦ããã®ã§ããã«ä»å失æããç¶æ³ã®ãã¹ãã±ã¼ã¹ã足ãã¾ããOSSã¸ã®Contributeã«éãããä¸å
·åä¿®æ£ã¯ã¾ã失æãããã¹ãã±ã¼ã¹ã足ãã¦CIä¸ã§ãæå³éã失æãããã¨ã確èªãã¦ããä¿®æ£ã«å
¥ããã¨ããããããã¾ãã
å®è£ ãä¿®æ£ãã
ä¸è¨ã®ãã¹ãã失æãããã¨ã確èªãããå®è£ å´ãä¿®æ£ãã¾ãã
ä»åä¿®æ£ããã«ããã£ã¦ãããããã vPrefix ã®å¤ã nil ã®å ´åã®æ£å¸¸ãªæåã¯ä½ãããä¸ç¬ã ãæ¤è¨ãã¤ã³ãã¨ãªãã¾ãããããã©ã«ãå¤ã true ãªã®ã false ãªã®ããã¡ã³ããã«ç¢ºèªãå¿ è¦ãªã®ã§ã¯ãªããï¼
ãã ãããã§æãåºãã¦æ¬²ããã®ã¯ã v1.1.2 ã§ã®æåã®ãã¨ã§ãããã¨ãã¨ã®æåã¯ããã¼ã¸ã§ã³ã®å½¢å¼ããªãã§ããææ°ã®å¤ãè¿ããã§ãããä»åã®å¤æ´ã§çªç¶ä»æ§ãããã«å¤æ´ããã®ã¯æå³ãããããªãããv1.1.2ã®åãã¦ããé ã«æ»ãããã®ãæ¬æ¥ãããããã¨ã®ã¯ããã¤ã¾ããvPrefixã nil ã®å ´åã¯ãã¼ã¸ã§ã³ã®å½¢å¼ãæ°ã«ããææ°ã®å¤ã使ããã§ããã¯ãã
ãããã¦ã§ããã®ããã®ããã°ã®åºç¤ã«ç´¹ä»ããä¿®æ£Pull Requestã§ããvPrefixã nil ã§ãªãå ´å㯠v1.1.3 ã®æåã«ãªãããnilã®å ´å㯠v1.1.2 ã®é ã®æåã®ã¾ã¾ã«ãªãããã«ãã¦ä¿®æ£ãã¾ããã
ä½ããããããªãä¸ä¾¿ã ãªã¨æã£ãã¨ãã«ã¤ãã§ã«ã³ã³ããªãã¥ã¼ããã
ç§ã¯ãã¨ãã¨æ°åã®é ãªã©ã¯OSSã¸ã³ã³ããªãã¥ã¼ããããã¨ã«ãã¼ãã«ãããã¾ãããã¨ã«ããOSSãä½ãã¿ã¤ãã¦ãGood First Issue ã©ãã«ãã¿ã¤ããªãã¨ãããªãã®ãï¼ã³ã¼ããèªãã§ãããªãã¨ãããªãã®ãï¼ã¨çµæ§å¤§å¤ã ãªã¨æã£ã¦ä¸ã ã§ãã¾ããã§ããã
ãæ®æ®µéçºãã¦ããã½ããã¦ã§ã¢ãå©ç¨ãã¦ããã©ã¤ãã©ãªã®ã³ã¼ãããã¨ã«ã³ã³ããªãã¥ã¼ãã§ããã°ãããã¿ãããªãã¨ãè¨ããã¦ãããããã¨æããªãããå½åã¯ãã¾ãããç解ã§ãã¦ããªãã£ãã¨æãã¾ãããã ä»åãããã¦ã¿ãã¨æå³ã¯ããã£ã¦ããããã«æãã¾ããã
çµå±ã¯æ®éã«ä»äºããã¦ãã¦ãèªåã®ææ¡ãã¦ãããªãã¸ããªã®ã³ã¼ãã«ããä¸å ·åã¯æ®éã«æ²»ãã¦ããã¯ãã§ããããã調æ»ããã¦å®ã¯åå ãå¤é¨ã«ããã¨ããã£ãããå¤é¨ã®ãã¨ã¯ããããªãããã¨è«¦ããã®ã§ã¯ãªãã¦å¤é¨ã®OSSãã¿ã«ãããã¨ãã³ã³ããªãã¥ã¼ãã¸ã®ä¸æ©ã ã¨æãã¾ãã
å¥ã«æåããã³ã¼ãä¿®æ£ã¯ããå¿ è¦ã¯ãªããã¾ãåãããã«å°ã£ã¦ãã人ãããªããissueã§æ¤ç´¢ãã¦ããããããã®è°è«ãèªããããããããä½ãããã®æå³ããã£ã¦ãããªã£ã¦ãããããããªãããæ«å®çãªå¯¾å¦æ³ãããã£ã¦ããããããã¾ãããissueãè¦å½ãããªãå ´åã¯åç¾æ¹æ³ãã¾ã¨ãã¦èªåã§issueãç«ã¦ã«è¡ãã®ãã³ã³ããªãã¥ã¼ãã®ä¸ã¤ã§ããã
ãªã®ã§ãã³ã³ããªãã¥ã¼ãã§ããªãã¦ãç¦ããã¨ã¯ãªããéåæãæããã¨ããå°ã£ãã¨ãã«å°ãå¤ã®ä¸çãè¦ã«è¡ããããããã¯ããã¾ãããã¨æ¹ãã¦æã£ã次第ã§ãããã®ããã°è¨äºã¯æ°åã®é ã®èªåã«åãããã®ã§ãããã¨ãããã¨ã§ããã