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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
aboy
July 06, 2022
Programming
660
2
Share
OSS貢献を気軽にしたい Let's Go Talk #1
Let's Go Talk #1でのLT資料です
aboy
July 06, 2022
More Decks by aboy
See All by aboy
生成AIで日々のエラー調査を進めたい
yuyaabo
0
1k
みんなでエラー監視するSRE夕会の効果_ゆるSRE勉強会1
yuyaabo
1
730
Go 1.19.1 security fix net/url JoinPath
yuyaabo
1
550
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
620
Other Decks in Programming
See All in Programming
要はバランスからの卒業 #yumemi_grow
kajitack
0
170
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
370
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
Agentic Elixir
whatyouhide
0
450
Programming with a DJ Controller — not vibe coding
m_seki
3
860
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
190
Are We Really Coding 10× Faster with AI?
kohzas
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
ハーネスエンジニアリングとは?
kinopeee
13
7.1k
Back to the roots of date
jinroq
0
870
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Faster Mobile Websites
deanohume
310
31k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
250
Navigating Weather and Climate Data
rabernat
0
190
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
570
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
290
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
280
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
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