oss-gate / workshop

OSSの開発に未参加または参加したことはあるけどまだ自信がない人を後押しするワークショップ用のリポジトリー
123 stars 539 forks source link

OSS Gate Workshop: Techouse: 2024-04-18: pupudesu: annotate_models: Work log #1816

Closed pupudesu closed 5 months ago

pupudesu commented 5 months ago

This is a work log of a "OSS Gate workshop". "OSS Gate workshop" is an activity to increase OSS developers. Here's been discussed in Japanese. Thanks.

作業ログ作成時の説明

以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。

OSS Gate Workshop: ${LOCATION}: ${YEAR}-${MONTH}-${DAY}: ${ACCOUNT_NAME}: ${OSS_NAME}: Work log

タイトル例↓:

OSS Gate Workshop: Tokyo: 2017-01-16: kou: Rabbit: Work log

OSS Gateワークショップ関連情報

pupudesu commented 5 months ago

When I was an intern, I was told to create a new model. I had to annotate the new model and wanted to use the annotate_models gem. At that time, I didn't know how to use it, so I checked their github page.

pupudesu commented 5 months ago

After checking out their Usage section, I figured that I can use the annotate --models command.

Screenshot 2024-04-18 at 12 00 00

I tried using it and it annotated not only the model I made, but also rewrote other models annotations. I was confused because I didn't touch other models, then I realized that the other model annotations were not up to date. This is an issue for sure, but I didn't want to include these changes in my pull request because it's out of scope.

pupudesu commented 5 months ago

I wondered if there is a way to annotate a specific file, just like how rspec is capable of running a specific test by adding file name after the command, so I tried searching some relevant keywords in the readme page, but I couldn't find anything.

I then checked if it's listed in issues and found a pretty similar problem.

Screenshot 2024-04-18 at 12 27 49
pupudesu commented 5 months ago

Thinking that it's probably similar to rspec, I then tried this command: annotate --models <model_file_path> With this command, I got the annotation done only to that model, factory, and spec files.

Since this is what the issue author probably wants to do, I wrote a comment there.

pupudesu commented 5 months ago

I then checked the readme to see whether it's mentioned. I saw that although there is no singe model command example, it is mentioned in Options that it's doable.

Screenshot 2024-04-18 at 12 29 24

However, I think this is hard to notice especially as a beginner, so I thought it would be nice to have it specifically explained as an example in the readme.

daipom commented 5 months ago
pupudesu commented 5 months ago
  • READMEにexampleを追加するPRを作ってみるとよさそう!
  • 足りない機能について機能リクエストするissueを作るのもいいかも!

さっき相談した時もそういうアドバイスもらったので、今からやろうと思ってます!

pupudesu commented 5 months ago

To submit a pull request, I checked the readme to see if there is any guideline on how to do it, but I couldn't find anything. I then checked how the other pull requests were done as a reference.

From there, I saw that other people forked the repository and submitted their pull request from their own branch.

Screenshot 2024-04-18 at 15 54 57
pupudesu commented 5 months ago

Based on that, I submitted a pull request to include the single model use case.

Screenshot 2024-04-18 at 15 56 49
github-actions[bot] commented 5 months ago

おつかれさまでした!

ワークショップの終了にともないissueを閉じますが、このまま作業メモとして使っても構いません :ok_hand:

ワークショップの感想を集めています!

ブログなどに書かれた際は、このページへリンクの追加をお願いします :pray:

またの参加をお待ちしています!