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
aboy
July 06, 2022
Programming
2
630
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
780
みんなでエラー監視するSRE夕会の効果_ゆるSRE勉強会1
yuyaabo
1
660
Go 1.19.1 security fix net/url JoinPath
yuyaabo
1
510
HTTPステータスコードが意図した値にならないとき Let's Go Talk #2
yuyaabo
1
520
困ったときが学びどき.pdf
yuyaabo
0
630
Build dynamic iOS apps with the Create ML framework の要約
yuyaabo
0
1.1k
fastlaneベースでTravis CIからBitriseに移行しました
yuyaabo
0
1.7k
Mixpanelのすゝめ
yuyaabo
0
2.9k
Use model deployment and security with Core MLの要約
yuyaabo
2
590
Other Decks in Programming
See All in Programming
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
230
AWS発のAIエディタKiroを使ってみた
iriikeita
1
170
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
780
AI時代のUIはどこへ行く?
yusukebe
16
8.4k
OSS開発者という働き方
andpad
5
1.7k
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
490
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.1k
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2k
Honoアップデート 2025年夏
yusukebe
1
920
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
20
10k
Laravel Boost 超入門
fire_arlo
2
210
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
4
2k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
How STYLIGHT went responsive
nonsquared
100
5.8k
Building an army of robots
kneath
306
46k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
13k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Agile that works and the tools we love
rasmusluckow
330
21k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
RailsConf 2023
tenderlove
30
1.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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