Skip to content

Commit

Permalink
Merge pull request #573 from kids-first/add-settings
Browse files Browse the repository at this point in the history
🔧 Add settings to status schema
  • Loading branch information
dankolbman authored Feb 19, 2021
2 parents 40cf58c + 35db710 commit 7c03def
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
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

0 comments on commit 7c03def

Please sign in to comment.