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

ci(cli): パッケージラベルの生成ツールを追加 #250

Merged
merged 14 commits into from
Jul 11, 2024

Conversation

tatsutakein
Copy link
Member

@tatsutakein tatsutakein commented Jun 12, 2024

概要

パッケージラベルの生成ツールを追加します。

dart のコマンドラインツールとして、grinder を利用しています。
https://pub.dev/packages/grinder

レビュー観点

  • コードに違和感がないか

レビューレベル

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

レビュー優先度

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

画像 / 動画

Before After Design

確認したこと

  • 自動生成用のコメント # <!-- This is an auto-generated label --> がある状態で動作すること
  • .github/labels.yml は既存で同じラベル名があった場合 color などの設定が維持されること
  • 自動生成用のコメント # <!-- This is an auto-generated label --> を外した状態でも動作すること
    • 場合によってはラベルが重複してしまいますが、そこまでカバーはしなくてもよいかなと思っています

動作確認手順

dart pub global activate grinder で grinder を実行できるようにした後、以下のいずれかのコマンドを実行します。

  • melos bs
    • hooks で grind generate-package-labelsgrind generate-package-labeler が実行されます
  • grind generate-package-labels
    • .github/labels.yml のパッケージ部分が生成されます
  • grind generate-package-labeler
    • .github/labeler.yml のパッケージ部分が生成されます
grinder running generate-package-labels

generate-package-labels
  rootDir: /Users/xxxxxxx/flutter-mobile-project-template
  labelsFile: /Users/xxxxxxx/flutter-mobile-project-template/.github/labels.yml
  Auto-generated label section found on line 38.
  Labels updated successfully.

finished in 0.6 seconds
grinder running generate-package-labeler

generate-package-labeler
  labelerFile: /Users/xxxxxxx/flutter-mobile-project-template/.github/labeler.yml
  Auto-generated label section found on line 5.
  Labels updated successfully.

備考

@tatsutakein tatsutakein changed the title ci(cli): パッケージラベルの生成ツールを追加 [WIP] ci(cli): パッケージラベルの生成ツールを追加 Jun 12, 2024
Copy link

github-actions bot commented Jun 12, 2024

Visit the preview URL for this PR (updated for commit a8d4737):

https://flutter-mobile-project-template-catalog--pr250-improve-1618f086.web.app

(expires Tue, 16 Jul 2024 05:18:14 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9ea56735a63d07a7cfe62eb204b0528284c37c23

Copy link
Member Author

@tatsutakein tatsutakein Jun 14, 2024

Choose a reason for hiding this comment

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

memo-badge

ファイルの読み込みが tool/grind.dart で固定されているようなので、他の階層には置けなそうです。
もし tools と統合するのであれば、tools 側を tool に統合することになるかなと思っています。

https://github.com/google/grinder.dart/blob/cede0736b72b5088a118798cb99892675a6f6a3c/bin/grinder.dart#L10-L11

Comment on lines +20 to +25
- name: Activate grinder
run: |
GRINDER_VERSION=$(cat pubspec.lock | yq ".packages.grinder.version" -r)
dart pub global activate grinder $GRINDER_VERSION
shell: bash

Copy link
Member Author

Choose a reason for hiding this comment

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

memo-badge

melos bootstrap の hook で grinder を実行するため、ここで activate しています。

@@ -31,7 +31,7 @@ command:
test: ^1.24.0
flutter_gen_runner: ^5.5.0+1
hooks:
post: melos run yumemi_lints_update
post: melos run yumemi_lints_update && grind generate-package-labels && grind generate-package-labeler
Copy link
Member Author

Choose a reason for hiding this comment

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

memo-badge

実行コストはそこまでかからない認識のため hooks で実行しています。
個別での実行も可能ですが、パッケージ追加・削除時のラベル更新漏れを防ぐ意味合いです。

@tatsutakein tatsutakein changed the title [WIP] ci(cli): パッケージラベルの生成ツールを追加 ci(cli): パッケージラベルの生成ツールを追加 Jul 9, 2024
@tatsutakein tatsutakein marked this pull request as ready for review July 9, 2024 05:51
@yumemi-team-review-requester yumemi-team-review-requester bot requested review from a team and rizumita and removed request for a team July 9, 2024 05:51
Copy link

github-actions bot commented Jul 9, 2024

Ready for review 🚀

@tatsutakein tatsutakein merged commit 3c53593 into main Jul 11, 2024
15 checks passed
@tatsutakein tatsutakein deleted the improve/GH-244 branch July 11, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improve]: パッケージラベルの生成ツールの追加
2 participants