Conversation
…le URLs for deployment
There was a problem hiding this comment.
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, andLOGIN_PORTAL_BASE_URLbased on.Values.graphql.env. - Removed
addMocksToSchemausage 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 usedev/prod(e.g.,environment.tschecks for'prod'and the chart setsIDIES_ENVfrom.Values.graphql.env). As written, the landing page will remain enabled even whenIDIES_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: |
There was a problem hiding this comment.
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.
| env: |
There was a problem hiding this comment.
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.
amitschang
left a comment
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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)
Environment-specific configuration:
graphql-deployment.yamlHelm template to set service base URLs (FILES_BASE_URL,COMPUTE_BASE_URL,RACM_BASE_URL,LOGIN_PORTAL_BASE_URL) tohttps://apps.sciserver.org/when running in thedevenvironment, and to the usual values otherwise. This ensures the correct endpoints are used depending on the deployment environment.GraphQL server setup simplification:
addMocksToSchemaand related mocking logic frommain.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]