RFC: Further reduction of controller boilerplate (Phase 2 of removing ja_resource)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc khối quote của def controller, router.ex và các khai báo controller cho action_fallback, DataToAttributes và IdsToIntegers trong module CodeCorpsWeb. Theo dõi sự khác biệt hiện tại giữa các interface API và webhook. Công việc được xem là hoàn tất khi đã đi đến và ghi lại quyết định về ba thay đổi được đề xuất, không che giấu hành vi hoặc áp dụng nhầm plugs cho webhook.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Elixir
- Star
- 234
- Fork
- 82
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của code-corps/code-corps-api
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
code-corps/code-corps-api#1385 ·
-
Cannot Create new GitHub App Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
code-corps/code-corps-api#1384 ·
-
Track anon Users that register Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
code-corps/code-corps-api#1383 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
code-corps/code-corps-api#1382 · 2 bình luận ·
-
Difficulty: Medium Skill: Elixir Time: 4 hours
code-corps/code-corps-api#1372 · 3 bình luận · 1 người được giao ·
Tất cả issue của code-corps/code-corps-api
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
phoenixframework/phoenix#6847 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
moderation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
beyond-all-reason/teiserver#1584 · 1 bình luận ·