hasura / hasura/graphql-engine

Integer environment variables for timeouts

Open
#9,630 0 comments 0 reactions 0 assignees View on GitHub
k/enhancement t/gql-services
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

Currently when trying to use an environment variable for an action `timeout` (or event `timeout_sec`):

```yaml
actions:
- name: someAction
definition:
kind: synchronous
handler: "http://some_service/someEndpoint"
timeout: "{{TIMEOUT_ENV_VAR}}"
```

The `TIMEOUT_ENV_VAR` get's interpreted as a string and throws an error.

```txt
time="2023-05-09T19:06:21Z" level=fatal msg="error applying metadata \ncannot build actions from project: error parsing metadata \nobject: actions\nfile: actions.yaml\nerror: error in reading actions.yaml: yaml: unmarshal errors:\n line 6: cannot unmarshal !!str `HASURA_...` into int"
```

### Describe the solution you'd like

Interpret environment variables for timeouts as integers so configuration is easier.

### Describe alternatives you've considered

Currently we deliver metadata to customers and they have to edit the metadata manually to get around this.

Contributor guide

Open the contributing guide

Research direction

Start with the actions.yaml example and trace how environment-variable values are parsed for action timeout and event timeout_sec. Check whether existing metadata-parsing tests cover these fields. Done means integer-valued environment variables are accepted for both timeout settings without the current YAML unmarshal error.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.