Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RFC: Further reduction of controller boilerplate (Phase 2 of removing ja_resource)

オープン
#1,069 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
elixir
領域
api, backend

調査の方向性

まず、CodeCorpsWebモジュールのdef controllerのquoteブロック、router.ex、およびaction_fallback、DataToAttributes、IdsToIntegersのcontroller宣言を読みます。現在、APIインターフェースとwebhookインターフェースがどのように異なっているかを追跡します。3つの提案された変更について決定に達し、それを文書化できれば完了です。動作を隠したり、webhookに誤ったplugを適用したりしてはいけません。

索引モデルが issue の本文から書いたものです。

説明

question RFC

We could do the following 3 items to further reduce boilerplate in controllers.

However, while boilerplate is reduced, all 3 of these actions also hide behavior which we may not want to hide.

Remove action_fallback CodeCorpsWeb.FallbackController from all controllers and instead move it into the CodeCorpsWeb module into the def controller quote block

This makes sense at first glance, but it does also put all of our controllers into basically the same basket, regardless of them being actual API controllers, or just webhook handlers, or something else entirely.

Unfortunately, it is not currently possible to specify multiple action fallbacks for the same controller, which would be an argument for doing this, since it would allow simultaneously specifying global and group-specific fallbacks.

Remove plug CodeCorpsWeb.Plug.DataToAttributes from all controllers and move it into router.ex into the :api pipeline.

We would have to separate our general api pipeline and the part of the pipeline that handles github and sprite webhooks, since we don't want this plug in that part, but it would make sense to do so anyway, since they are, in fact, different parts of the "interface".

Remove plug CodeCorpsWeb.Plug.IdsToIntegers from all controllers and move it into router.ex into the :api pipeline.

Basically same argument as above.

Really, these two plugs should be considered one pipeline, since their intention is to prepare and make sense of the data sent by our client.

@JoshSmith

What do you think? Overall, this would not take much time, maybe an hour, but I'm not really sure if it would help or hurt us.

主要言語
Elixir
スター
234
フォーク
82
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

code-corps/code-corps-api のほかの issue

code-corps/code-corps-api の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。