Skip to content

Commit

Permalink
Merge pull request #82 from nebulabroadcast/80-flag-for-experimental-…
Browse files Browse the repository at this point in the history
…feature-set

Option to enable experimental features
  • Loading branch information
martastain authored Oct 19, 2024
2 parents 245bbcc + 5cc27d7 commit e88ec15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/api/init/init_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class InitResponseModel(ResponseModel):
),
] = None

experimental: Annotated[bool | None, Field(title="Enable experimental features")] = None


class InitRequest(APIRequest):
"""Initial client request to ensure user is logged in.
Expand Down Expand Up @@ -102,7 +104,10 @@ async def handle(
# Not logged in. Only return motd and oauth2 options.
# TODO: return oauth2 options
if user is None:
return InitResponseModel(motd=motd)
return InitResponseModel(
motd=motd,
experimental=nebula.config.enable_experimental or None,
)

# TODO: get preferred user language
lang: LanguageCode = user.language
Expand All @@ -119,4 +124,5 @@ async def handle(
settings=client_settings,
frontend_plugins=plugins,
scoped_endpoints=server_context.scoped_endpoints,
experimental=nebula.config.enable_experimental or None,
)
5 changes: 5 additions & 0 deletions backend/nebula/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class NebulaConfig(BaseModel):
description="Logging level",
)

enable_experimental: bool = Field(
False,
description="Enable experimental features",
)


def load_config() -> NebulaConfig:
prefix = "NEBULA_"
Expand Down

0 comments on commit e88ec15

Please sign in to comment.