Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
モノレポにおける path-filtering利用時でも GitHub ステータスのRequi...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
tokizo
October 24, 2022
Programming
1.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
モノレポにおける path-filtering利用時でも GitHub ステータスのRequiredを 機能させたい!
tokizo
October 24, 2022
More Decks by tokizo
See All by tokizo
徐々に増えているSwiftUI Anchor関連API
tokizuoh
1
1.2k
iOS 曜日ランキングが出来上がるまで
tokizuoh
0
2.8k
メインスレッドをブロックさせないためのSwift Concurrencyクイズ
tokizuoh
1
6k
運動モチベーション継続のためのiOSアプリ開発
tokizuoh
0
1.1k
Xcode 15 で swift run が遅い
tokizuoh
0
3.9k
累積和で配列の処理効率を改善しよう
tokizuoh
0
770
Other Decks in Programming
See All in Programming
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
100
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
200
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
SODA - FACT BOOK(JP)
sodainc
1
40k
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
220
オーケストレーション記述言語 Katari
yukikurage
0
250
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.2k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.6k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
530
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
My Coaching Mixtape
mlcsv
0
380
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
290
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
610
Transcript
2022.10.24 【オンライン】CircleCIユーザーコミュニティミートアップ tokizo / @tokizuoh モノレポにおける path-filtering利用時でも GitHub ステータスのRequiredを 機能させたい!
自己紹介 ・ tokizo (@tokizuoh) ・ 株式会社はてな マンガアプリチーム所属 ・ iOSアプリエンジニア 2
https://github.com/tokizuoh/circleci-test-2022-10-01 今日のコード
LTの流れ GE path-filtering, GitHub ステータス利用時の問 E 問題解決のアプローチ手Ç ÅE アプローチ手法の課題 3
4 % path-filtering, GitHub ステータスのRequired 利用時の問題
5 まずは用語の説明
用語 ・path-filtering ・GitHub ステータスのRequired 6
用語 ・path-filtering ・GitHub ステータスのRequired 7
path-filtering *1 ・CircleCI公式のOrb ・変更されたファイルに応じてパイプラインパラメータを 制御できる *1 https://circleci.com/developer/ja/orbs/orb/circleci/path-filtering 8
path-filtering *1 ・CircleCI公式のOrb ・変更されたファイルに応じてパイプラインパラメータを 制御できる *1 https://circleci.com/developer/ja/orbs/orb/circleci/path-filtering 9 ⇒ コミットに応じて実行する
ワークフローを動的に変更できる コミット内容に応じて 実行するワークフローを 動的に変更できる
path-filtering 利用時の流れ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI
10
path-filtering 利用時の流れ 11 /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job
CircleCI 変更あり
path-filtering 利用時の流れ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI
変更あり 12
path-filtering コード .circleci/config.yml 13
path-filtering コード .circleci/config.yml ① androidディレクトリ配下に変更があれば build-android をtrueに ② 反映した値は後続の設定ファイルに引き継がれる ①
② 14
path-filtering コード 15 .circleci/continue-config.yml
path-filtering コード 16 .circleci/continue-config.yml
path-filtering メリット ・コミット内容に応じて実行するワークフローを動的に 変更できる ⇒ 不必要なビルドを行わなくて済む 17
用語 ・path-filtering ・GitHub ステータスのRequired 18
GitHub ステータス *2 ・ 少しややこしい ・ GitHub Checks ・ GitHub
ステータス (今日はこっち) ⇒ CircleCIではジョブごとに列挙 *2 https://circleci.com/docs/ja/enable-checks/ 19
GitHub ステータス 20
GitHub ステータスのRequired 21
path-filtering, GitHub ステータスのRequired 利用時の問題 22
問題 ・path-filteringを使うとGitHub ステータスの RequiredにPRのマージ時にグリーンになってほしい ジョブを指定できない ⇒ 安全にPRをマージできない! 23
問題 /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI Required
Required 24
問題 /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI Required
Required 変更あり 25
問題 /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI Required
Required 変更あり 26
問題 /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI Required
Required 変更あり 27 ios-test-jobは実行されない → Requiredの項目がグリーンに ならない → マージできない
2. 問題解決のアプローチ手法 28
アプローチ ・あるコミットに対して、”PRマージ時にグリーンに なってほしいジョブを含むワークフローがグリーンに なっているか”をチェックするジョブを GitHub ステータスのRequiredに指定する 29
アプローチ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job CircleCI Required
Required 30
アプローチ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job workflow-status-check-job New
! CircleCI Required Required 31
アプローチ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job workflow-status-check-job New
! CircleCI Required Required Required 32
アプローチ /ios /android GitHub GitHub android-test-job path-filtering/filter ios-test-job workflow-status-check-job New
! CircleCI Required Required Required 33 PRマージ時にグリーンになってほしい ジョブ (android-test-job や ios-test- job) を含むワークフローがグリーンに なっていたらグリーンになるジョブ workflow-status-check-job
workflow-status-check-job の実装 34
workflow-status-check-jobの実装 ・ CircleCI API v2 (*3) を利用して実現する ・ 全体の実行時間は13秒程度 *3:
https://circleci.com/docs/api/v2/index.html 35
workflow-status-check-jobの実装 直近に実行したパイプラインのリストを取得 Step 1 パイプラインに紐づくワークフローを取得 Step 2 ワークフローの状態を取得 Step 3
特定のワークフローが成功していたら自分自身をグリーンにする Step 4 CircleCI API v2 CircleCI API v2 CircleCI API v2 36 → Requiredにしたいジョブを含むワークフロー
いつ実行させる? 37
いつ実行させる? /ios /android GitHub GitHub android-test-job path-filtering ios-test-job workflow-status-check-job CircleCI
Required 38
いつ実行させる? /ios /android GitHub GitHub android-test-job path-filtering ios-test-job workflow-status-check-job CircleCI
Required 確認対象のワークフローが 終わった後に実行させたい workflow-status-check-job 39
いつ実行させる? /ios /android GitHub GitHub android-test-job path-filtering ios-test-job workflow-status-check-job CircleCI
Required 確認対象のワークフローが 終わった後に実行させたい ↓ 確認対象のワークフロー内の 最後のジョブでRerunさせる workflow-status-check-job CircleCI API v2 40
なぜRerun? そこで初めて実行すれば? 41 https://circleci.com/docs/api/v2/index.html#tag/Workflow → 単体のワークフローを実行するAPIが 無いため、一度実行させてからRerun
実行結果 42
実行結果(成功する場合) 43
実行結果(成功する場合) 44 マージ時にグリーンになってほしいジョブ (ios-test-job) が グリーンになったのでRequiredの項目をグリーンに!
実行結果(失敗する場合) 45
実行結果(失敗する場合) 46 マージ時にグリーンになってほしいジョブ (ios-test-job) が レッド。Requiredの項目はレッドのまま!
問題を振り返る 47
問題 ・path-filteringを使うとGitHub ステータスの RequiredにPRのマージ時にグリーンになってほしい ジョブを指定できないため、PRを安全にマージできない 48
問題に対してのアプローチ手法の効果 → PRのマージ時にグリーンになってほしいジョブを含む ワークフローの状態を取得するジョブをRequiredに することでPRを安全にマージできるようになった 49
問題に対してのアプローチ手法の効果 → PRのマージ時にグリーンになってほしいジョブを含む ワークフローの状態を取得するジョブをRequiredに することでPRを安全にマージできるようになった 50 解 決
3. アプローチ手法の課題 51
アプローチ手法の課題 ・コードのメンテナンスの属人化 ・CircleCI APIを利用するコードの言語何にするか問題 ・チームの導入を考えるとチーム内共通言語(iOSならSwift) で書いたほうがメンテナンス性が上がる 52 コード:
https://github.com/tokizuoh/circleci-test-2022-10-01
完