Skip to content

Conversation

battermann
Copy link
Contributor

@battermann battermann commented Sep 30, 2022

related to https://wearezeta.atlassian.net/browse/SEC-202

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

Context

  • stern Servant API is defined in tools/stern/src/Stern/API/Routes.hs.
    • as well as the swagger docs
  • servant swagger docs are served at http://localhost:8091/backoffice/api/swagger-ui/
    • swagger ui is functional and can execute requests against stern
  • there is a servant sitemap value in tools/stern/src/Stern/API.hs to make sure the API type checks
    • the servant handler should be used by the wai-route handler to make sure that it all fits
    • current convention wai-route handler name has a suffix tick, e.g. usersByEmail'
    • see example below
get "/users" (continue usersByEmail') $
...

_servantSitemap = Named @"get-users-by-email" usersByEmail

usersByEmail' :: Email -> Handler Response
usersByEmail' = fmap json . usersByEmail

usersByEmail :: Email -> Handler [UserAccount]
usersByEmail = Intra.getUserProfilesByIdentity . Left

image

@battermann battermann temporarily deployed to cachix September 30, 2022 11:01 Inactive
@battermann battermann temporarily deployed to cachix September 30, 2022 11:01 Inactive
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Sep 30, 2022
@battermann battermann changed the title Battermann/servantify stern Servantify stern Sep 30, 2022
@battermann battermann temporarily deployed to cachix September 30, 2022 11:18 Inactive
@battermann battermann temporarily deployed to cachix September 30, 2022 11:18 Inactive
@battermann battermann requested a review from fisx September 30, 2022 11:22
@battermann battermann temporarily deployed to cachix September 30, 2022 11:31 Inactive
@battermann battermann temporarily deployed to cachix September 30, 2022 11:31 Inactive
@fisx fisx temporarily deployed to cachix September 30, 2022 13:49 Inactive
@fisx fisx temporarily deployed to cachix September 30, 2022 13:49 Inactive
@fisx fisx marked this pull request as ready for review September 30, 2022 13:52
@fisx fisx temporarily deployed to cachix September 30, 2022 13:52 Inactive
@fisx fisx temporarily deployed to cachix September 30, 2022 13:52 Inactive
@fisx
Copy link
Contributor

fisx commented Sep 30, 2022

i checked, old routes are still working when run inside deploy/services-demo.

@fisx fisx merged commit 2fbc78c into develop Sep 30, 2022
@fisx fisx deleted the battermann/servantify-stern branch September 30, 2022 14:45
@fisx fisx mentioned this pull request Sep 30, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants