Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Add settings to status schema #573

Merged
merged 2 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions creator/status/settings/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


class Features(graphene.ObjectType):
development_endpoints = graphene.Boolean(
description="Whether developer endpoints are active"
)
study_creation = graphene.Boolean(
description=(
"Will create new studies in the dataservice when a createStudy "
Expand Down Expand Up @@ -46,10 +49,13 @@ class Features(graphene.ObjectType):


class Settings(graphene.ObjectType):
development_endpoints = graphene.Boolean(
description=("Developer endpoints are active")
)
dataservice_url = graphene.String(description="The URL of the Dataservice")
datatracker_url = graphene.String(
description=(
"The URL of the Data Tracker frontend. Used for referring users "
"back to the UI in messaging and notifications"
)
)
cavatica_url = graphene.String(description="The URL of the Cavatica API")
cavatica_delivery_account = graphene.String(
description="The Cavatica account used for delivery projects"
Expand All @@ -62,6 +68,12 @@ class Settings(graphene.ObjectType):
cavatica_user_access_project = graphene.String(
description="The project to copy users from for new projects"
)
default_from_email = graphene.String(
description="The sender email address to use in email communications"
)
referral_token_expiration_days = graphene.String(
description="How many days a referral token is valid for"
)
study_buckets_region = graphene.String(
description=("The AWS region where new study buckets will be created")
)
Expand All @@ -83,6 +95,11 @@ class Settings(graphene.ObjectType):
"buckets will be stored"
)
)
study_buckets_replication_role = graphene.String(
description=(
"The AWS IAM role to use when configuring DR bucket replication"
)
)
study_buckets_inventory_location = graphene.String(
description=(
"The full aws bucket with prefix where bucket inventories will be "
Expand All @@ -95,6 +112,9 @@ class Settings(graphene.ObjectType):
"and dr logging buckets"
)
)
slack_release_channel = graphene.String(
description="Slack channel where release notifications are posted",
)
slack_users = graphene.List(
graphene.String,
description=("Slack IDs of users to add to new study channels"),
Expand Down
11 changes: 10 additions & 1 deletion creator/status/settings/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Status(graphene.ObjectType):

def resolve_features(self, info):
features = {
"development_endpoints": settings.DEVELOPMENT_ENDPOINTS,
"study_creation": settings.FEAT_DATASERVICE_CREATE_STUDIES,
"study_updates": settings.FEAT_DATASERVICE_UPDATE_STUDIES,
"cavatica_create_projects": settings.FEAT_CAVATICA_CREATE_PROJECTS,
Expand All @@ -47,8 +48,8 @@ def resolve_settings(self, info):
raise GraphQLError("Not allowed")

conf = {
"development_endpoints": settings.DEVELOPMENT_ENDPOINTS,
"dataservice_url": settings.DATASERVICE_URL,
"datatracker_url": settings.DATA_TRACKER_URL,
"cavatica_url": settings.CAVATICA_URL,
"cavatica_delivery_account": settings.CAVATICA_DELIVERY_ACCOUNT,
"cavatica_harmonization_account": (
Expand All @@ -57,6 +58,10 @@ def resolve_settings(self, info):
"cavatica_user_access_project": (
settings.CAVATICA_USER_ACCESS_PROJECT
),
"default_from_email": settings.DEFAULT_FROM_EMAIL,
"referral_token_expiration_days": (
settings.REFERRAL_TOKEN_EXPIRATION_DAYS
),
"study_buckets_region": settings.STUDY_BUCKETS_REGION,
"study_buckets_logging_bucket": (
settings.STUDY_BUCKETS_LOGGING_BUCKET
Expand All @@ -65,10 +70,14 @@ def resolve_settings(self, info):
"study_buckets_dr_logging_bucket": (
settings.STUDY_BUCKETS_DR_LOGGING_BUCKET
),
"study_buckets_replication_role": (
settings.STUDY_BUCKETS_REPLICATION_ROLE
),
"study_buckets_inventory_location": (
settings.STUDY_BUCKETS_INVENTORY_LOCATION
),
"study_buckets_log_prefix": settings.STUDY_BUCKETS_LOG_PREFIX,
"slack_release_channel": settings.SLACK_RELEASE_CHANNEL,
"slack_users": settings.SLACK_USERS,
"log_dir": settings.LOG_DIR,
"log_bucket": settings.LOG_BUCKET,
Expand Down