Commit Graph

2231 Commits

Author SHA1 Message Date
Samir Talwar
36031d62d2 server/tests-py: Fix the run.sh and run-new.sh scripts to work with our new server-builder image.
This updates _docker-compose.yml_ to use the new image tags, and updates _run.sh_ accordingly.

While I was at it, I also added a `docker compose pull` instruction to make sure that we don't have surprises half-way through the script, and a few `echo` lines for clarity.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6235
GitOrigin-RevId: 3855f6898bd3e906c5f423d9d0d6a7031de3777a
2022-10-06 19:04:58 +00:00
Daniel Harvey
ad53402d1d test: Check CockroachDB can query into JSONB values with a path
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6124
GitOrigin-RevId: 3de6b6c602d41d4d340c355171c10ac33582b9a5
2022-10-06 13:03:03 +00:00
Gil Mizrahi
d8452bf11c server: remove ghc libs from freeze file, update guides
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6231
GitOrigin-RevId: d877e46d7130217cd95eb9c507921e76a0009151
2022-10-06 12:27:09 +00:00
Daniel Harvey
87ca46f79b tests: add Postgres 14 and Postgres 15 pytests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5968
GitOrigin-RevId: 6569e58b89f014268152cfe7bf1f6c11233fbe49
2022-10-06 09:46:38 +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
Daniel Chambers
d713cad315 Add support for lowercase table and column names in the Data Connector agent tests [GDC-463]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6179
GitOrigin-RevId: 6455e5809ea06b86dfbcddf781ee105088ca78f9
2022-10-05 23:25:00 +00:00
Samir Talwar
6a586cdaa0 api-tests: Sort and uniquify test module names in the Cabal file.
The duplicates make Cabal 3.8.x choke.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6206
GitOrigin-RevId: 7c6c69c721aed659a19db7b9124749dd6566d5dc
2022-10-05 12:38:48 +00:00
Philip Lykke Carlsen
3fea9ce4fc Refactor FromItem to use TableIdentifier
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6166
GitOrigin-RevId: 97d4fb0bec6d1c60e168f2503328ad5ef38915b2
2022-10-05 10:04:57 +00:00
Samir Talwar
64c40b9a95 CI: Run the "server hpack" check on main and invalidate the cache properly.
We seem to be rebuilding hpack on every PR. I'm hoping this will allow PRs to share a cache.

I have also changed the cache key to include the entirety of _server/VERSIONS.json_, and added the GHC version there, to make sure it's properly invalidated.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6142
GitOrigin-RevId: fc61a26ad721f59f52687913f6978902f4c2ca0a
2022-10-04 09:01:20 +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
Auke Booij
05b3a64e8f Clean up Hasura.Prelude a bit
- Remove `onJust` in favor of the more general `for_`
- Remove `withJust` which was used only once
- Remove `hashNub` in favor of `Ord`-based `uniques`
- Simplify some of the implementations in `Hasura.Prelude`
- Add `hlint` hint from `maybe True` to `all`, and `maybe False` to `any`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6173
GitOrigin-RevId: 2c6ebbe2d04f60071d2a53a2d43c6d62dbc4b84e
2022-10-03 21:50:53 +00:00
Auke Booij
6602ad44b1 Print the definitions of the types that are conflicting
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6139
GitOrigin-RevId: 1ab0eecb0f75fb57534fd39add9bfde5041c090e
2022-10-03 21:13:18 +00:00
Auke Booij
3efabe99b3 Memoize column parsers (within roles)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6036
GitOrigin-RevId: 225698f6db02b16599d9f157c9fe4c03b16fb71b
2022-10-03 20:11:44 +00:00
Auke Booij
6515ae8dbe Improve description for table select columns enum type
Before:
```
select Name {unName = "upeopoeklplxfaa"}columns of table "exbiovdrgjqskdr"
```
After:
```
select "upeopoeklplxfaa" columns of table "exbiovdrgjqskdr"
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6143
GitOrigin-RevId: 80a4075057c6d7361a000cb5c1e9b7a166a4f125
2022-10-03 11:00:10 +00:00
Auke Booij
b03ed983f1 Remove spaces before colons in error messages and descriptions
This PR is the result of running the following commands:
```bash
$ git grep -l '".* : "' -- '*.hs' | xargs sed -i -E 's/(".*) : "/\1: "/'
$ scripts/dev.sh test --integration --accept
```

Also manually fixed a few tests and docs

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6148
GitOrigin-RevId: cf8b87605d41d9ce86613a41ac5fd18691f5a641
2022-10-01 14:48:58 +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
Gil Mizrahi
d1434e4932 run bigquery with retry in test-harness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6141
GitOrigin-RevId: dce43ed5ce5ffffaa7680f5fa550c7df59c8cae4
2022-09-30 12:49:02 +00:00
Gil Mizrahi
8c725acac8 fix type name generation for aggregation predicate functions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6138
GitOrigin-RevId: bfb77f97bb30c43bca698a1c405f75abd3eaffb9
2022-09-30 09:36:34 +00:00
Samir Talwar
3cb9bab9f1 server/tests-py: Provide the admin secret to the HGE server.
When we run the HGE server inside the test harness, it needs to run with
an admin secret for some tests to make sense. This tags each test that
requires an admin secret with `pytest.mark.admin_secret`, which then
generates a UUID and injects that into both the server and the test case
(if required).

It also simplifies the way the test harness picks up an existing admin
secret, allowing it to use the environment variable instead of requiring
it via a parameter.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6120
GitOrigin-RevId: 55c5b9e8c99bdad9c8304098444ddb9516749a2c
2022-09-29 17:20:07 +00:00
Daniel Harvey
cffd564a7e tests: NoQueriesAvailable fix for CockroachDB
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6071
GitOrigin-RevId: 5dd4261fd6fc84d059f9b2d28f7efe0f140333e9
2022-09-29 13:50:17 +00:00
Samir Talwar
60f81023db server/tests-py: Run the auth hook inside the test harness.
This teaches `hge_server` how to run more tests, thanks to `hge_env`.

It also simplifies the logic a bit more.

I have also modified _run.sh_ and _docker-compose.yml_ so we can run multiple test suites, one after another.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6105
GitOrigin-RevId: eff009362eb6bb90c07cedaf96dfe6ec9336ff32
2022-09-29 10:44:03 +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
Samir Talwar
93e8803d3e Reload sources when applying metadata.
If we don't do this, we might end up applying metadata with a stale schema cache.

Following the principle of least surprise, replacing the metadata should probably compute inconsistencies with regards to the actual state of the database.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6026
GitOrigin-RevId: ff7469d7d9857c8a9f517d5d0b6f1ecf463621b3
2022-09-28 13:48:25 +00:00
Samir Talwar
8cb2738cbe server/tests-py: Declaratively state the HGE environment variables.
This has two purposes:

* When running the Python integration tests against a running HGE instance, with `--hge-url`, it will check the environment variables available and actively skip the test if they aren't set. This replaces the previous ad-hoc skip behavior.
* More interestingly, when running against a binary with `--hge-bin`, the environment variables are passed through, which means different tests can run with different environment variables.

  On top of this, the various services we use for testing now also provide their own environment variables, rather than expecting a test script to do it.

In order to make this work, I also had to invert the dependency between various services and `hge_ctx`. I extracted a `pg_version` fixture to provide the PostgreSQL version, and now pass the `hge_url` and `hge_key` explicitly to `ActionsWebhookServer`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6028
GitOrigin-RevId: 16d866741dba5887da1adf4e1ade8182ccc9d344
2022-09-28 09:21:02 +00:00
Samir Talwar
d9afcc1857 Upgrade all package-lock.json files to the v2 format.
NPM v7 uses a new (backwards-compatible) lockfile format. This upgrades all our various _package-lock.json_ files to use the new format.

It's much more verbose so that NPM can be a lot faster.

I figured it was cleaner to do this once in a separate PR rather than upgrading them in combination with adding or upgrading a new dependency.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5869
GitOrigin-RevId: 322fb63b96e2d873a4a3cc05fa6c7afa414716ce
2022-09-28 08:15:29 +00:00
Daniel Harvey
d03d86a5e7 ci: Testing more Postgres versions with Hspec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5919
GitOrigin-RevId: c6d1d0463b3640d4f33b54de6a2a425dec3920a2
2022-09-28 03:39:22 +00:00
Daniel Chambers
6af3fa2d78 Add the ability to test against tables in configurable schemas in Data Connector Agent test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6083
GitOrigin-RevId: 5a7ee37ed3a62224a062dbaac7d322dfd95b83c4
2022-09-27 23:42:32 +00:00
Daniel Harvey
27fca2a3ed tests: fix ViewsSpec for CockroachDB
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6076
GitOrigin-RevId: 8423880cd5b6ba5794fa5096cf3955fb858b4610
2022-09-27 20:12:15 +00:00
Tom Harding
a9f7c1ef80 Reverse stringifyNumbers assertions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6079
GitOrigin-RevId: 2db16d057f5ff2ea261d23b43eeced22ebd0235a
2022-09-27 16:52:21 +00:00
paritosh-08
fabbd134b2 server: add metadata origin in streaming subscription field parser
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6075
GitOrigin-RevId: 901ba21dbcbf9bee4ca38cba21a5440ca10f3407
2022-09-27 15:56:46 +00:00
Daniel Harvey
3fadeeb5f9 server: Console Sentry DSN support
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5899
GitOrigin-RevId: 941647350def3ef21979c091e562c374ad562016
2022-09-27 14:51:52 +00:00
Abby Sassel
629f60eb55 server/postgres: address translateTableRelationship feedback
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6073
GitOrigin-RevId: 6316d64256d4fd34936e1d8c6afffb0db15f2fe7
2022-09-27 14:16:52 +00:00
paritosh-08
a88e6cfa9d server, pro: make http manager with allowlist in migrateCatalogSchema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6045
GitOrigin-RevId: 34d67615b5a9e6b7f59760ecf89977764fcb1868
2022-09-27 09:25:28 +00:00
Daniel Harvey
bfa5296ecf server: Upgrade to CockroachDB 22.2 nightly and enable skipped tests from oid error
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6046
GitOrigin-RevId: 21a660bf4deab9bbe0465443685338191b90e485
2022-09-27 08:55:45 +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
awjchen
8e05e51f1b server: report metrics API status from config API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5599
GitOrigin-RevId: b66eb5c3a0034fe5ab7c764b34f7def77edd3fc0
2022-09-27 06:49:45 +00:00
Auke Booij
8e600362e7 Improve error message phrasing in safeSelectionSet
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6053
GitOrigin-RevId: c2595f396845e9ca809b93566b38239d80a244b8
2022-09-27 06:08:25 +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
kodiakhq[bot]
c5de79d10c server: merge graphql-parser-hs into the monorepo
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5906
Co-authored-by: José Lorenzo Rodríguez <37621+lorenzo@users.noreply.github.com>
Co-authored-by: Vitali Barozzi <26206141+vitalibarozzi@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Evie Ciobanu <1017953+eviefp@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
GitOrigin-RevId: 4864173fd616fbbb2fe3a839d0c5eabd76a2e1f2
2022-09-26 11:23:37 +00:00
Auke Booij
7e10ff4e13 server: don't export the backend_only permissions flag if it is set to false while exporting metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6006
GitOrigin-RevId: 60207193b654407bffdbf8436f5be36f46c6d8c6
2022-09-26 06:11:57 +00:00
Philip Lykke Carlsen
46ef2e5d2a feat: Document aggregation predicates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5894
GitOrigin-RevId: 2a06f7afdec6741aca7464eee42617aca920b9ad
2022-09-23 13:49:49 +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
Samir Talwar
fef1caabce server/tests-py: Support MSSQL and Citus with run.sh and run-new.sh.
This adds support for running the Python integration tests for MSSQL and Citus just as in CI, as follows:

```
./server/tests-py/run.sh backend-mssql
./server/tests-py/run.sh backend-citus
```

These run the named CI jobs, providing the appropriate backend.

(In reality, all backends are always provided, which is much simpler.)

It also provides the various databases to _server/tests-py/run-new.sh_, though the tests fail as they don't properly initialize the sources. (This will be fixed in the future by provisioning sources in the test framework itself.)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5997
GitOrigin-RevId: c276a4779a35bb538ef0dc02ac8b7cb2d5a8dec5
2022-09-22 19:03:44 +00:00
Brandon Simmons
d2b3ec8938 ci/benchmarks: fix copypaste bug affecting regression report highlighting in #5942
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6021
GitOrigin-RevId: eb77bf97a52e533c565bfb12a45c0851f832610d
2022-09-22 16:24:15 +00:00
Gil Mizrahi
dd37456949 replace SELECT FROM with SELECT 1 FROM to fix count aggregates for cockroachdb
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5787
GitOrigin-RevId: f5f01a64ccffa36c93a0a88228ac927fbd3aa168
2022-09-22 13:58:03 +00:00
kodiakhq[bot]
81df74852e ci/benchmarks: tweak what we present in regression report
- Make regression report more compact, remove `min` since it doesn't behave like a limit
- It looks like the low-load variants are probably just noisier with fewer samples, so remove them from the regression view:

![samples](https://user-images.githubusercontent.com/210815/191076137-f5c3a0c6-9586-4ea4-a5a7-66000e7a2540.png)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5942
GitOrigin-RevId: 8a9ab00c251f04d7d5a542731696cb5f86ad2b78
2022-09-22 13:28:56 +00:00
Abby Sassel
37b846c28d server/postgres: aggregation predicate filters should respect aggregation queries permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5936
GitOrigin-RevId: ecb6d677873676ec2bcb7d0bedd1ec707f8e05a1
2022-09-22 12:53:05 +00:00
Abby Sassel
b59008c880 server/postgres: implement execution of aggregation predicates (permissions)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5959
GitOrigin-RevId: eebfe36d217c333b393a308a1db19271809b6a87
2022-09-22 11:15:04 +00:00
Karthikeyan Chinnakonda
3b167b7df1 server: fix bug when streaming subscription cursor has custom name
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6009
GitOrigin-RevId: ba69bbd3a2c8f44e717cb64c8195041edc80a2d6
2022-09-22 09:52:36 +00:00
ananya-2410
c34d2504e8 ci: tag release v2.13.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6008
GitOrigin-RevId: 3b877e49dcf5ce4116b8b68581a9189521ac81f9
2022-09-22 08:19:04 +00:00
Daniel Harvey
f80ec1d543 server: Rename AltJ to ViaJSON
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5911
GitOrigin-RevId: bd4dec9792f2137b2f4e3169e19109a3d3f63b50
2022-09-21 18:42:30 +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
paritosh-08
1c7e19c209 server/docs: event trigger log cleanup | remove default for clear_older_than
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5998
GitOrigin-RevId: 1376fd2192c7daaf73e8099cdb2f1aab4b8c3cd1
2022-09-21 17:29:55 +00:00
Samir Talwar
8b8d7ab96d server/tests-hspec: Simplifying the steps required to run these on macOS on aarch64.
This makes a few changes to the test scripts and makefiles in order to make things simpler for the average Apple user.

First of all, we change the `wait_for_mysql` function to use "localhost", not "127.0.0.1", as this fixed an issue on my system when attempting to connect to the MySQL server.

Secondly, we split the SQL Server test image into two:

* The first is the server itself, which now automatically uses `azure-sql-edge` as the image if you are on an aarch64 chip and using the `make` commands.
* The second is the initialization script. Because `sqlcmd` is not available in the `azure-sql-edge` image on aarch64, we use a separate container based on `mssql-tools` to initialize the server.

The README has been updated.

Tested on both macOS/aarch64 (with other changes) and Linux/x86_64.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5986
GitOrigin-RevId: b16e079861dcbcc66773295c47d715e443b67eea
2022-09-21 16:48:21 +00:00
Daniel Harvey
231de5166a server: bump CockroachDB image and un-skip fixed tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5967
GitOrigin-RevId: 28a2f8e94d091c8ddd272b6abf3828c40662ef38
2022-09-21 14:11:06 +00:00
Daniel Harvey
e2ced4011d server: import local Postgres modules as Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5962
GitOrigin-RevId: 862862c34b6c633c94ee8ae1f075afca2799fd2b
2022-09-21 11:35:50 +00:00
Daniel Chambers
3365a18516 Rename DataConnector cross_table capability to subquery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5980
GitOrigin-RevId: c289b2a7afb4d07214aac2b4d89c9b87a75e98aa
2022-09-21 10:48:05 +00:00
paritosh-08
876c906660 server: event trigger log cleanup | rename start_event_trigger_cleanups API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5976
GitOrigin-RevId: 752c905d31b3700aa49d816ec573df74715f6654
2022-09-21 06:00:39 +00:00
Daniel Chambers
dc9a86680c Gardening: Clean up Data Connector API types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5977
GitOrigin-RevId: 1a6898d6416fff265a8add74d414c979f7fa3bc5
2022-09-21 05:13:03 +00:00
Brandon Simmons
fc9cc14943 ci/benchmarks: don't measure decompression in k6 (NOT REAL PERFORMANCE IMPROVEMENT)
See: https://github.com/grafana/k6/issues/2685

It might be interesting to think about taking into consideration decompression time when thinking about performance, but In general I think doing so is surprising and I wasted a lot of time trying to figure out why my optimizations to the compression codepath weren't improving things  to the degree I expected

The downside here is we lose error reporting, so you'll need to only set
discardResponseBodies: true after the query has been tested.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5940
GitOrigin-RevId: 82a589a59b93f10ffb5391e4a3190459fb6e613b
2022-09-21 02:07:54 +00:00
Auke Booij
4c8ea8e865 Import pg-client-hs as PG
Result of executing the following commands:
```shell
# replace "as Q" imports with "as PG" (in retrospect this didn't need a regex)
git grep -lE 'as Q($|[^a-zA-Z])' -- '*.hs' | xargs sed -i -E 's/as Q($|[^a-zA-Z])/as PG\1/'
# replace " Q." with " PG."
git grep -lE ' Q\.' -- '*.hs' | xargs sed -i 's/ Q\./ PG./g'
# replace "(Q." with "(PG."
git grep -lE '\(Q\.' -- '*.hs' | xargs sed -i 's/(Q\./(PG./g'
# ditto, but for [, |, { and !
git grep -lE '\[Q\.' -- '*.hs' | xargs sed -i 's/\[Q\./\[PG./g'
git grep -l '|Q\.' -- '*.hs' | xargs sed -i 's/|Q\./|PG./g'
git grep -l '{Q\.' -- '*.hs' | xargs sed -i 's/{Q\./{PG./g'
git grep -l '!Q\.' -- '*.hs' | xargs sed -i 's/!Q\./!PG./g'
```
(Doing the `grep -l` before the `sed`, instead of `sed` on the entire codebase, reduces the number of `mtime` updates, and so reduces how many times a file gets recompiled while checking intermediate results.)

Finally, I manually removed a broken and unused `Arbitrary` instance in `Hasura.RQL.Network`. (It used an `import Test.QuickCheck.Arbitrary as Q` statement, which was erroneously caught by the first find-replace command.)

After this PR, `Q` is no longer used as an import qualifier. That was not the goal of this PR, but perhaps it's a useful fact for future efforts.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5933
GitOrigin-RevId: 8c84c59d57789111d40f5d3322c5a885dcfbf40e
2022-09-20 19:55:51 +00:00
paritosh-08
f7115891f7 server: event trigger log cleanup | change metedata API field name
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5965
GitOrigin-RevId: aa50006946e79fe4d9c971568221dc436040b738
2022-09-20 16:33:11 +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
paritosh-08
607b26362d server: event trigger cleanup | fix query_timeout field name
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5953
GitOrigin-RevId: b80b6672db5a73cafca77ba06cf25f71c7dc8c10
2022-09-20 12:47:22 +00:00
Samir Talwar
0b3c8ccaca server/tests-py: Support running BigQuery tests with run.sh.
This fixes a few issues so that we can run `./server/tests-py/run.sh backend-bigquery` to run the Python integration tests for BigQuery locally.

* We forward the relevant environment variables to the Docker container.
* We increase the HTTP timeout, as I'm seeing requests taking up to 90s locally.
* We rewrite the setup so that it avoids `INSERT INTO`, which is not available using the BigQuery free tier. Instead, we use `CREATE TABLE ... AS SELECT ...`. This is the same method used by the Haskell integration tests.

We also capture local server output in a volume so it's easier to figure out what went wrong later.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5921
GitOrigin-RevId: c628f8c08a84f2582958659ab6d6494832471f6f
2022-09-20 10:56:36 +00:00
Abby Sassel
89f9a5fdf2 server/tests: add permissionRows field and Permission constructor
Factoring out some minor cleanup from a PR which [tests aggregate filters and permissions](https://github.com/hasura/graphql-engine-mono/pull/5936). This PR adds a `permissionRows` field to the `Permission`s type, needed to test row permissions (https://github.com/hasura/graphql-engine-mono/pull/5936) and some default constructors.

Relates to https://github.com/hasura/graphql-engine-mono/issues/5888

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5949
GitOrigin-RevId: 89679a49496364473976cc73afa4d064a02bbf21
2022-09-20 09:17:32 +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
hasura-bot
71bba3e3aa Add X-Forwarded-Origin header
GITHUB_PR_NUMBER: 8728
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8728

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5246
Co-authored-by: Wsevolod <31807671+kraftwerk28@users.noreply.github.com>
GitOrigin-RevId: b8229786a2b14a8be49303f9a6da10231c8fb331
2022-09-19 14:55:23 +00:00
Daniel Harvey
559cc78b2d server: optimise CockroachDB metadata fetch
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5910
GitOrigin-RevId: 09deef75576fc916138888819db6689b4b61da2b
2022-09-19 14:07:59 +00:00
Gil Mizrahi
a3036be77b tests-hspec readme: update m1 workaround fix
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5931
GitOrigin-RevId: 4aeefb430e8aa7c3a257b0cce440842c3ed156df
2022-09-19 09:54:38 +00:00
Abby Sassel
71597778c9 server/postgres: fix non-latin text elements in array literals (copy). close hasura/graphql-engine#8961
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5916
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 9063f7ff39f684c4ab43f093706b872021b67b13
2022-09-18 16:08:15 +00:00
Philip Lykke Carlsen
26cdc03aa4 fix(#8904): Make BigQuery Computed Fields arguments optional
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5909
GitOrigin-RevId: 0d7c7de273c27bbd2338f42253754be0a06ea66e
2022-09-17 22:41:19 +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
awjchen
c3840fe2d1 server: graphql-ws: stop sending pings in response to pongs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5882
GitOrigin-RevId: 07fad6a24bb6eed9807e785e8201517126f7c302
2022-09-17 00:01:53 +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
Daniel Harvey
4bb4c91c0c tooling: add coreutils to macos install docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5914
GitOrigin-RevId: 4a7383b7537987a5ab5f744ab49713c0f532a1b4
2022-09-16 14:16:21 +00:00
Karthikeyan Chinnakonda
cb2349d5a0 server, pro server, console: provide an option to not include rows count while fetching scheduled events
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5650
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
GitOrigin-RevId: 8a55f3ca52cfbda4d4e75372b813b7acd421eabb
2022-09-15 19:12:04 +00:00
Stefano Magni
a0f4f00bfd console: Add Sentry
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5699
Co-authored-by: Rishichandra Wawhal <27274869+wawhal@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 00f2c5d25012b21f4e8763ef578598a3a11896e4
2022-09-15 17:00:44 +00:00
Samir Talwar
a24cdd9b49 Prepare PostgreSQL for running tests in parallel.
This makes two changes to the Docker Compose files that we use for local testing:

1. We disable `fsync`. On my machine, this decreases the time taken to create a new database from ~5s to less than 0.1s. The trade-off is that you might lose data, which we don't care about, as this is for testing.
2. We increase the maximum number of connections from the default, 100, to 1000. This allows us to run more tests in parallel without hitting connection limits.

These changes won't have any meaningful effect for now; they simply allow us to parallelize tests against PostgreSQL in the future.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5892
GitOrigin-RevId: 5d0d0ab37fdfbf4c9e20084d3cbedf647f54a04e
2022-09-15 14:03:23 +00:00
Samir Talwar
1a5aaae9cf server/tests-py: Add a --hge-bin argument to the Pytest runner.
This argument allows the user to specify how to run HGE, rather than starting it beforehand. The runner will start a new instance of HGE for each test class.

This does not provide isolation, as the database is still re-used, but it helps us get closer.

You can try it yourself by executing:

```
$ cabal build graphql-engine:exe:graphql-engine
$ ./server/tests-py/run-new.sh
```

This doesn't affect CI at all.

I also fixed a few warnings flagged by Pylance.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5881
GitOrigin-RevId: ea6f0fd631a2c278b2c6b50e9dbdd9d804ebc9d4
2022-09-15 12:31:12 +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
Lyndon Maydwell
ba0a685211 CI Support for Data Connector Agent Tests - GDW-336
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5808
GitOrigin-RevId: 817575185cdbd21985c647f22d5b643ce0852ef6
2022-09-15 09:47:24 +00:00
Anon Ray
1d9844ee4e server: use metadata DB ID as ProjectID for EE lite projects
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5874
GitOrigin-RevId: 63a4016227eeeceb0143cf84ed4c13b14f424d4b
2022-09-15 09:13:56 +00:00
Lyndon Maydwell
118b03e329 RMGetSourceKindCapabilities doesn't modify metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5883
GitOrigin-RevId: dbf69fd3f6086eca0e9b2ed9b47d19ae56339e63
2022-09-15 07:35:09 +00:00
Samir Talwar
bff1309344 server/tests-py: Make HGECtxGQLServer a fixture.
Starting it and stopping it for the various tests that actually use it.

There are only a few.

This also removes some dead code and fixes warnings in _test_webhook_request_context.py_.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5846
GitOrigin-RevId: 7760467f9de7b1f9718e7482275c298eeaa3ad3a
2022-09-14 21:42:40 +00:00
kodiakhq[bot]
f2931a4d32 server: import pg-client-hs with history
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5735
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
Co-authored-by: Alexis King <759911+lexi-lambda@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
Co-authored-by: Evie Ciobanu <1017953+eviefp@users.noreply.github.com>
Co-authored-by: Swann Moreau <62569634+evertedsphere@users.noreply.github.com>
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 6a3940b2596fc178379b85d5fa79bd9ac83457e2
2022-09-14 14:51:34 +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
Solomon
4a0446852c Adds configSchema to get_source_kind_capabilities
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5860
GitOrigin-RevId: 9bc13af5104251c509194d28ece81066643ab2a2
2022-09-14 07:07:04 +00:00
Lyndon Maydwell
2ef11a4766 Add --dry-run switch to graphql-engine:test:tests-dc-api [GDW-338]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5847
GitOrigin-RevId: 97011a617f0a305109f6f8d29293a4898e0bac10
2022-09-14 06:27:29 +00:00
Samir Talwar
ee995aacc1 Extract out functions from columnParser in Backend.
The intent is to generalize `columnParser` to the point where it is the same across all backends, and then remove the interface in favor of a single implementation.

This extracts out `enumParser` and `possiblyNullable` as the two main areas that differ across backends. We may split `possiblyNullable` further so that we can extract some of that logic out into a common function too.

With these changes, the various `columnParser` implementations become semantically equivalent. They still do different things, and so reconciling them will require further changes.

Co-Authored-By: Antoine Leblanc <antoine@hasura.io>

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5841
GitOrigin-RevId: eec1770931eed5d72da70c97d7d0f00e33fa15d2
2022-09-13 21:22:25 +00:00
Brandon Simmons
82f129ff7c PLAT-75: Log uncompressed_response_size
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5827
GitOrigin-RevId: c98e5075f38737d9eb9cf467a62032ca5984304e
2022-09-13 15:37:14 +00:00
paritosh-08
db710d38b7 server, pro: event trigger auto cleanup (increment 2)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5746
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: f4e5e06389ca57bdb5f7771f459c07418787111d
2022-09-13 08:34:52 +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
Solomon
fb3ba23a44 get_source_tables API call, don't fold table names.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5837
GitOrigin-RevId: 9f785793a279c4016d8ed88374d2442019489252
2022-09-13 02:06:24 +00:00
Jesse Hallett
8729301ad6 server: codecs for postgres connection configuration types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5722
GitOrigin-RevId: 85de9a550229d3ac3304ec46fed81e97f2a150f6
2022-09-12 21:46:33 +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