Commit Graph

522 Commits

Author SHA1 Message Date
Solomon
4700ac44fb Webhook Transforms: Move RequestCtx into a type family
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5975
GitOrigin-RevId: 08ad528b2600379deb4cef9d39968126c7c745d8
2022-10-16 03:55:06 +00:00
Jesse Hallett
c6bcf1cd76 server: codecs for object & array relationships, and computed fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5923
GitOrigin-RevId: e0c7584539998f5af16795f023640aa5c659b783
2022-10-13 17:57:23 +00:00
Philip Lykke Carlsen
10ae79173e Mention all src-rsr files in 'extra-source-files' section
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6341
GitOrigin-RevId: 90d9a43304ab48caa67f2d0267a821ebb51a362c
2022-10-13 13:58:20 +00:00
Jesse Hallett
332faabc24 server: codecs for remaining database configuration types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6062
GitOrigin-RevId: f1ba9fa30267d1825ba36480103cd973616f3079
2022-10-12 16:30:05 +00:00
Brandon Simmons
823babe885 server: switch to ghc 9.2 (2nd try)
## Migrating, for server devs

You will need the fork of 9.2.4 that we're using (for now):

```
ghcup -c -n install ghc --force -u "https://storage.googleapis.com/graphql-engine-cdn.hasura.io/ghc-bindists/ghc-x86_64-deb10-linux-9.2.4-hasura-fix.tar.xz" 9.2.4
```

or for m1 mac:

```
ghcup -c -n install ghc --force -u  "https://storage.googleapis.com/graphql-engine-cdn.hasura.io/ghc-bindists/ghc-arm64-apple-darwin-9.2.4-hasura-fix.tar.xz"
```

Samir is working on a nix build for nix folx

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6154
GitOrigin-RevId: 6716e3f2ee19f0281c8ad25383a1241fc362d616
2022-10-06 09:09:01 +00:00
Tom Harding
f05f746b94 Extract the test harness from the Hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6095
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 51693f7324e62e201a2bdc701255cf6c730745e2
2022-10-04 08:31:26 +00:00
Brandon Simmons
98a9c5af79 server: remove default +RTS -qn2 setting
We notice significant improvements to max GC pause time, for huge schema (both on 8.10 and 9.2)

This was added when we were on ghc-8.6.5. The referenced issues (from old oss repo) seem irrelevant or don't have useful information afaict

re. https://hasurahq.atlassian.net/browse/SRE-10
https://hasurahq.atlassian.net/browse/SRE-129

-----

**EDIT**: old discussion https://hasurahq.slack.com/archives/CKFUG6RCH/p1576518775017100

It sounds as though if the `replace_metadata` benchmark doesn't regress then we're okay

**EDIT**: Ooh nice, replace_metadata is much faster across the benchmark sets (see "both compared" details)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6133
GitOrigin-RevId: c1e2292f29a52584062dfebf2dd676118fcd978f
2022-09-30 20:11:54 +00:00
Philip Lykke Carlsen
7739f8e4a0 server: Permit strings for numerical input fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5996
GitOrigin-RevId: 2ed36898aa0286618f3dafe3513ef4e01c58aaba
2022-09-30 13:25:57 +00:00
Jesse Hallett
d32dc881e3 server: fix MySQL connection pool settings getting swapped on parse
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6063
GitOrigin-RevId: 90f6f8485aa6a9d073edc56dcba5530f5cf787c4
2022-09-28 21:11:26 +00:00
Tom Harding
a1c5ac46f6 Extract dc-api and its tests from graphql-engine.cabal
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6000
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: d8f3cd0194191ab4c51a5a7d350cb2c3a0a5a7f3
2022-09-27 07:21:54 +00:00
Daniel Harvey
f42bc4b816 server: feature flag for disabling TABLE_updates fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6039
GitOrigin-RevId: fcbafe2e4b8cf72d739033b372b536d59c398c4e
2022-09-26 13:25:37 +00:00
Lyndon Maydwell
4d2e37b3e6 Raw Query Support for Data Connectors - GDW-394
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5890
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: f6bd2ed5fe170bcce262564cf4f45c95c9bdff94
2022-09-22 21:09:06 +00:00
Tom Harding
e71496efa5 Replace Hasura.RQL.Types.Numeric with refined
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5913
GitOrigin-RevId: 96e218229a08dfbc5a598d709be1ee2083d41ec6
2022-09-21 18:03:04 +00:00
Tom Harding
8dcc8f8fca Implement aggregation tests for hspec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5960
GitOrigin-RevId: bac9bae3ea39c005f0e7b9c5f7864f012d395ebb
2022-09-20 15:23:46 +00:00
Daniel Chambers
5c06eb7a3e Remove duplicated Data Connector API types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5930
GitOrigin-RevId: 8c11387fa8556c3cdf8c92a0924ae53d31b953a5
2022-09-20 06:20:25 +00:00
Daniel Chambers
04ae6abf78 Exists support in filter expressions for Data Connector queries [GDW-133]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5904
GitOrigin-RevId: 6bad4c29a7d14d3881f9c57fe983d14cc41bdc4b
2022-09-20 04:01:33 +00:00
awjchen
dcca0c6275 server: support 128-bit trace ids
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5905
GitOrigin-RevId: 48a981a432b2e979bc7b42b32f9c7f53ab9e2598
2022-09-20 02:50:06 +00:00
Samir Talwar
6c03eef990 server: Add test cases for inconsistencies upon reloading or replacing the metadata.
I am working on https://github.com/hasura/graphql-engine/issues/8807, and wanted to write a Haskell integration test case to reproduce it.

We have Python integration tests somewhat covering this behavior in *test_inconsistent_meta.py*, but no Haskell tests, so I thought I'd shore up the coverage here by adding a few test cases for working behavior.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5897
GitOrigin-RevId: 21500e530e413feaede5cbd8b4a94b07d25a6260
2022-09-19 18:49:31 +00:00
Solomon
85cfd91908 allow exporting dc-agent test descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5925
GitOrigin-RevId: a508e942c61c775823dff440a37fd8769ca42e21
2022-09-17 02:20:31 +00:00
Abby Sassel
3056678e04 server/postgres: Implement execution of aggregation predicates
PR for the translation / execution step of [aggregation predicate filters](https://github.com/hasura/graphql-engine-mono/issues/5174).

[`translateAVAggregationPredicates`](translateAVAggregationPredicates) is the main change of note, everything else is a supporting or helper function. Please note this doesn't yet include [tests relating to permissions](https://hasurahq.slack.com/archives/C01RZPEPF0W/p1662560092197769); I decided to raise a PR without them for slightly faster feedback. I may include them in this PR or a separately if it's not trivial.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5724
GitOrigin-RevId: fcac258b64066e2bd45108372165a16fd957f5ab
2022-09-16 15:01:03 +00:00
paritosh-08
ab71adc3a0 server, pro: event trigger auto cleanup (increment 3)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5823
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: 3d4af905d5df4c05107ad46ef29f4c0a567ff754
2022-09-15 11:46:22 +00:00
David Overton
cbddcce26b Data connector cache invalidations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5820
GitOrigin-RevId: ded80e378901cc0c0ca12eb67d9264756a8d6ff4
2022-09-14 13:00:47 +00:00
Naveen Naidu
005dbf43cb server: event triggers should be dropped when a previously present source is dropped in replace_metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5739
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 772de8bb6a55a0002885e08a778c16f22ea0b113
2022-09-13 04:18:21 +00:00
Jesse Hallett
b094947239 server: codecs for TableMetadata, FunctionMetadata, and permissions
This PR expands the set of codecs for source metadata to include `TableMetadata`, `FunctionMetadata`, and various permission types. This fills out more detail in the generated OpenAPI document.

See the [generated OpenAPI spec](https://gist.github.com/hallettj/783d06a926cbc854eececa4964e8aa5b) based on this PR.

See also the
[generated TypeScript types](https://github.com/hasura/graphql-engine-mono/files/9448102/client-typescript.tar.gz) based on that spec.

Ticket: https://hasurahq.atlassian.net/browse/MM-66

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5664
GitOrigin-RevId: b6e1f32c669368cd6150e6f69fc36b78b748d9bb
2022-09-12 20:31:07 +00:00
Daniel Harvey
00b1acaf38 tests: JSON and JSONB hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5721
GitOrigin-RevId: dde515a364566aa8d517923281ea670a8decbdd9
2022-09-12 14:17:19 +00:00
Tom Harding
70515d94c7 Extract Hasura.Prelude from src-lib
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5776
GitOrigin-RevId: 0df263a4d800e694e68e31c189c360c88cf48abc
2022-09-09 13:58:48 +00:00
Jesse Hallett
977c624c9e server: prune health check from codecs for backends that don't support it
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5822
GitOrigin-RevId: 637a8c668299409385f340d62fc6a84df5c4aa0f
2022-09-09 13:07:33 +00:00
Samir Talwar
f48c882521 server: Share tests between CircularT and MemoizeT.
This abstracts `CircularT`'s test cases to work against "any" memoizer, and then runs them against `MemoizeT` as well.

Surprisingly (or not), this works without issue; `MemoizeT` passes all tests with a couple of extra instances.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5780
GitOrigin-RevId: 461880caf9220dc3f52d622a22e8b8bcd594e404
2022-09-08 19:38:49 +00:00
Philip Lykke Carlsen
d43a30e8fc feat(tests): Introduce AggregationPredicatesSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5686
GitOrigin-RevId: 85b39ad569180929e5620c45bf9a98ef6ee99d42
2022-09-07 12:10:52 +00:00
David Overton
f4419236ed Gdc capabilities scalar types - GDW-87
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5597
GitOrigin-RevId: 4f561bf476266955d7b1d3dbca4d406a97bf8b34
2022-09-06 04:26:03 +00:00
Daniel Harvey
4964ddc6e9 server: skip SOH header in FromCol EncJSON instance
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5710
GitOrigin-RevId: 6065c5b378cd458ad7ea05ce5ca5ff3cee5b13a7
2022-09-05 15:04:32 +00:00
Tom Harding
136349a70a Tidy up simple object query tests, match fixtures to docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5752
GitOrigin-RevId: 2e308504a188745ad5714d60d0fe449a65d6f950
2022-09-05 11:09:38 +00:00
awjchen
78cf1d544e server/pro: enable health check on data sources and report via logging and API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4868
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: b8d43e3f7d977c4bb37b8506ac87ce7bf289d542
2022-09-02 06:34:29 +00:00
Philip Lykke Carlsen
b0d2262b20 Let the same SQL function serve as both a computed field and as a root field (fixes hasura/graphql-engine#8643)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5676
GitOrigin-RevId: f891e4172504897bb125bb1e524dc75b11e319c1
2022-08-30 15:00:45 +00:00
Daniel Harvey
2e2b894ed3 tests: log everything posted to HGE in hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5636
GitOrigin-RevId: d6bc47857e3ad3c6a995284ba6756a643cfb9c4c
2022-08-30 08:54:04 +00:00
Lyndon Maydwell
88c5b14c3d Adding EXPLAIN endpoint capability and implementation for SQLite data connector agent GDW-181
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5603
GitOrigin-RevId: b9255d265ceb88d96643c95f409387fb93df6676
2022-08-29 03:40:16 +00:00
Solomon
18f9bf481c Fix GDC Metadata API Tests and Typescript Code Generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5624
GitOrigin-RevId: a595aeb94971a5ee4968b403af4670e06684b708
2022-08-29 00:21:26 +00:00
Auke Booij
99f7a0fb87 Amend console assets versioning scheme for CE
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5628
GitOrigin-RevId: 550cc987a7142f46f4c380d8217fe6ad8ce53fe9
2022-08-26 12:39:16 +00:00
Gil Mizrahi
a35bd278ad server/postgres: fix string literals in arrays
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5634
GitOrigin-RevId: 67970b0c0f10c187c1a4b97d457717e14fdbd2c8
2022-08-26 09:42:26 +00:00
Jesse Hallett
84fd5910b0 server: polymorphic codec for metadata sources
This PR expands the OpenAPI specification generated for metadata to include separate definitions for `SourceMetadata` for each native database type, and for DataConnector.

For the most part the changes add `HasCodec` implementations, and don't modify existing code otherwise.

The generated OpenAPI spec can be used to generate TypeScript definitions that distinguish different source metadata types based on the value of the `kind` properly. There is a problem: because the specified `kind` value for a data connector source is any string, when TypeScript gets a source with a `kind` value of, say, `"postgres"`, it cannot unambiguously determine whether the source is postgres, or a data connector. For example,

```ts
function consumeSourceMetadata(source: SourceMetadata) {
    if (source.kind === "postgres" || source.kind === "pg") {
        // At this point TypeScript infers that `source` is either an instance
        // of `PostgresSourceMetadata`, or `DataconnectorSourceMetadata`. It
        // can't narrow further.
        source
    }
    if (source.kind === "something else") {
        // TypeScript infers that this `source` must be an instance of
        // `DataconnectorSourceMetadata` because `source.kind` does not match
        // any of the other options.
        source
    }
}
```

The simplest way I can think of to fix this would be to add a boolean property to the `SourceMetadata` type along the lines of `isNative` or `isDataConnector`. This could be a field that only exists in serialized data, like the metadata version field. The combination of one of the native database names for `kind`, and a true value for `isNative` would be enough for TypeScript to unambiguously distinguish the source kinds.

But note that in the current state TypeScript is able to reference the short `"pg"` name correctly!

~~Tests are not passing yet due to some discrepancies in DTO serialization vs existing Metadata serialization. I'm working on that.~~

The placeholders that I used for table and function metadata are not compatible with the ordered JSON serialization in use. I think the best solution is to write compatible codecs for those types in another PR. For now I have disabled some DTO tests for this PR.

Here are the generated [OpenAPI spec](https://github.com/hasura/graphql-engine-mono/files/9397333/openapi.tar.gz) based on these changes, and the generated [TypeScript client code](https://github.com/hasura/graphql-engine-mono/files/9397339/client-typescript.tar.gz) based on that spec.

Ticket: [MM-66](https://hasurahq.atlassian.net/browse/MM-66)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5582
GitOrigin-RevId: e1446191c6c832879db04f129daa397a3be03f62
2022-08-25 18:36:02 +00:00
Gil Mizrahi
5aab7e5ce9 add cockroach to docker compose and tests-hspec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5558
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: b7f242939e718d5bb4f22b11c093ae77d21cdcce
2022-08-25 17:18:40 +00:00
Naveen Naidu
dae6cfa9a6 server: enforce event triggers name in a source to be unique
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5394
GitOrigin-RevId: 78015262365985329c18ed25897ca6d6f4422ecb
2022-08-23 08:51:11 +00:00
Philip Lykke Carlsen
4431fb5ea9 Add schema implementation for Aggregation Predicates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5259
GitOrigin-RevId: f53e310951fa4eb7570006d8c616398a98078632
2022-08-22 15:59:21 +00:00
Daniel Harvey
5a126a693e server: MSSQL varchars compared to nvarchars
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5536
GitOrigin-RevId: ff2e5c9a71dbb02e729b7715d5df752675fc4656
2022-08-22 08:34:41 +00:00
Tom Harding
4a9da49f8d Move ArrayParamPermissionSpec under Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5492
GitOrigin-RevId: f9f002934acdb9cb9eb82772969663983de05a23
2022-08-19 16:13:07 +00:00
Philip Lykke Carlsen
0e921ca9a5 Define IR types for AggregationPredicates.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5258
GitOrigin-RevId: 172b9de69f44635c5700b3f75ce17304ec56c18a
2022-08-19 15:41:47 +00:00
Tom Harding
283d51668f Move BackendOnlyPermissionsSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5539
GitOrigin-RevId: 96851c840ea945af250c8eb876ea183b8384f5d9
2022-08-19 12:59:03 +00:00
Daniel Chambers
ef0ca7dea2 server: Data Connectors support for ordering by related table column and aggregates [GDW-126]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5478
GitOrigin-RevId: 269d33d48f7d41efc7ab4ac6efd9442c6741d08c
2022-08-19 07:01:52 +00:00
Brandon Simmons
4be1ca758d Add allocation counter to trace spans and trace metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5208
GitOrigin-RevId: c0197e69986109db73fa0734b5a093a5e7f0c2e3
2022-08-18 21:57:59 +00:00
Tom Harding
dea80bfac7 Refactor the InsertDefaultsSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5534
GitOrigin-RevId: b5434dbaf86315b77cf9c5ed9d61f80e87c7fc64
2022-08-18 18:16:26 +00:00