Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OSS貢献を気軽にしたい Let's Go Talk #1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
aboy
July 06, 2022
Programming
2
650
OSS貢献を気軽にしたい Let's Go Talk #1
Let's Go Talk #1でのLT資料です
aboy
July 06, 2022
Tweet
Share
More Decks by aboy
See All by aboy
生成AIで日々のエラー調査を進めたい
yuyaabo
0
980
みんなでエラー監視するSRE夕会の効果_ゆるSRE勉強会1
yuyaabo
1
710
Go 1.19.1 security fix net/url JoinPath
yuyaabo
1
540
HTTPステータスコードが意図した値にならないとき Let's Go Talk #2
yuyaabo
1
550
困ったときが学びどき.pdf
yuyaabo
0
650
Build dynamic iOS apps with the Create ML framework の要約
yuyaabo
0
1.2k
fastlaneベースでTravis CIからBitriseに移行しました
yuyaabo
0
1.8k
Mixpanelのすゝめ
yuyaabo
0
3k
Use model deployment and security with Core MLの要約
yuyaabo
2
610
Other Decks in Programming
See All in Programming
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
240
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
290
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
420
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
390
安いハードウェアでVulkan
fadis
0
250
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1k
CSC307 Lecture 14
javiergs
PRO
0
470
20260315 AWSなんもわからん🥲
chiilog
2
160
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.2k
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
400
SourceGeneratorのマーカー属性問題について
htkym
0
200
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Crafting Experiences
bethany
1
89
Building Applications with DynamoDB
mza
96
7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Darren the Foodie - Storyboard
khoart
PRO
3
2.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
830
Transcript
OSS貢献を気軽にしたい 2022/07/06 Let’s Go Talk #1 5分LT
自己紹介 - aboyです - コネヒト株式会社 - 最近はママリの検索を最高にする仕事をしてます - あと最近GoをさわっていてTech VisionのGo戦略を推進中
モチベーション - 普段お世話になっているOSSに貢献したい - Goさわりたてなので簡単なことから始めたい
Go Report Cardっていうのがあるぞ - https://goreportcard.com/ - Go製プロジェクトのREADMEによくあるこのバッヂ - 指定したプロジェクトに静的解析をかけてスコア化してくれる
Go Report Cardを使ってOSS貢献を始める - gocycloとlicense以外は、どう修正したらいいかがわかりやすい - Go初学者でもPRを送りやすい - misspellだって、あってもいいことは何も無いので、立派な貢献 -
少なくとも見つけたらそのままにしない gorilla/schemaのmisspellの例
👏 ※ gorillaのメンテナ事情(切実)https://github.com/gorilla/mux/issues/659
他の人の背中も押したいぞ - OSS貢献したいけど、ハードルや面倒さを感じてる人の背中を押したい - 入口がmisspellの修正でも、成功体験からさらにGoに興味を持ってくれると嬉しい - 自分たちがお世話になっているOSSへ貢献するという行動を当たり前にできると嬉しい - 仕組み化したい -
ある程度は仕組み化して自動化や横展開できると嬉しい
ツールをつくった(ってる) - https://github.com/YuyaAbo/gontribute - Go Report CardはCLIが提供されてる - https://github.com/gojp/goreportcard/tree/master/cmd/goreportcard-cli -
自分たちのプロジェクトのgo.modに書かれているrequireに対してCLIを適用 すればやりたいことできそう
デモ
実装 1. GitHub APIをつかって指定リポジトリのgo.modを取得する 2. go.modをパースする(後述) 3. requireに対してGitHub APIをつかってアーカイブリンクを取得する 4.
アーカイブリンクからzipをダウンロードする 5. zipを展開 6. 展開先のディレクトリでGo Report Card CLIを実行 7. 展開したディレクトリを削除 8. 3~7を繰り返す
go.modのパース - 準標準パッケージmod/modfileで可能 - https://pkg.go.dev/golang.org/x/mod/modfile fc, _, _, err :=
client.Repositories.GetContents(ctx, owner, repo, "go.mod", nil) if err != nil { log.Fatalln(err) } s, err := fc.GetContent() if err != nil { log.Fatalln(err) } f, err := modfile.Parse("go.mod", []byte(s), nil) if err != nil { log.Fatalln(err) }
あとは愚直オブ愚直 - exec.Commandでコマンド実行 - ↓こんな感じ b, err := exec.Command("zipinfo", "-1",
zipFileName).Output() if err != nil { log.Println(err) return } dirName := strings.Split(string(b), "/")[0] if err = exec.Command("unzip", "-o", zipFileName).Run(); err != nil { log.Println(err) return }
まとめ - 自分たちが使っているOSSに気軽に貢献したい、する人を増やしたい - Go Report Cardを使えば比較的簡単な貢献チャンスに気づける - Go Report
Card CLIを使って仕組み化するようなツールを作ってみた - 引き続きいい感じに作っていくぞ!
fin