Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: melos exec コマンドがパッケージ間の依存関係に応じて実行される設定を追加する #88

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

Kotaro666-dev
Copy link
Contributor

概要

close #87

レビュー観点

  • 依存関係に応じて、melos run regenerate_code が実行されているかを確認する

レビューレベル

  • Lv1: ぱっとみて違和感がないかチェックして Approve する
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証して Approve する
  • Lv3: 実際に環境で動作確認したうえで Approve する

レビュー優先度

  • すぐに見てもらいたい ( hotfix など ) 🚀
  • 今日中に見てもらいたい 🚗
  • 今日〜明日中で見てもらいたい 🚶
  • 数日以内で見てもらいたい 🐢

ログの差分

ローカルで実行時のログ

Before

melos run regenerate_code
  └> melos exec -- "dart run build_runner build -d"> RUNNING

$ melos exec> dart run build_runner build -d
     └> RUNNING (in 4 packages)

--------------------------------------------------------------------------------
[cores_data]: [INFO] Generating build script...
[features_debug_mode]: [INFO] Generating build script...
[features_github_repository]: [INFO] Generating build script...
[flutter_app]: [INFO] Generating build script...
[cores_data]: [INFO] Generating build script completed, took 170ms
[cores_data]: 
[features_debug_mode]: [INFO] Generating build script completed, took 171ms
[features_debug_mode]: 
[features_github_repository]: [INFO] Generating build script completed, took 176ms
[features_github_repository]: 
[flutter_app]: [INFO] Generating build script completed, took 168ms
[flutter_app]: 
[features_debug_mode]: [INFO] Initializing inputs
[cores_data]: [INFO] Initializing inputs
[cores_data]: [INFO] Reading cached asset graph...
[features_debug_mode]: [INFO] Reading cached asset graph...
[features_github_repository]: [INFO] Initializing inputs
[features_github_repository]: [INFO] Reading cached asset graph...
[cores_data]: [INFO] Reading cached asset graph completed, took 63ms
[cores_data]: 
[features_debug_mode]: [INFO] Reading cached asset graph completed, took 63ms
[features_debug_mode]: 
[flutter_app]: [INFO] Initializing inputs
[features_github_repository]: [INFO] Reading cached asset graph completed, took 64ms
[features_github_repository]: 
[flutter_app]: [INFO] Reading cached asset graph...
[features_debug_mode]: [INFO] Checking for updates since last build...
[cores_data]: [INFO] Checking for updates since last build...
[features_github_repository]: [INFO] Checking for updates since last build...
[flutter_app]: [INFO] Reading cached asset graph completed, took 188ms
[flutter_app]: 
[flutter_app]: [INFO] Checking for updates since last build...
[cores_data]: [INFO] Checking for updates since last build completed, took 836ms
[cores_data]: 
[features_debug_mode]: [INFO] Checking for updates since last build completed, took 842ms
[features_debug_mode]: 
[features_github_repository]: [INFO] Checking for updates since last build completed, took 833ms
[features_github_repository]: 
[cores_data]: [INFO] Running build...
[features_debug_mode]: [INFO] Running build...
[cores_data]: [INFO] Running build completed, took 8ms
[cores_data]: 
[cores_data]: [INFO] Caching finalized dependency graph...
[features_debug_mode]: [INFO] Running build completed, took 6ms
[features_debug_mode]: 
[features_debug_mode]: [INFO] Caching finalized dependency graph...
[features_github_repository]: [INFO] Running build...
[features_github_repository]: [INFO] Running build completed, took 10ms
[features_github_repository]: 
[features_github_repository]: [INFO] Caching finalized dependency graph...
[features_debug_mode]: [INFO] Caching finalized dependency graph completed, took 52ms
[features_debug_mode]: 
[cores_data]: [INFO] Caching finalized dependency graph completed, took 56ms
[cores_data]: 
[features_debug_mode]: [INFO] Succeeded after 64ms with 0 outputs (0 actions)
[features_debug_mode]: 
[cores_data]: [INFO] Succeeded after 72ms with 0 outputs (0 actions)
[cores_data]: 
[features_github_repository]: [INFO] Caching finalized dependency graph completed, took 59ms
[features_github_repository]: 
[features_github_repository]: [INFO] Succeeded after 73ms with 0 outputs (0 actions)
[features_github_repository]: 
[flutter_app]: [INFO] Checking for updates since last build completed, took 832ms
[flutter_app]: 
[flutter_app]: [INFO] Running build...
[flutter_app]: [INFO] Running build completed, took 31ms
[flutter_app]: 
[flutter_app]: [INFO] Caching finalized dependency graph...
[flutter_app]: [INFO] Caching finalized dependency graph completed, took 89ms
[flutter_app]: 
[flutter_app]: [INFO] Succeeded after 124ms with 0 outputs (0 actions)
[flutter_app]: 
--------------------------------------------------------------------------------

$ melos exec> dart run build_runner build -d
     └> SUCCESS

melos run regenerate_code
  └> melos exec -- "dart run build_runner build -d"> SUCCESS

After

melos run regenerate_code
  └> melos exec --concurrency 1 --order-dependents -- "dart run build_runner build -d"> RUNNING

$ melos exec> dart run build_runner build -d
     └> RUNNING (in 4 packages)

--------------------------------------------------------------------------------
cores_data:
[INFO] Generating build script...
[INFO] Generating build script completed, took 155ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 53ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 627ms

[INFO] Running build...
[INFO] Running build completed, took 6ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 39ms

[INFO] Succeeded after 50ms with 0 outputs (0 actions)

cores_data: SUCCESS
--------------------------------------------------------------------------------
features_debug_mode:
[INFO] Generating build script...
[INFO] Generating build script completed, took 157ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 54ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 625ms

[INFO] Running build...
[INFO] Running build completed, took 5ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 41ms

[INFO] Succeeded after 50ms with 0 outputs (0 actions)

features_debug_mode: SUCCESS
--------------------------------------------------------------------------------
features_github_repository:
[INFO] Generating build script...
[INFO] Generating build script completed, took 152ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 55ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 636ms

[INFO] Running build...
[INFO] Running build completed, took 7ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 41ms

[INFO] Succeeded after 51ms with 0 outputs (0 actions)

features_github_repository: SUCCESS
--------------------------------------------------------------------------------
flutter_app:
[INFO] Generating build script...
[INFO] Generating build script completed, took 154ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 158ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 676ms

[INFO] Running build...
[INFO] Running build completed, took 28ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 87ms

[INFO] Succeeded after 119ms with 0 outputs (0 actions)

flutter_app: SUCCESS
--------------------------------------------------------------------------------

$ melos exec> dart run build_runner build -d
     └> SUCCESS

melos run regenerate_code
  └> melos exec --concurrency 1 --order-dependents -- "dart run build_runner build -d"> SUCCESS

動作確認手順

GitHub Actions 内のログを確認してください。

備考

関連 issue: feat: support running scripts in topological order with melos exec #440

Copy link

Ready for review 🚀

Copy link
Contributor

@morikann morikann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ログから依存関係グラフに基づいて自動生成が行われていることを確認しました!
ご対応ありがとうございます✨

@Kotaro666-dev
Copy link
Contributor Author

レビューありがとうございます!
マージします!

@Kotaro666-dev Kotaro666-dev merged commit c04bc3b into main Jan 24, 2024
4 checks passed
@Kotaro666-dev Kotaro666-dev deleted the feature/setup-melos-exec-options branch January 24, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants