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 from_env to dataconnector config (fix #9777) #10077

Closed
wants to merge 1 commit into from
Closed

Add from_env to dataconnector config (fix #9777) #10077

wants to merge 1 commit into from

Conversation

nickthegroot
Copy link
Contributor

Description

This PR enables backend_configs.yaml to specify data connector URIs through environment variables. As discussed in #9777, this use-case is particularly helpful for organizations who deploy the same configuration to multiple Hasura environments and utilize environment variables for env-specific arguments.

Apologies in advance for any Haskell-specific errors, this is my first time working with the language.

Changelog

Component : server

Type: enhancement

Product: community-edition

Short Changelog

Creates a new data object, DataConnectorUri, that can be either BaseUrl or a from_env string. Calling objects use a new parsing function, resolveDataConnectorUri, to recover the original BaseUrl.

Steps to test and verify

This has been tested by running hasura/weaviate_gdc in a container, starting Hasura with an env var set to the new (i.e. WEAVIATE_GDC_HOST=http://localhost:8100), then using the Hasura CLI to deploy new metadata with the following backend_config.yaml

dataconnector:
  weaviate:
    uri:
      from_env: WEAVIATE_GDC_HOST

Limitations, known bugs & workarounds

No frontend considerations have been made.

Server checklist

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes
    • Updated docs with SQL for downgrading the catalog

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes
    • Does run_sql auto manages the new metadata through schema diffing?
      • Yes
      • Not required
    • Does run_sql auto manages the definitions of metadata on renaming?
      • Yes
      • Not required
    • Does export_metadata/replace_metadata supports the new metadata added?
      • Yes
      • Not required

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:
    • New types and typenames are correlated

Breaking changes

  • No Breaking changes

  • There are breaking changes:

    1. Metadata API

      Existing query types:

      • Modify args payload which is not backward compatible
      • Behavioural change of the API
      • Change in response JSON schema
      • Change in error code
    2. GraphQL API

      Schema Generation:

      • Change in any NamedType
      • Change in table field names

      Schema Resolve:-

      • Change in treatment of null value for any input fields
    3. Logging

      • Log JSON schema has changed
      • Log type names have changed

@nickthegroot nickthegroot requested a review from a team as a code owner December 28, 2023 08:53
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @nickthegroot, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible.

Stay awesome! 😎

@CLAassistant
Copy link

CLAassistant commented Dec 28, 2023

CLA assistant check
All committers have signed the CLA.

@daniel-chambers
Copy link
Contributor

Thanks for the contribution @nickthegroot, we'll take a look at this.

hasura-bot added a commit that referenced this pull request Jan 4, 2024
GITHUB_PR_NUMBER: 10077
GITHUB_PR_URL: #10077

PR-URL: hasura/graphql-engine-mono#10585
Co-authored-by: Nick DeGroot <[email protected]>
Co-authored-by: Daniel Chambers <[email protected]>
Co-authored-by: Vijay Prasanna <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 9169e9250cbbee0fc9d47b503ead5e2219c98bc6
@hasura-bot hasura-bot closed this Jan 4, 2024
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

GIF

Awesome work @nickthegroot!

Your changes were merged successfully. All of us at Hasura ❤️ what you did.

Thanks again 🤗

@daniel-chambers
Copy link
Contributor

@nickthegroot This has merged (with additional changes) in this commit: 63d90dc
You should see it ship in the next release. 🙂

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

Successfully merging this pull request may close these issues.

4 participants