RFC: Further reduction of controller boilerplate (Phase 2 of removing ja_resource)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia leggendo il blocco quote di def controller del modulo CodeCorpsWeb, router.ex e le dichiarazioni dei controller per action_fallback, DataToAttributes e IdsToIntegers. Traccia le differenze attuali tra le interfacce API e webhook. Il lavoro è completato quando viene raggiunta e documentata una decisione sui tre cambiamenti proposti, senza nascondere comportamenti né applicare i plug sbagliati ai webhook.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Elixir
- Stelle
- 234
- Fork
- 82
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di code-corps/code-corps-api
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
code-corps/code-corps-api#1385 ·
-
Cannot Create new GitHub App Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
code-corps/code-corps-api#1384 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
code-corps/code-corps-api#1383 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
code-corps/code-corps-api#1382 · 2 commenti ·
-
Difficulty: Medium Skill: Elixir Time: 4 hours
code-corps/code-corps-api#1372 · 3 commenti · 1 assegnatario ·
Tutte le issue di code-corps/code-corps-api
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
phoenixframework/phoenix#6847 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
moderation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
beyond-all-reason/teiserver#1584 · 1 commento ·