Skip to content

Make graphql urls conditional#89

Open
peppermint-juli wants to merge 8 commits intomainfrom
point-prod
Open

Make graphql urls conditional#89
peppermint-juli wants to merge 8 commits intomainfrom
point-prod

Conversation

@peppermint-juli
Copy link
Contributor

Environment-specific configuration:

  • Updated the graphql-deployment.yaml Helm template to set service base URLs (FILES_BASE_URL, COMPUTE_BASE_URL, RACM_BASE_URL, LOGIN_PORTAL_BASE_URL) to https://apps.sciserver.org/ when running in the dev environment, and to the usual values otherwise. This ensures the correct endpoints are used depending on the deployment environment.

GraphQL server setup simplification:

  • Removed the use of addMocksToSchema and related mocking logic from main.ts, so the server always uses the real schema and resolvers regardless of environment. This reduces complexity and avoids unnecessary test-only code in production and development. [1] [2]

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SciServer GraphQL deployment configuration to use environment-specific upstream service URLs, and simplifies the GraphQL server bootstrap to always use the real schema/resolvers (removing test-only mocking).

Changes:

  • Updated the GraphQL Helm Deployment template to conditionally set FILES_BASE_URL, COMPUTE_BASE_URL, RACM_BASE_URL, and LOGIN_PORTAL_BASE_URL based on .Values.graphql.env.
  • Removed addMocksToSchema usage so the Apollo Server always runs with the real schema.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
helm/sciserver/templates/graphql/graphql-deployment.yaml Adds environment-conditioned base URLs for downstream services used by GraphQL.
components/ui/graphql/src/main.ts Removes test-only schema mocking and keeps a single real schema configuration.
Comments suppressed due to low confidence (1)

components/ui/graphql/src/main.ts:50

  • The landing page plugin toggle checks process.env.IDIES_ENV !== 'production', but the rest of this repo/Helm values use dev/prod (e.g., environment.ts checks for 'prod' and the chart sets IDIES_ENV from .Values.graphql.env). As written, the landing page will remain enabled even when IDIES_ENV=prod, which is likely unintended for production. Align this comparison with the actual environment values used by the chart/app.
  plugins: process.env.IDIES_ENV !== 'production' ?
    [
      // eslint-disable-next-line new-cap
      ApolloServerPluginLandingPageLocalDefault({ footer: false })
    ]
    : [],

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

resources:
{{- toYaml .Values.compute.resources | nindent 12 }}
env:
env:
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a duplicated env: key here (env: followed by another env: with mismatched indentation). This will render invalid YAML for the Deployment and prevent the chart from installing. Remove the extra env: line and ensure the env var list is directly under the single env: key.

Suggested change
env:

Copilot uses AI. Check for mistakes.
@peppermint-juli peppermint-juli marked this pull request as draft February 13, 2026 20:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@amitschang amitschang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need another approach for this, more akin to what we do for other conditional components. See comment

value: '{{ include "sciserver.url" . }}login-portal/'
- name: NEXT_PUBLIC_GRAPHQL_URL
value: '{{ include "sciserver.url" . }}graphql'
value: '{{- if eq .Values.graphql.env "dev" -}}https://apps.sciserver.org/{{- else -}}{{ include "sciserver.url" . }}{{- end -}}graphql'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is right to hardcode the JHU site url, and particularly not the case for dev, where often times we will want the complete k8s environment to test relevant components including graphql.

It would be better to have the '{{ include "sciserver.url" . }}... as a default and accept specific urls for these when provided. e.g.

{{- if .Values.graphql.url }}
  {{ .Values.graphql.url }}
{{- else -}}
  {{ include "sciserver.url" .  }}graphql
{{- end -}}

This is similar to how we do for other components (for example keycoak). The deployment of graphql could additionally be conditional on this, meaning when supplied, we don't deploy it at all, since we are pointing to an externally managed instance (as we do for others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants