Commit Graph

159 Commits

Author SHA1 Message Date
Nicolas Beaussart
2c3d91b033 frontend: switch cli and server to use the new nx assets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7533
GitOrigin-RevId: 8adde90a90115c2782dc77b9f30297499f22acab
2023-01-25 12:07:01 +00:00
Rakesh Emmadi
f2a5d7cef3 server/pro/multitenant: Postgres connection routing using kriti templates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6822
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 61cfc00a97de88df1ede3f26829a0d78ec9c0bc5
2023-01-25 07:14:31 +00:00
Abby Sassel
85cda65261 server: introduce Native Query Interface prototype feature flag
[NDAT-490]: https://hasurahq.atlassian.net/browse/NDAT-490?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NDAT-491]: https://hasurahq.atlassian.net/browse/NDAT-491?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[NDAT-468]: https://hasurahq.atlassian.net/browse/NDAT-468?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7487
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
GitOrigin-RevId: ba679fc69df4b669fc7936cd359b8268e8e1a23a
2023-01-23 13:37:13 +00:00
Daniel Chambers
0b35798fa7 Fix get_source_tables integration data connector config transformation test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7605
GitOrigin-RevId: 02b33784375888854c3f663c3cf0a84b049682a6
2023-01-23 01:06:56 +00:00
pranshi06
ae5f3fe593 server: fix next_retry_at for MSSQL event triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7376
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: 3a287271320fbb489dbabcd163b1b474fa5132b6
2023-01-20 11:16:30 +00:00
Daniel Harvey
0270dbf4b4 [server/tests] use fresh HGE for stringify numeric types tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7582
GitOrigin-RevId: 7c7832d322024b01987f1568a87793a7c0a969db
2023-01-20 10:40:01 +00:00
Daniel Harvey
0dfeea2c5a [server/tests] de-dupe Postgres harness code
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7581
GitOrigin-RevId: 09f83190e0095d471d7aca6025c43026270d7b58
2023-01-19 10:09:30 +00:00
Daniel Chambers
354f7593d9 Custom update column operator support for Data Connectors [GDC-688]
[GDC-688]: https://hasurahq.atlassian.net/browse/GDC-688?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7548
GitOrigin-RevId: 861638d6cc69803776640b50ffe1646b3cf0a7db
2023-01-19 04:22:58 +00:00
Daniel Harvey
40bcd5545b [server/tests] make useHge work with Fixtures
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7560
GitOrigin-RevId: 370e5b3ee4d508e7ca5eea426886bf6c82d0cde9
2023-01-18 15:53:01 +00:00
Daniel Chambers
c104ffdb51 Fix SQLite agent including built-in comparison operators as custom operators
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7565
GitOrigin-RevId: 83a8868a80a124aee05b8dd42a4ffa15489891ae
2023-01-18 07:36:00 +00:00
Daniel Harvey
611bd0363f [server] make Custom SQL metadata commands admin-only
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7549
GitOrigin-RevId: a87f4e083b3e3dfeb51fd6e1fbb3158fb4ac2edf
2023-01-17 16:09:58 +00:00
Daniel Chambers
308d310d62 Refactor Mock Data Connector Agent Integration Tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7531
GitOrigin-RevId: b5111a46ba42c22b110a021b8d0404b114edaba7
2023-01-17 06:44:48 +00:00
Lyndon Maydwell
8d6b9f70f1 Datasets implementation for dataconnectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7502
GitOrigin-RevId: 7ca9a16aa2b27f4efb1263c6415e5a718ca8ced8
2023-01-17 05:49:10 +00:00
Daniel Chambers
bfdeaf0334 Data Connectors insert mutations support [GDC-609]
[GDC-609]: https://hasurahq.atlassian.net/browse/GDC-609?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7513
GitOrigin-RevId: cb401e3ed84c5b60ec59b63dc478a1162b360135
2023-01-17 00:35:22 +00:00
David Overton
a9f77acb32 Remove builtin scalar types from Data Connector backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7167
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 926e7282b908e3a9669ac39d625aa54971e11c37
2023-01-11 02:37:26 +00:00
Lyndon Maydwell
d34bea3e97 Metadata API for Suggesting Relationships from HGE
[GDC-629]: https://hasurahq.atlassian.net/browse/GDC-629?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7420
GitOrigin-RevId: 0bf69f8409d5141783f9cf5d8d54f798d9e05e65
2023-01-09 07:26:55 +00:00
Daniel Harvey
e58ebb10e0 [server/test] Postgres cross-schema tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7437
GitOrigin-RevId: f324fd4ede516238ec4904dd19c0094e21b69b7d
2023-01-06 15:36:19 +00:00
Puru Gupta
bf201e534c server: refactor serverctx data types
## Description
This PR merges the data type `ServeCtx` into `ServerCtx` to create a single data type which has all the required context to run HGE.

## Motivation
This consolidated data type will be easier to update/maintain in case of any changes to the user config.

### Related Issues
https://hasurahq.atlassian.net/browse/GS-301

[GS-301]: https://hasurahq.atlassian.net/browse/GS-301?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7396
GitOrigin-RevId: f37594d15855bb50e556a4b11a58609af3f9f312
2023-01-06 09:34:44 +00:00
Philip Lykke Carlsen
b1f065447f server/tests: Update README.md files
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7426
GitOrigin-RevId: b16cbe61c5274146c9adc1434a48dc95c964dd8c
2023-01-03 14:27:22 +00:00
Philip Lykke Carlsen
67280023a2 server/tests: Ability to run HGE via external process.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7329
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 74b293a1d5fb7de52a85e42cfcb0314af0006822
2023-01-03 14:05:02 +00:00
awjchen
ee78e32c6e server: implement trace sampling
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7300
GitOrigin-RevId: d96d7fa5aaf0c1e71d1c4c0fa8f0162abce39e18
2022-12-22 19:48:51 +00:00
Rakesh Emmadi
e1bf220b37 fix the issue with multiplexed queries, where a run-time exception caused by one subscription causes all subscriptions to fail (fix #9281)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7230
GitOrigin-RevId: e94764a4652e7ee99e0e39d64436aa05620086cb
2022-12-22 17:09:30 +00:00
Tom Harding
8490874eab Show instance for GlobalTestEnvironment
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7370
GitOrigin-RevId: 77dbcfb686219ce23e4d751c8d934f81c04a222d
2022-12-22 13:19:34 +00:00
Daniel Harvey
dc99e919d9 server/tests: search for 'things containing db name' not just 'db name'
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7343
GitOrigin-RevId: 2c8be65c71eec1ada4a0ca716d0b95ba21325a0d
2022-12-21 11:58:32 +00:00
Solomon
ca6a46790c [GDC] Add Athena Test Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6934
GitOrigin-RevId: 31c9071b9e904fbe31034157d83605e0a625bef1
2022-12-20 18:47:07 +00:00
Abby Sassel
d0f31e59e8 server/tests: cleanup RemoteRelationshipStringifyNum8387Spec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7333
GitOrigin-RevId: 91a1d4726523033e7b3018d18b45aa98babac7a7
2022-12-20 08:45:38 +00:00
Abby Sassel
a8500b44ed server/fix: stringify-numeric-types option in remote database relationships (fix #8387)
Fix bug where `stringify-numeric-types` option is not respected in remote database relationships

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7302
GitOrigin-RevId: a649b00b45ca0f67dc84ad893d3d98529b064c77
2022-12-19 14:04:58 +00:00
Daniel Harvey
2bfca9941d [server] newtypes for BigQuery projectId and dataset
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7279
GitOrigin-RevId: 878367c073280111f381eec75c5b53e9e02bd3cd
2022-12-16 13:19:05 +00:00
Philip Lykke Carlsen
bd2e2080f8 server/tests: Port TestGraphQLQueryFunctions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7158
GitOrigin-RevId: a4b3ca8565df37905665303f96fd40ec4b9e76dd
2022-12-15 16:42:55 +00:00
Tom Harding
ae33e34e2d Implement permission checks in the API tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7264
GitOrigin-RevId: 55ff8ff31609b7598d2382ded5dd96f5825ee4fd
2022-12-15 16:02:31 +00:00
Tom Harding
f2dd4a5eb7 Remove *Source fields from API test permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7275
GitOrigin-RevId: 44345ec361fdbb93f2c166825e5d78983759b5b0
2022-12-14 18:43:44 +00:00
Gil Mizrahi
570e16efe7 Revert "[server/test] create new HGE per test"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7255
GitOrigin-RevId: c971e9e227263b0956069c0687acacf4d3ff90a9
2022-12-13 12:37:27 +00:00
Daniel Harvey
ed190d6cb6 [server/tests] drop old postgres database better, and use less connections
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7227
GitOrigin-RevId: d7b3b313440d3f3c91d4ecb550513b53cbf2e92e
2022-12-12 17:46:12 +00:00
Lyndon Maydwell
e9dcbf6491 Adding custom scalar types to SQLite DC Agent - GDC-610
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6783
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: ee53c20b0090b6b3c88792ddc98b8287872fe0f3
2022-12-08 06:50:08 +00:00
Daniel Chambers
c14fd3ba4c Add mutability properties to the Data Connector schema API [GDC-664]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7190
GitOrigin-RevId: ce602b5e5cc5aee8716ff3f7a036b18b3bf47188
2022-12-08 02:07:01 +00:00
Daniel Harvey
1dd9e19b69 [server/test] create new HGE per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7111
GitOrigin-RevId: 6d3e88cb29ca3e98cbd16141c9f924aa36fa6b43
2022-12-07 17:06:42 +00:00
Lyndon Maydwell
3d5fb984b0 Fix metadata defaults bug - Defaults serialised into metadata table - GDC-647
## Description

There is a bug in the metadata defaults code, see [the original PR](https://github.com/hasura/graphql-engine-mono/pull/6286).

Steps to reproduce this issue:

* Start a new HGE project
* Start HGE with a defaults argument: `HASURA_GRAPHQL_LOG_LEVEL=debug cabal run exe:graphql-engine -- serve --enable-console --console-assets-dir=./console/static/dist --metadata-defaults='{"backend_configs": {"dataconnector": {"mongo": {"display_name": "BONGOBB", "uri": "http://localhost:8123"}}}}'`
* Add a source (doesn't need to be related to the defaults)
* Export metadata
* See that the defaults are present in the exported metadata

## Related Issues

* Github Issue: https://github.com/hasura/graphql-engine/issues/9237
* Jira: https://hasurahq.atlassian.net/browse/GDC-647
* Original PR: https://github.com/hasura/graphql-engine-mono/pull/6286

## Solution

* The test for if defaults should be included for metadata api operations has been extended to check for updates
* Metadata inconsistencies have been hidden for `/capabilities` calls on startup

## TODO

* [x] Fix bug
* [x] Write tests
* [x] OSS Metadata Migration to correct persisted data - `server/src-rsr/migrations/47_to_48.sql`
* [x] Cloud Metadata Migration - `pro/server/res/cloud/migrations/6_to_7.sql`
* [x] Bump Catalog Version - `server/src-rsr/catalog_version.txt`
* [x] Update Catalog Versions - `server/src-rsr/catalog_versions.txt` (This will be done by Infra when creating a release)
* [x] Log connection error as it occurs *(Already being logged. Requires `--enabled-log-types startup,webhook-log,websocket-log,http-log,data-connector-log`)
* [x] Don't mark metadata inconsistencies for this call.

## Questions

* [ ] Does the `pro/server/res/cloud/migrations/6_to_7.sql` cover the cloud scenarios?
* [ ] Should we have `SET search_path` in migrations?
* [x] What should be in `server/src-rsr/catalog_versions.txt`?

## Testing

To test the solution locally run:

> docker compose up -d

and

> cabal run  -- exe:api-tests --skip BigQuery --skip SQLServer --skip '/Test.API.Explain/Postgres/'

## Solution

In `runMetadataQuery` in `server/src-lib/Hasura/Server/API/Metadata.hs`:

```diff
-        if (exportsMetadata _rqlMetadata)
+        if (exportsMetadata _rqlMetadata || queryModifiesMetadata _rqlMetadata)
```

This ensures that defaults aren't present in operations that serialise metadata.

Note: You might think that `X_add_source` would need the defaults to be present to add a source that references the defaults, but since the resolution occurs in the schema-cache building phase, the defaults can be excluded for the metadata modifications required for `X_add_source`.

In addition to the code-change, a metadata migration has been introduced in order to clean up serialised defaults.

The following scenarios need to be considered for both OSS and Cloud:

* The user has not had defaults serialised
* The user has had the defaults serialised and no other backends configured
* The user has had the defaults serialised and has also configured other backends

We want to remove as much of the metadata as possible without any user-specified data and this should be reflected in migration `server/src-rsr/migrations/47_to_48.sql`.

## Server checklist

### Catalog upgrade

Does this PR change Hasura Catalog version?
-  Yes

### Metadata
Does this PR add a new Metadata feature?
-  No

### GraphQL
-  No new GraphQL schema is generated

### Breaking changes
-  No Breaking changes

## Changelog

__Component__ : server
__Type__: bugfix
__Product__: community-edition

### Short Changelog

Fixes a metadata defaults serialization bug and introduces a metadata migration to correct data that has been persisted due to the bug.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7034
GitOrigin-RevId: ad7d4f748397a1a607f2c0c886bf0fbbc3f873f2
2022-12-06 22:35:19 +00:00
Solomon
599d9fd602 Dynamic Dispatch For Test Harness BackendType Metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6982
GitOrigin-RevId: faeec9ba0dfcb641c13cdc3f88244237fb370c66
2022-12-06 00:06:53 +00:00
Daniel Harvey
aa9499ee0e [server/tests] remove unnecessary cleanup
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7157
GitOrigin-RevId: 93dc285c8629586336e56bb1622d94af0faa3e0e
2022-12-05 11:41:38 +00:00
Gil Mizrahi
1970785970 fix api-tests warnings and enable -Wall
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7137
GitOrigin-RevId: 1c06f99ef94e1343d33c79e59e844c0470ba71aa
2022-12-05 08:31:00 +00:00
Daniel Harvey
ef5e983aee [server/tests] simplify TestEnvironment
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7123
GitOrigin-RevId: 0a7313dab729de08e273ba06e47f656d766ff82a
2022-12-02 11:36:57 +00:00
Daniel Harvey
16ecd63b01 [server/tests] don't do detailed teardown
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7128
GitOrigin-RevId: cbc52dadaca8ef7d4affb43528e8dcec0c8ec62e
2022-12-02 09:00:07 +00:00
Abby Sassel
13eb1122ed server/tests: Table Computed Fields > Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7122
GitOrigin-RevId: e8c191a87465c1810908e8851bcc4b6919873bd8
2022-12-01 16:43:54 +00:00
Gil Mizrahi
9ce6fe7197 Feature matrix standalone tester tool
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7120
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
GitOrigin-RevId: 5db7f8e24f22414805b10143248bfacfb5b7a03a
2022-12-01 14:48:55 +00:00
David Overton
a18c6976f8 Map scalar types to GraphQL built-in types for parsing [GDC-587]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6818
GitOrigin-RevId: 6d1887fb7865fe8ec24a73c77da291c7ecf8dfd2
2022-12-01 00:08:40 +00:00
Philip Lykke Carlsen
9bc1ff1d8e Structured logging in test-harness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7092
GitOrigin-RevId: 201ee3ddc205bfc9d55c167e0b70b6606dbe4aa7
2022-11-30 12:12:21 +00:00
Daniel Chambers
ed79049637 Mutation Data Connector API types [GDC-594]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6893
GitOrigin-RevId: edf0f72027197ae61bfa8d27d53eabf6ca626112
2022-11-29 03:37:13 +00:00
Abby Sassel
37e7480822 server/tests: refactor XToDBArrayRelationshipSpec setup/teardown
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7055
GitOrigin-RevId: 71d631165e4364d9cc22c303becf75fef5d01497
2022-11-25 17:59:19 +00:00
Philip Lykke Carlsen
afa1e2fc02 server/tests: Port Citus table relationship tests from pytest
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7047
GitOrigin-RevId: 1ddcc656a43adc2c34f36fa4cf220eebb91f09ae
2022-11-25 15:40:49 +00:00
Daniel Harvey
9dc863e479 [server/tests] allow api-tests to be filtered by backend type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7056
GitOrigin-RevId: 84618c3d5a0c2273b51584831287968b4df73fba
2022-11-25 15:40:41 +00:00
Tom Harding
b85a6572bf Make fixtureRepl work again
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6906
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: cf00c31f610ad65305a007d8fbc6b7971ce9b7a9
2022-11-25 13:15:43 +00:00
Abby Sassel
eebeb5cc3b Server/tests: Remote Relationships > Citus
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7040
GitOrigin-RevId: 1a177e2d8a903144576990d047addcef70c69544
2022-11-24 13:31:04 +00:00
Karthikeyan Chinnakonda
e9794a6639 server: fix bug with customized remote schema enum variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6993
GitOrigin-RevId: 0458c806176e752aea5a848e68246744c3e5b38a
2022-11-24 08:47:46 +00:00
Samir Talwar
c6557ced13 server/test-harness: Do not fail if the database cannot be dropped.
Sometimes this happens, especially in CI. It's alright. We can just leave it lying around and it will be destroyed when the container and associated volume are removed.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7003
GitOrigin-RevId: dcb74920c12341d7a15f9b6ebfe52d0864de4738
2022-11-23 07:54:44 +00:00
Daniel Harvey
80c3846aaa [server/tests] run setup for each set of tests again
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7000
GitOrigin-RevId: 2e85870c970144dbd417cf555b14b63c18f495ab
2022-11-23 07:54:28 +00:00
Daniel Harvey
bc2d173161 [server/tests] New SQLServer DB per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6834
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 3ee30313e47ba64d5b50ff46345ce507735c4d1f
2022-11-23 07:54:10 +00:00
Daniel Harvey
4683d4786d [server/tests] new Citus DB per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6833
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 343aba12ff30c67908160b4c153334d46c5655ff
2022-11-18 11:10:29 +00:00
Lyndon Maydwell
7228d0327f Add display_name, release_name fields to MD Agent APIs - GDC-626
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6849
GitOrigin-RevId: 0ab90aaf281cc1c043f73fd6d63c4c18d58c7c92
2022-11-18 04:19:08 +00:00
Tom Harding
bb141dacb4 String interpolation for Postgres backend module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6927
GitOrigin-RevId: 153975ec6e860a0bd1a06a85f11567d0fdc5b14d
2022-11-17 20:08:25 +00:00
Tom Harding
28af0a74e3 String interpolation for Cockroach backend module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6922
GitOrigin-RevId: 62eb29eb9fcf1c11300a82682b0c1e246308e874
2022-11-17 15:11:44 +00:00
Tom Harding
0ff55c37f8 Remove MySQL tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6872
GitOrigin-RevId: 87a55e2384433c076c8815f991e753e4112d60dd
2022-11-16 11:26:01 +00:00
Tom Harding
93a2736c30 String interpolation for Citus backend modules
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6884
GitOrigin-RevId: abb15634de5c0a387284e2bed25622c302df6a3b
2022-11-16 10:38:50 +00:00
Tom Harding
502115f969 Bump aeson to v2.1, drop the Extended module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6869
GitOrigin-RevId: ecb2f7dfe7d00c0a01999c12b0264be7850e0f42
2022-11-15 10:44:36 +00:00
Daniel Harvey
ab0f67cfd9 [server/tests] fallback to default postgres port when none is provided
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6860
GitOrigin-RevId: abe30f2fa1df89281dae0ffaf9ef20ef50cf7d33
2022-11-14 22:38:28 +00:00
Tom Harding
c0070bfd4b Add the ability to run api-tests against any (Postgres-like) connection string.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6791
GitOrigin-RevId: 5005eba75efbf7a0d7208be0a0794d63be82afd5
2022-11-10 09:44:11 +00:00
Samir Talwar
44a64ed983 server/test-harness: Wrap test resource setup/teardown.
When setting up a resource (typically some kind of web server) for use in tests, we need to remember to tear it down afterwards.

This moves this logic into one place, under the `TestResource` module.

Like `SetupAction`, it encapsulates setup and teardown, and also separates out waiting for the resource to be ready, so we don't accidentally leave it lying around in the case of a healthcheck failure.

Unlike `SetupAction`, it is monadic, and can be composed with other resources. In the future, we may want to adopt this logic for `SetupAction` too rather than using lists.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6806
GitOrigin-RevId: 74e2d76c5c09b8e0fe1cad84c9e77011f5a4d3db
2022-11-10 08:38:09 +00:00
Philip Lykke Carlsen
eb9506d954 server/tests: Structured logging in tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6805
GitOrigin-RevId: 4e4d3c12bad20948b5ad58b3ad6d1e882f4ceddb
2022-11-09 14:56:12 +00:00
Samir Talwar
8be01ae9aa server/api-tests: Use setupTablesAction everywhere.
This removes calls to `setup` and `teardown` in favor of `setupTablesAction`.

Because this action untracks and drops tables (at least until we figure out how to make throwaway databases), the teardown phase can fail. I have added a wrapper which logs and discards exceptions as a workaround for now.

In the future, when we can simply drop the database, it will probably be sensible to catch "table already untracked" exceptions specifically and let them slide, while still failing on all other exceptions.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6769
GitOrigin-RevId: 12cb8f81dd6aced892fe83c49b9a0bdbef8cc1ac
2022-11-09 09:36:43 +00:00
Solomon
1ff7d3535f Refactor DataConnector FixtureName constructors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6756
GitOrigin-RevId: 5f736a891ad15d4707f6a9d88037cbc89a4c00e5
2022-11-09 05:09:04 +00:00
Daniel Harvey
2d8e6372e9 [server/tests] - fresh CockroachDB per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6788
GitOrigin-RevId: 71e1f0840de101796d2ebeec240a4f0075640a68
2022-11-08 18:59:17 +00:00
Daniel Harvey
48bb73ecb4 [server/tests] create new Postgres DB for each test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6741
GitOrigin-RevId: 0fa10ff8e3ab0ca9c36b1146ebf70434836f2531
2022-11-08 11:44:13 +00:00
Philip Lykke Carlsen
6720d77cd9 Perform fixture setup spec-by-spec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6708
GitOrigin-RevId: ac4b7350f6c0e9719f8b5973b267d72e3e4e444c
2022-11-03 20:27:02 +00:00
Philip Lykke Carlsen
1fa7f9b881 server/tests: Move 'emptySetupAction' to its single usage site
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6704
GitOrigin-RevId: 9adac1913fff3735b44c89c206e92544c9aa760b
2022-11-03 16:29:28 +00:00
Philip Lykke Carlsen
a4792a6b80 server/tests: Remove unnecessary complexity from Harness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6700
GitOrigin-RevId: 3130097581b4e9284cd1074a5d74eb5165354eb4
2022-11-03 15:57:54 +00:00
Tom Harding
d823d201b9 CREATE SCHEMA _ IF NOT EXISTS in api-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6701
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 13ab91a8c4241fb4e60df9e8856bc926afac6be9
2022-11-03 14:54:48 +00:00
Philip Lykke Carlsen
5b2877bc8f server/tests: Move subscriptions harness to a separate module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6664
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: f5d7793606a50fb10f871ae757748fe5c21e50c8
2022-11-03 10:58:32 +00:00
Samir Talwar
342391f39d Upgrade Ormolu to v0.5.
This upgrades the version of Ormolu required by the HGE repository to v0.5.0.1, and reformats all code accordingly.

Ormolu v0.5 reformats code that uses infix operators. This is mostly useful, adding newlines and indentation to make it clear which operators are applied first, but in some cases, it's unpleasant. To make this easier on the eyes, I had to do the following:

* Add a few fixity declarations (search for `infix`)
* Add parentheses to make precedence clear, allowing Ormolu to keep everything on one line
* Rename `relevantEq` to `(==~)` in #6651 and set it to `infix 4`
* Add a few _.ormolu_ files (thanks to @hallettj for helping me get started), mostly for Autodocodec operators that don't have explicit fixity declarations

In general, I think these changes are quite reasonable. They mostly affect indentation.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6675
GitOrigin-RevId: cd47d87f1d089fb0bc9dcbbe7798dbceedcd7d83
2022-11-02 20:55:13 +00:00
Gil Mizrahi
60bd73e8d9 add a test for subscriptions with variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6653
GitOrigin-RevId: b7d7f7392c50e983183812b270af3516c831d859
2022-11-02 12:47:04 +00:00
Daniel Harvey
11ff01f3e9 [server] Fix CockroachDB live queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6551
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: e78ce17d3ff5c677360b2927dca04a91e144952e
2022-11-02 11:41:02 +00:00
Tom Harding
7df6198b68 Add multiplexed subscription testing
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6637
GitOrigin-RevId: a92b333b88c548ba514e69598a86098d8f6243cc
2022-11-02 09:39:47 +00:00
Solomon
f5c68ee49e Fixes chinook table/column customizations to have consistent casing
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6642
GitOrigin-RevId: 629879fa057c3860aac1c3a83d2dfd199edb44e1
2022-11-01 22:08:59 +00:00
Daniel Harvey
cc87b25373 [tests] - allow Postgres source DB port to be overwritten in api-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6646
GitOrigin-RevId: b96a68c5eab1ac33a226d2d89141e0de9eaeff93
2022-11-01 21:05:00 +00:00
Tom Harding
fbcf90d56f Add a test for Distinct queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6426
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 65387489ab0cabe0cb520799821380732ecef3e7
2022-11-01 19:58:46 +00:00
David Overton
87bcdb97c7 Use JSON instead of GraphQL for comparison operators
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6563
GitOrigin-RevId: 0819414df199292e0146ce3009295ce3e49f2439
2022-10-28 01:14:09 +00:00
Daniel Harvey
8ad0c65051 [tests] api-tests use separate metadata database
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6573
GitOrigin-RevId: baa425216fc7394d01d0e2923d7c7e54598da40b
2022-10-27 19:08:45 +00:00
Tom Harding
78f3754953 Add Cockroach and Postgres to DataValidation tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6343
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 9f5d98e180721eaf12fd4c4e60a42b6dee6b5cca
2022-10-27 12:20:41 +00:00
David Overton
9921823915 GDC-189 custom aggregations
>

## Description
->

This PR allows DC agents to define custom aggregate functions for their scalar types.

### Related Issues
->

GDC-189

### Solution and Design
>

We added a new property `aggregate_functions` to the scalar types capabilities. This allows the agent author to specify a set of aggregate functions supported by each scalar type, along with the function's result type.

During GraphQL schema generation, the custom aggregate functions are available via a new method `getCustomAggregateOperators` on the `Backend` type class.
Custom functions are merged with the builtin aggregate functions when building GraphQL schemas for table aggregate fields and for `order_by` operators on array relations.

### Steps to test and verify
>

• Codec tests for aggregate function capabilities have been added to the unit tests.
• Some custom aggregate operators have been added to the reference agent and are used in a new test in `api-tests`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6199
GitOrigin-RevId: e9c0d1617af93847c1493671fdbb794f573bde0c
2022-10-27 00:44:06 +00:00
Philip Lykke Carlsen
064095abdb server/tests: Add ability to test subscriptions in test-harness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6494
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: d773139d59e590a5dbbc1c596958e2731dff3e76
2022-10-25 09:06:45 +00:00
Daniel Harvey
daf55101f4 tests: force remove BigQuery datasets and don't bother manually removing tables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6473
GitOrigin-RevId: 15cefa76cfd472f4197ae965970dfbc203f694a4
2022-10-24 16:54:35 +00:00
Samir Talwar
c3afa0fdd7 Install and use ODBC Driver 18 for SQL Server (msodbcsql18).
This installs the ODBC Driver 18 for SQL Server in all our shipped Docker images, and update our tests and documentation accordingly.

This version supports arm64, and therefore can run natively (or via Docker) on macOS on aarch64.

`msodbcsql17` is still installed in production-targeted Docker images so that users do not _have_ to migrate to the new driver.

Nix expressions are packaged for the new driver, as it is not yet available in nixpkgs.

In this version, [the default encryption setting was changed from "no" to "yes"](https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228). In addition, "mandatory" and "optional" were added as synonyms for "yes" and "no" respectively.

I have therefore modified all connection strings in tests to specify `Encrypt=optional` (and changed some from `Encrypt=no`). I chose "optional" rather than "no" because I feel it's more honest; these connection strings will work with or without an encrypted connection.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6241
GitOrigin-RevId: 959f88dd1f271ef06a3616bc46b358f364f6cdfd
2022-10-21 16:25:04 +00:00
Daniel Harvey
ac4b15c07b CI: reject unused imports
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6466
GitOrigin-RevId: 157a51f338e4e80dffedb8b0dcf57173ba6bd126
2022-10-21 11:12:53 +00:00
Daniel Harvey
be9c3e5a66 tests: remove unused imports
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6456
GitOrigin-RevId: 563ce912236552c4bf75dc7f7f506b7dced25118
2022-10-20 13:14:00 +00:00
Lyndon Maydwell
37c65d4395 Support MetadataDefaults Options - GDC-108
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6286
GitOrigin-RevId: ef861e6070e667322fb2657166d3d343d6cab4bc
2022-10-20 12:46:45 +00:00
Antoine Leblanc
49d0594759 [server] prune join fields of remote relationships to remote schema (close hasura/graphql-engine#8345)
## Description

This PR fixes hasura/graphql-engine#8345: when creating the final representation of a remote relationship to a remote schema (a `RemoteJoin`), we would mistakenly label ALL join fields in the selection set as being relevant to that one relationship: if there are more than one remote relationship to process in that selection set, that would be the union of all their join fields. The problem with this error is that, when processing remote relationships, we correctly ignore all the ones for which at least one join key is null. Consequently, this error would result in us ignoring remote relationships for which an _unrelated_ join key was null, resulting in that data missing in the final JSON result.

This PR simply ensures that the aggregation of fields that are passed to `createRemoteJoin` is pruned to only contain the fields relevant to the join being created. This is a very small change, and the bulk of this PR is the regression tests.

## Changelog

__Component__ : server
__Type__: bugfix
__Product__: community-edition

### Short Changelog

fix remote relationship to remote schema sometimes being erroneously null when multiple relationships are defined on the same table / graphql object ([#8345](https://github.com/hasura/graphql-engine/issues/8345))

### Long Changelog

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6420
GitOrigin-RevId: eb54462724b007f80b674dcf234adf6d9cfaaf79
2022-10-20 00:11:51 +00:00
Gil Mizrahi
c6fdb44388 Test on_conflict on cockroachdb.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6423
GitOrigin-RevId: 58e1c3f60934332720cadb74c8cb29730e797287
2022-10-19 08:51:49 +00:00
Gil Mizrahi
666f34d564 Add cockroach to default and on_conflict tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6412
GitOrigin-RevId: 637abad70096a06c39a13b9c8683444e2bebdecf
2022-10-18 19:48:27 +00:00
Solomon
1e8846d27d Refactor GDC Fixture Modules for Hspec Tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6358
GitOrigin-RevId: 19b63d1db75998875463eb2a88e938eba688ecb0
2022-10-18 05:33:46 +00:00
Solomon
15ac95d446 Adds GDC Fixture to query specs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6352
GitOrigin-RevId: 2abba0743648e7f24baddd7591eee737ba795869
2022-10-18 02:48:33 +00:00
Solomon
5e85b0c534 Mutable Sqlite GDC Fixture - GDC-455
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6351
GitOrigin-RevId: bdcb3cfa694dda6a0d1473331bc689aae418a5bb
2022-10-17 22:53:14 +00:00
Solomon
011e7be360 Dispatch JSON serialization by BackendType for Table Names in Test Suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6350
GitOrigin-RevId: 736a41592c3acd018fa1777dafc0b2e8098d2dc6
2022-10-14 01:47:49 +00:00