Commit Graph

3520 Commits

Author SHA1 Message Date
Gil Mizrahi
7366184cbb RFC: limit over join optimization
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2424
GitOrigin-RevId: 95da4151190dbd66a6cc8e14e0f78a0a3dbbb5e6
2021-10-06 08:47:44 +00:00
Puru Gupta
8b60122b9e [server] add openapi support
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1935
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
GitOrigin-RevId: 3e43b84d4e9e181b405855704112b49467dafdf9
2021-10-06 07:16:13 +00:00
Solomon Bothwell
49c07c79e5 Cleans up Request Transform JSON
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2512
GitOrigin-RevId: bd9d71257641276b805e7f0a2b1389c276d9c9cf
2021-10-06 00:09:35 +00:00
Abby Sassel
ddb1b09f45 server/tests: improve pytest error message where execute_query responds with 500
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2506
GitOrigin-RevId: 45b55fd20cc5fae6a3f55b24d6736a1a606684ae
2021-10-05 17:26:42 +00:00
Karthikeyan Chinnakonda
64e2201179 server: enable inherited roles by default
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2325
Co-authored-by: Nicolas Beaussart <7281023+beaussan@users.noreply.github.com>
GitOrigin-RevId: 8ad6fe25a3788892128c1d56b8fa0e8feed2caca
2021-10-05 12:29:32 +00:00
Ikechukwu Eze
8ca962ab91 console: add time limits setting to security settings
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2420
GitOrigin-RevId: 9c2752c4939a8d22474277f6894bf50f02486899
2021-10-05 10:49:30 +00:00
Solomon Bothwell
0a829f8762 Temp fix for pipes in URIs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2502
GitOrigin-RevId: 041cd11f68b8dfc45526114f875a441eb0c9667e
2021-10-05 02:07:41 +00:00
Solomon Bothwell
74a392f530 TestWebhookTransform shouldn't increment Resource Version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2501
GitOrigin-RevId: d3cfb44d998e942dbe2dad01387b2be8c9dd8cf4
2021-10-04 23:50:47 +00:00
Philip Lykke Carlsen
c839fc55df Revise function-root-field-customisation.md
### Description
* Removed unresolved questions since resolved
* Change status 'draft' → 'published'

### Changelog

- [X] `no-changelog-required` .

### Related Issues

fix https://github.com/hasura/graphql-engine/issues/7405

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2496
GitOrigin-RevId: 0bdba7f5d52f2a4bd70c525dab12698e9ceddb28
2021-10-04 11:39:59 +00:00
Philip Lykke Carlsen
648c566d0b RFC: Customisability of function root field names
[Rendered](https://github.com/hasura/graphql-engine-mono/blob/plc/customise-function-root-field-names-rfc/rfcs/function-root-field-customisation.md)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2419
GitOrigin-RevId: e55295993e919dbed7936dcca7dcb06b34b761c8
2021-10-04 08:42:08 +00:00
Abby Sassel
3a6f4e1737 server/bigquery: allow empty tables in replace_metadata. Default BigQueryField mode to Nullable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2466
GitOrigin-RevId: 1f3599d1317235a31c98d7ed1ece2db92d82e916
2021-10-01 18:30:01 +00:00
Vishnu Bharathi
80cb68332c ci: add pro server jobs to buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2463
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
GitOrigin-RevId: e267657d47dc25e49787f87ff46ce16f285d9565
2021-10-01 14:24:19 +00:00
Rakesh Emmadi
09ae6af337 server/mssql: insert SQL generation and execution
>

### Description
>
Insert mutations for MSSQL backend. This PR implements execution logic.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [x] Tests

### Related Issues
->
Close https://github.com/hasura/graphql-engine-mono/issues/2114

### Steps to test and verify
>
Track a MSSQL table and perform the generated insert mutation to test.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2248
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 936f138c80d7a928180e6e7b0c4da64ecc1f7ebc
2021-10-01 12:53:15 +00:00
Lyndon Maydwell
1ae8bf00f7 Update Kriti to support field lookup by string literal in webhook transformations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2482
GitOrigin-RevId: 4f5ea1c3b7989a17368ab995c6a45c7135253ba0
2021-10-01 06:24:06 +00:00
Sai Krishna Prasad Kandula
6af264626a docs: Segment Analytics Implementation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2476
GitOrigin-RevId: fecd06d60158301e41ac4b3c3ea32dc79f74399e
2021-09-30 12:24:56 +00:00
Rakesh Emmadi
6724b62719 server/postgres: add test case to test computed field with session argument in where expression
>

### Description
>
Add a simple test case to test behavior of computed fields with session argument in filter expression (`where`) of a graphql query.

### Changelog

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2465
GitOrigin-RevId: 25e287c7e7826350e93f2bebacd5d877568c9934
2021-09-30 11:27:37 +00:00
Sameer Kolhar
2a5d3a9432 server: skip TestScheduledEvent due to flakiness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2473
GitOrigin-RevId: 2edf923f97aadf621cd9fc08163094c357f3beaa
2021-09-30 10:03:49 +00:00
Tirumarai Selvan
b0f723b201 tag release v2.1.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2472
GitOrigin-RevId: b18f755b8db82ee6376d9af02495fe55cfd93aa8
2021-09-30 09:48:30 +00:00
Aravind K P
61e069ad8a cli: allow specifiying a "to" version on migrate squash command
closes https://github.com/hasura/graphql-engine/issues/7472

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2442
GitOrigin-RevId: d804d04e0b87fc33c25407ff3991f266b0d6a6aa
2021-09-29 17:47:25 +00:00
Robert
fbd1262ea6 server: operation timeout with postgres cancelling
### Description

This PR implements operation timeouts, as specced in #1232.

RFC: [rfcs/operation-timeout-api-limits.md](c025a90fe9/rfcs/operation-timeout-api-limits.md)

There's still some things to be done (tests and docs most notably), but apart from that it can
be reviewed. I'd still appreciate feedback on the RFC!

TODO:
- [x] break out the `ApiLimits` refactoring into a separate PR: #2103
- [x] finish the `pg-client-hs` PR: https://github.com/hasura/pg-client-hs/pull/39
- [x] remove configurability, after testing, prior to merging
- [ ] tests: #2390 has some tests that I've run locally to confirm things work on a fundamental level
- [x] changelog
- [x] documentation
- [x] fill in the detailed PR checklist

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [x] Docs
- [ ] Tests

### Related Issues

Product spec: #1232.

### Solution and Design

Compare `rfcs/operation-timeout-api-limits.md`.

### Steps to test and verify

Configure operation timeouts, e.g. by posting

```
{
  "type": "set_api_limits",
  "args": {
    "operation_timeout": {
      "global": 3
    }
  }
}
```

to `v1/metadata` to set an operation timeout of 3s. Then verify that
1. non-admin queries that take longer than 3s time out with a nice error message
2. that those queries return after ~3s (at least for postgres)
3. also that everything else still works as usual

### Limitations, known bugs & workarounds
- while this will cause slow queries against any backends to fail, it's only verified to actually interrupt queries against postgres
- this will only successfully short-cut (cancel) queries to postgres if the database server is responsive

#### Catalog upgrade
Does this PR change Hasura Catalog version?
- [x] No

#### Metadata

Does this PR add a new Metadata feature?
- [x] Yes
  - Does `run_sql` auto manages the new metadata through schema diffing?
    - [x] Not required
  - Does `run_sql` auto manages the definitions of metadata on renaming?
    - [x] Not required
  - Does `export_metadata`/`replace_metadata` supports the new metadata added?
    - [x] Yes

#### GraphQL
- [x] No new GraphQL schema is generated

#### Breaking changes

- [x] No Breaking changes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1593
GitOrigin-RevId: f0582d0be3ed9fadf89e0c4aaf96344d18331dc4
2021-09-29 16:21:05 +00:00
Ikechukwu Eze
569fb3d217 console: fix missing cross-schema computed fields in permission builder
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2453
GitOrigin-RevId: 98f5320981f58c049fae5ca5d6801351d017edf6
2021-09-29 13:55:47 +00:00
Aravind K P
186baa7915 cli: add support for metadata subcommands to work with json/yaml files
closes https://github.com/hasura/graphql-engine/issues/7542

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2445
GitOrigin-RevId: c0087fa475cf4b353f4af150629684d3b9e1f82f
2021-09-29 11:13:31 +00:00
Lyndon Maydwell
22bc0e09df Ignore unexpected fields in action responses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2459
GitOrigin-RevId: 9269fa6e71770cb31183d917595b704c5dee9713
2021-09-29 09:54:36 +00:00
Solomon Bothwell
4e05bdcaec Feature/request transform string interpolation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2443
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: d7d68984d0ae1403bb414572e9704c01ed27deab
2021-09-29 08:14:29 +00:00
hasura-bot
20f7c85382 cli: add deploy command (close #7349)
GITHUB_PR_NUMBER: 7426
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7426

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2173
Co-authored-by: Ajay Tripathi <24985760+atb00ker@users.noreply.github.com>
Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 1030d24c9e6c7d0c7062b6f0e98f8464950529d3
2021-09-29 06:15:17 +00:00
Vishnu Bharathi
2bc9a3b92e ci: add server test jobs in buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2416
GitOrigin-RevId: 5c4b58255447135f7f1e91ef7b3cb1ef1a8f347f
2021-09-29 04:56:02 +00:00
Aravind K P
5011955f73 cli: support query_tags in metadata
closes https://github.com/hasura/graphql-engine-mono/issues/2261

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2347
GitOrigin-RevId: 30d461c0b70f4a4924496d9c3f53cb73a658093a
2021-09-28 17:05:48 +00:00
Nicolas Beaussart
0af2cbca73 console: fix storybook build
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2441
GitOrigin-RevId: f7a04b26a49d506090d6be07b97a1da9e007d79c
2021-09-28 10:16:38 +00:00
Solomon Bothwell
a7cc5df95d Fixes update_action transform bug and updates Kriti pin
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2399
GitOrigin-RevId: 009ee6ec2a3834951e464c232eb517d636ab940a
2021-09-28 01:38:24 +00:00
Kali Vara Purushotham Santhati
d87f7abd02 cli: throw user friendly errors when server is unreachable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2369
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: af635612948822ae7ea9eb7b7b79d7d4f147e0e6
2021-09-27 14:53:44 +00:00
Vishnu Bharathi
2165736497 ci: complete the CLI pipeline in buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2437
GitOrigin-RevId: 0b3cd970be1e814df7d679979af6aa09d95c21cd
2021-09-27 13:35:04 +00:00
Phil Freeman
fb1bfe9db3 server: interpTraceT docs and small changes
Adds documentation for `interpTraceT` and simplifies some call sites.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2434
GitOrigin-RevId: 77e18c6b3419430153481114a721f9192abd17b5
2021-09-25 04:00:34 +00:00
Antoine Leblanc
636960787e Fix haddock generation and introduce PR check
On `main`, currently, haddock generation is broken, due to some unrecognized comments. This PR fixes this, and changes our `build_oss_server` CI job to ensure that future PRs do not break haddock.

https://github.com/hasura/graphql-engine-mono/pull/2222

GitOrigin-RevId: 909bbcdc7b2d31c9a3e947ce6b7691e23f59b916
2021-09-24 17:02:33 +00:00
Aravind K P
566b441b12 cli: remove config v1 specific logic from migrate squash
https://github.com/hasura/graphql-engine-mono/pull/2381

Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
GitOrigin-RevId: 42db5ea7ecd46838b5f2b266beca48e5af040bb9
2021-09-24 12:06:11 +00:00
Sameer Kolhar
51ad8a18c6 document recommended node version info in README
https://github.com/hasura/graphql-engine-mono/pull/2171

GitOrigin-RevId: 35725e8b652564b1c500c81d9ae38e7f87652d57
2021-09-24 10:20:01 +00:00
Sameer Kolhar
4ca2c7554c server: support user comments for trackable functions
https://github.com/hasura/graphql-engine-mono/pull/2290

GitOrigin-RevId: 3d7cf89b7e1d545475bad44ccc233b6f11145a01
2021-09-24 09:19:40 +00:00
Robert
11a454c2d6 server, pro: actually reformat the code-base using ormolu
This commit applies ormolu to the whole Haskell code base by running `make format`.

For in-flight branches, simply merging changes from `main` will result in merge conflicts.
To avoid this, update your branch using the following instructions. Replace `<format-commit>`
by the hash of *this* commit.

$ git checkout my-feature-branch
$ git merge <format-commit>^    # and resolve conflicts normally
$ make format
$ git commit -a -m "reformat with ormolu"
$ git merge -s ours post-ormolu

https://github.com/hasura/graphql-engine-mono/pull/2404

GitOrigin-RevId: 75049f5c12f430c615eafb4c6b8e83e371e01c8e
2021-09-23 22:57:37 +00:00
Robert
a206d04062 server, CI: use ormolu as a formatter for Haskell sources
### Description

- sets up a Makefile target for running ormolu to format and check source code
- updates CI to run ormolu instead of stylish-haskell (and to check instead of format actively)

Compare #1679.

Here's the plan for merging this:
1. merge this PR; at this point, all PRs will fail CI unless they have the `ignore-server-format-checks` label set
2. merge follow-up PR #2404 that does nothing but actually reformats the codebase
3. tag the merge commit as `post-ormolu` (also on `graphql-engine`, for the benefits of community contributors)
4. provide the following script to any devs in order to update their branches:
   ```
   $ git checkout my-feature-branch
   $ git merge post-ormolu^
   $ make format
   $ git commit -a -m "reformat with ormolu"
   $ git merge -s ours post-ormolu
   ```
   (I'll put this in the commit message)

https://github.com/hasura/graphql-engine-mono/pull/2020

Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Swann Moreau <62569634+evertedsphere@users.noreply.github.com>
GitOrigin-RevId: 130f480a6d79967c8d045b7f3a6dec30b10472a7
2021-09-23 21:23:21 +00:00
awjchen
f1daabab04 docs, tests: update Explain API docs
https://github.com/hasura/graphql-engine-mono/pull/2352

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: f9f5d1157524afbe418ba0ca3e3e1d6258eaf9e3
2021-09-23 20:00:07 +00:00
Rikin Kachhia
0912fcb215 console: handle large db schemas
https://github.com/hasura/graphql-engine-mono/pull/2417

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 233eb6e61438b965ea3c7832ce44e846ffc16992
2021-09-23 14:59:26 +00:00
Divi
0adf365238 ci: migrate oss console jobs to buildkite
https://github.com/hasura/graphql-engine-mono/pull/2414

GitOrigin-RevId: 1488b67ed5c6323370943cc3cc9cd355f795a73a
2021-09-23 13:49:08 +00:00
Naveen Naidu
3d95c67748 server/query-tags: implement new metadata specification and API
https://github.com/hasura/graphql-engine-mono/pull/2203

GitOrigin-RevId: 6169fcce0c6dccaec055bf8e723e9aa7c19a7f0c
2021-09-23 12:38:56 +00:00
Rakesh Emmadi
cfd76a36bf server/mssql: improve mssql transactions
>

### Description
>
Few improvements to mssql transactions.

### Changelog

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [ ] Docs
- [ ] Community Content
- [ ] Build System
- [ ] Tests
- [ ] Other (list it)

https://github.com/hasura/graphql-engine-mono/pull/2324

GitOrigin-RevId: 808947188f5f3d196c7dfc4ebfa661629db5f8f7
2021-09-23 09:10:28 +00:00
Kali Vara Purushotham Santhati
ffce0d266b cli: non zero exit code if any of the database migrations aren't applied
Issue: https://github.com/hasura/graphql-engine/issues/7499

Problem: cli doesn't exit if `migrate apply --all-databases` fail on 1 or more databases

Solution: Store the names of the databases for which it failed and return
```
operation failed on : <database1>,<database2>,etc
```

https://github.com/hasura/graphql-engine-mono/pull/2305

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 8a30bdcc24de8a204320b00e5ea9d593a6293ad4
2021-09-23 06:50:25 +00:00
Robert
bdacf1bd23 server: remove ApplicativeDo from default extensions
I spent half the day reducing a weird compile failure here https://github.com/hasura/graphql-engine-mono/pull/1593/files#r713102990 to this https://gitlab.haskell.org/ghc/ghc/-/issues/17768#note_378004. Seems ApplicativeDo makes a mess of non-applicative monadic do in some cases. Given our rather localized use of ApplicativeDo, seemed a good idea to remove it from the list of default extensions.

It appears that ApplicativeDo also buries some unused return value warnings, so this PR also silences those. We should check that none of those warnings were warranted though.

https://github.com/hasura/graphql-engine-mono/pull/2413

GitOrigin-RevId: 1874c1a82230431849265755b1407beebc947041
2021-09-22 15:35:54 +00:00
Kali Vara Purushotham Santhati
40c3d08d4a cli: migrate apply progress bar improvements
https://github.com/hasura/graphql-engine-mono/pull/2356

GitOrigin-RevId: 181db6e14ffd08083a1ffc97bf2e0e578f3da0fc
2021-09-22 12:53:43 +00:00
Kali Vara Purushotham Santhati
24d9bbcd93 cli: apply the migration after creating for flag --from-server
Issue: https://github.com/hasura/graphql-engine/issues/7510

Problem:

- To mark the migration applied after creating the migration from the server with skip-execution flag

Solution:

After creating migration apply it with skip-execution true

https://github.com/hasura/graphql-engine-mono/pull/2333

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 72eca352b76afe3a19d2198169b31284e38af07a
2021-09-22 11:48:29 +00:00
jkachmar
112d206fa6 Adds Remote Source Join Execution
https://github.com/hasura/graphql-engine-mono/pull/2038

Co-authored-by: Phil Freeman <630306+paf31@users.noreply.github.com>
GitOrigin-RevId: 0843bd0610822469f727d768810694b748fec790
2021-09-22 10:44:01 +00:00
Ikechukwu Eze
be6cd11319 console: fix cross-schema array relationship suggestions
https://github.com/hasura/graphql-engine-mono/pull/2365

GitOrigin-RevId: a677c46c21a067af847643b1dc021f6fcbe025c8
2021-09-22 09:25:19 +00:00
Kali Vara Purushotham Santhati
4cf13762e2 cli: add support for network metadata object
Issue: https://github.com/hasura/graphql-engine/issues/7520

Problem: add support for network metadata object

Solution: add new network.yaml which consists of network metadata and in code add new network metadata object

Metadata.json
```
{
  "resource_version": 6,
  "metadata": {
    "version": 3,
    "sources": [
      {
        "name": "default",
        "kind": "postgres",
        "tables": [],
        "configuration": {
          "connection_info": {
            "use_prepared_statements": true,
            "database_url": {
              "from_env": "HASURA_GRAPHQL_DATABASE_URL"
            },
            "isolation_level": "read-committed",
            "pool_settings": {
              "connection_lifetime": 600,
              "retries": 1,
              "idle_timeout": 180,
              "max_connections": 50
            }
          }
        }
      }
    ],
    "network": {
      "tls_allowlist": [
        {
          "suffix": null,
          "permissions": [
            "self-signed"
          ],
          "host": "www.google.com"
        },
        {
          "suffix": null,
          "permissions": [
            "self-signed"
          ],
          "host": "play.golang.com"
        },
        {
          "suffix": null,
          "permissions": [
            "self-signed"
          ],
          "host": "hasura.io"
        }
      ]
    }
  }
}
```
network.yaml
```
tls_allowlist:
- suffix: null
  permissions:
  - self-signed
  host: www.google.com
- suffix: null
  permissions:
  - self-signed
  host: play.golang.com
- suffix: null
  permissions:
  - self-signed
  host: hasura.io

```

https://github.com/hasura/graphql-engine-mono/pull/2343

GitOrigin-RevId: ef508ae946dc5c7c5bcb4a9a3ccb982394ae8639
2021-09-22 08:12:46 +00:00