Skip to content

Commit 72f2112

Browse files
committed
Mv Gundeck.Options => Wire.ServerOptions.Gundeck [WIP]
1 parent b213e72 commit 72f2112

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

services/gundeck/src/Gundeck/Options.hs renamed to libs/wire-subsystems/src/Wire/ServerOptions/Gundeck.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
-- You should have received a copy of the GNU Affero General Public License along
1919
-- with this program. If not, see <https://www.gnu.org/licenses/>.
2020

21-
module Gundeck.Options where
21+
module Wire.ServerOptions.Gundeck where
2222

23+
import Amazonka (Region)
2324
import Control.Lens hiding (Level)
2425
import Data.Aeson.TH
2526
import Data.Yaml (FromJSON)
26-
import Gundeck.Aws.Arn
2727
import Imports
2828
import System.Logger.Extended (Level, LogFormat)
29+
import Text.Shakespeare.Text (ToText (..))
2930
import Util.Options
3031
import Util.Options.Common
3132
import Wire.API.Routes.Version
@@ -34,6 +35,12 @@ newtype NotificationTTL = NotificationTTL
3435
{notificationTTLSeconds :: Word32}
3536
deriving (Eq, Ord, Show, Generic, FromJSON)
3637

38+
newtype ArnEnv = ArnEnv {arnEnvText :: Text}
39+
deriving (Show, ToText, FromJSON)
40+
41+
newtype Account = Account {fromAccount :: Text}
42+
deriving (Eq, Ord, Show, ToText, FromJSON)
43+
3744
data AWSOpts = AWSOpts
3845
{ -- | AWS account
3946
_account :: !Account,

libs/wire-subsystems/wire-subsystems.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ library
121121
Wire.ServerOptions.Brig.Queue
122122
Wire.ServerOptions.Brig.ZAuth
123123
Wire.ServerOptions.Cannon
124+
Wire.ServerOptions.Gundeck
124125
Wire.ServerOptions.Spar
125126
Wire.SessionStore
126127
Wire.SessionStore.Cassandra
@@ -208,6 +209,7 @@ library
208209
, schema-profunctor
209210
, servant
210211
, servant-client-core
212+
, shakespeare
211213
, stomp-queue
212214
, template
213215
, text

services/brig/src/Brig/API/Public.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ serverOptionsDocsAPI = Named @"server-config-options" $ pure allOptsSchema
198198
where
199199
allOptsSchema =
200200
mkJsonObject
201-
( [ "brig" .= ("comping up!" :: Text), -- TODO
202-
"galley" .= ("comping up!" :: Text), -- TODO
203-
"spar" .= ("comping up!" :: Text), -- TODO
204-
"gundeck" .= ("comping up!" :: Text), -- TODO
201+
( [ "brig" .= ("comping up!" :: Text), -- TODO: use schema-profunctor, then connect here.
202+
"galley" .= ("comping up!" :: Text), -- TODO: move to wire-subsystems.
203+
"spar" .= ("comping up!" :: Text), -- TODO: use schema-profunctor, then connect here.
204+
"gundeck" .= ("comping up!" :: Text), -- TODO: get it to compile.
205205
"cannon" .= describeOpts (Proxy @Wire.ServerOptions.Cannon.Opts),
206206
"cargohold" .= ("comping up!" :: Text), -- TODO
207207
"federator" .= ("comping up!" :: Text), -- TODO

services/gundeck/gundeck.cabal

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ library
2929
Gundeck.Monad
3030
Gundeck.Notification
3131
Gundeck.Notification.Data
32-
Gundeck.Options
3332
Gundeck.Presence
3433
Gundeck.Presence.Data
3534
Gundeck.Push
@@ -167,7 +166,7 @@ library
167166
, wai-utilities >=0.16
168167
, wire-api
169168
, wire-otel
170-
, yaml >=0.8
169+
, wire-subsystems
171170

172171
default-language: GHC2021
173172

services/gundeck/src/Gundeck/Aws/Arn.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ import Data.Attoparsec.Text
5959
import Data.Text qualified as Text
6060
import Imports
6161
import Wire.API.Push.V2 (AppName (..), Transport (..))
62-
63-
newtype ArnEnv = ArnEnv {arnEnvText :: Text} deriving (Show, ToText, FromJSON)
64-
65-
newtype Account = Account {fromAccount :: Text} deriving (Eq, Ord, Show, ToText, FromJSON)
62+
import Wire.ServerOptions.Gundeck
6663

6764
newtype EndpointId = EndpointId Text deriving (Eq, Ord, Show, ToText)
6865

services/gundeck/src/Gundeck/ThreadBudget/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import Data.Set qualified as Set
2929
import Data.Time
3030
import Data.UUID (UUID, toText)
3131
import Data.UUID.V4 (nextRandom)
32-
import Gundeck.Options
3332
import Imports
3433
import Prometheus (MonadMonitor)
3534
import Prometheus qualified as Prom
3635
import System.Logger.Class qualified as LC
3736
import UnliftIO.Async
3837
import UnliftIO.Exception (finally)
38+
import Wire.ServerOptions.Gundeck
3939

4040
data ThreadBudgetState = ThreadBudgetState
4141
{ threadBudgetLimits :: MaxConcurrentNativePushes,

0 commit comments

Comments
 (0)