Commit Graph

389 Commits

Author SHA1 Message Date
Daniel Harvey
107db24caf chore(tests): Move Native Queries and Logical Models tests to api-tests-pro
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8936
GitOrigin-RevId: 9c170f2ce2de68818a9efe52266b47e87a7c4726
2023-04-26 11:05:32 +00:00
Samir Talwar
6afcf17df8 frontend: Use origin/main as the base when running Nx commands.
We may not want to assume that the `main` branch on a developer's machine (a) exists and (b) is up-to-date.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8915
GitOrigin-RevId: 441d1c4cb7d864601a5f7a81dbfd04ec5415161e
2023-04-25 21:43:28 +00:00
Samir Talwar
be67b0db59 server: Make HLint pass, by hook or by crook.
This fixes the simple HLint warnings, and adds a few suppressions to avoid noise.

The suppressions don't really solve the problems, but I think the warnings here are quite benign and I'm uncomfortable with how likely I would be to introduce a bug during refactoring.

In the case of _pg-client_ and _resource-pool_, we can't use the recommended functions anyway, and there doesn't seem to be a way to tell HLint to ignore entire packages.

I have updated the `make` targets to only fail if errors or warnings are found, not suggestions. This brings it in line with the CI job.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8910
GitOrigin-RevId: 596277b4ae5833876fc3f43875208c1279518a59
2023-04-25 14:03:02 +00:00
Daniel Harvey
7e20fd9088 chore(tests): run pro api-tests for all native databases
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8892
GitOrigin-RevId: 6bf2629e676471ff94a34746beacb08cad14f4d0
2023-04-25 13:26:20 +00:00
Brandon Simmons
7066b52777 dev.sh: support graphql-engine-pro
So you can do:

```
$ HASURA_GRAPHQL_EE_LICENSE_KEY=... scripts/dev.sh graphql-engine-pro
```

along with the `--prof-*` modes etc.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8894
GitOrigin-RevId: 2257749b2936cbd3230beb23e774ac92989e2fbc
2023-04-25 10:54:30 +00:00
Gil Mizrahi
e768ef4920 cleanup(sqlserver): throw an error when native queries not supported
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8839
GitOrigin-RevId: afdaa9a0a5aa54f852d3a955a0d3de4f74b5fedf
2023-04-21 13:51:58 +00:00
Gil Mizrahi
2635ed46bd sqlserver: implement native queries as CTEs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8818
GitOrigin-RevId: 78d84c3558b2cc27e1c1a6c025de4c5035a9cafe
2023-04-19 14:54:56 +00:00
Brandon Simmons
3332189756 benchmarks: resource_calibration.sh and CI throughput benchmarks
See this earlier iteration of this work for an example of the kind of report  we're producing: #7664

And related work in this repo: github.com:hasura/graphql-bench-helper

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7923
GitOrigin-RevId: 99d2a55e2fb5b55f3f33e2570cfd0bc23e448e0c
2023-04-18 16:44:54 +00:00
Rikin Kachhia
e95259e1f4 build: update manifests with latest version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8775
GitOrigin-RevId: e5cfc438c3f14efc0dfd9a8bbbec984c7d203674
2023-04-17 10:32:05 +00:00
Philip Lykke Carlsen
0346224444 Rename "Logical Models" → "Native Queries"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8769
GitOrigin-RevId: 66f2cbfb620d641e672a4074554d9d324a18c591
2023-04-13 16:12:20 +00:00
Samir Talwar
6d79b7dfaf make: Add run-oss-server, and associated frontend targets.
`make run-oss-server` will now build the Console for OSS ("CE"), start PostgreSQL, and run a simply-configured server.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8652
GitOrigin-RevId: cada25e66fe216867ff331d597764e64aaf2dc19
2023-04-06 08:53:13 +00:00
Daniel Harvey
9c83934869 chore(tooling): add make repl-postgres command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8638
GitOrigin-RevId: 8cbc8317a661e2bb43e965be5c32696d03d394bd
2023-04-05 13:24:04 +00:00
Daniel Harvey
9c99bcb6f8 chore(server): move perms to custom return types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8604
GitOrigin-RevId: ff024429b3f06e4867334665f35d4bd404a85cba
2023-04-04 12:46:51 +00:00
Daniel Harvey
79682e0598 chore(server): move custom types out of logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8565
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 38bf56cc420a6c818a9ca7d6f846f5018535c808
2023-03-31 15:35:13 +00:00
Tom Harding
d80f5b0cdd Clean up leftover bigquery datasets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8543
GitOrigin-RevId: 9463e50aa4bf62e12e39b4bebdf551e11c824897
2023-03-28 15:43:08 +00:00
Samir Talwar
bdfea39de2 make: Set a base for all nx commands.
I personally avoid having a checked-out `main` branch during development, so that I don't accidentally commit directly to it.

This change makes `nx` commands work without needing a local `main` branch, by referring directly to the origin's branch instead.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8516
GitOrigin-RevId: b81314709b967b3dadd397793b416d9e0b137c98
2023-03-27 22:24:31 +00:00
Daniel Harvey
2d9c8299c2 feature(server): add SQLServer logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8388
GitOrigin-RevId: cbf813d1114cb03816003ba73788d33ac37f1473
2023-03-27 16:56:05 +00:00
Tom Harding
b2f683f56d Logical Models for BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8447
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
Co-authored-by: Nicolas Beaussart <7281023+beaussan@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: ananya-2410 <107847554+ananya-2410@users.noreply.github.com>
Co-authored-by: Matthew Goodwin <49927862+m4ttheweric@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: ddef9d54bfad6b7d5dc51251dbe47eac43995da3
2023-03-24 15:17:03 +00:00
Samir Talwar
17855bf65a make: Add make targets for formatting and linting frontend code.
This adds linting and formatting of frontend code when running `make lint`, `make format`, or any of the variations.

I am adding this because I didn't know how to check the code and so I had to wait for CI to fail, which I found irritating.

In order to make this reasonable, I factored out `make` targets for building *frontend/node_modules*, so I could depend on them.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8463
GitOrigin-RevId: 71882ec90490efbf87d428d08eaec2ae849a0a36
2023-03-23 15:16:14 +00:00
Daniel Harvey
ebb571ef39 feature(server): metadata for SQLServer logical model
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8444
GitOrigin-RevId: 86cfd7adbf326560a0ec72034de3dcd9dcb5124c
2023-03-22 17:11:19 +00:00
Daniel Harvey
eba0a3fb33 chore(tooling): Make command to run SQLServer repl
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8404
GitOrigin-RevId: 163ee869d436b29f3563a7ec3294f0786b32f19c
2023-03-21 09:47:13 +00:00
Tom Harding
c4a16db4d2 Fix the unit test ghcid make command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8338
GitOrigin-RevId: 07f9780ee23c198c49f0fe2ab5e4074a6fc262e4
2023-03-15 17:10:52 +00:00
Daniel Harvey
95f5553af6 chore(server): split new statistics log from QueryLog
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8326
GitOrigin-RevId: 02ee652302de5328e63054a6448dca10de7b5c1b
2023-03-15 13:06:47 +00:00
Philip Lykke Carlsen
1bad75e3d8 feat(logical models): Add validation of types and parameters
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8267
GitOrigin-RevId: 827852edf074eb72c95ac379fe3ac5d095fd26ab
2023-03-13 18:15:27 +00:00
Daniel Harvey
52082f0911 chore(tooling): add make run-pro-server
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8260
GitOrigin-RevId: f69ce5249bdc2b606ecb574049dd98558062399e
2023-03-09 12:05:02 +00:00
Divi
26febe9155 ci: set SERVER_TEST_MODE in get-version.sh if not set
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8196
GitOrigin-RevId: 9df9424e1c9ed34151be4805e1f51dbec1266dc0
2023-03-06 08:30:01 +00:00
Tom Harding
dd24a29419 Handle docker when running make test-logical-models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8177
GitOrigin-RevId: 25faf2c94c5a605c49495e4da848683ae32c1927
2023-03-02 16:35:05 +00:00
Samir Talwar
59ca6fe81e CI: Make get-version.sh fail if any of the git commands fail.
We are seeing errors emitted from get-version.sh in some PRs, but it proceeds anyway, generating a nonsense version of "dev--".

Instead, let's fail fast so we can diagnose the issue.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8115
GitOrigin-RevId: bb8d25f0f56c807dbb9928b82e31c94d23d9d1f5
2023-03-01 14:17:36 +00:00
Gil Mizrahi
b761add3c4 rename naqi to logimo part 1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8037
GitOrigin-RevId: 4839410ba836d4b69fd1ee30875bca9b46decc66
2023-02-21 13:46:44 +00:00
Solomon
b3553ac88d GDC Mysql integration tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7603
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 651bc2fb59a46449e2a4325a4c7af57592e53845
2023-02-16 06:30:51 +00:00
Jesse Hallett
885681da9a server: commit Metadata OpenAPI spec with CI check, add Typescript client scaffolding
## Description

Adds `metadata.openapi.json` to version control. Adds a Buildkite job that verifies the spec is up-to-date on server changes, and fails the CI pipeline if not.

Adds scaffolding for a new Typescript project that consumes that OpenAPI spec, and produces Typescript types. This is adapted from the similar existing data connectors project in `dc-agents/dc-api-types/`. Generated code is *not* committed to version control. Instead there is a script to generate code on-demand at publishing time. There are plans to incorporate publishing the generated project to NPM using a forthcoming pipeline that the Console team is working on.

For the moment the Typescript project is under `metadata-api-types/typescript/`. The plan is to move the project in a future PR to the frontend sub-monorepo.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7525
GitOrigin-RevId: dc27a807e52af117636f3aa6c2c289a0be87ade1
2023-02-15 18:38:38 +00:00
kodiakhq[bot]
b01d3a45de server: dev build modes
Add some configurations for modern profiling modes, and integration into dev.sh

These require cabal 3.8 due to the use of `import`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7671
GitOrigin-RevId: f793f64105cfd99fb51b247fa8bc050f6d4bd23e
2023-02-08 22:43:00 +00:00
Daniel Harvey
d32e734310 [server] Pass parameters to native queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7727
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: ddca3d962c05024913ce6ec4c6b4ea4a0f4a6a8c
2023-02-03 11:16:29 +00:00
Daniel Harvey
e953efeb40 [ci] test the libraries in server/lib
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7758
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 311f6c4a5c629c18a55d75a5d5a74f826078e86d
2023-02-02 17:32:48 +00:00
Daniel Harvey
52317930fe Fix make ghcid-api-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7738
GitOrigin-RevId: 1576bfb51b20cdc8a67924533e4da03ec2f1f3af
2023-02-01 12:34:59 +00:00
Samir Talwar
87be5db9df make: Don't stop test database containers after running tests.
The tests no longer need a fresh, clean database, so we don't need to spend the time spinning them up and shutting them down again.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7732
GitOrigin-RevId: f2b412f4a8c762ee6699bd1bec1eef89f7682712
2023-01-31 17:00:11 +00:00
Philip Lykke Carlsen
70c8bc8700 Integrating Native Query metadata and schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7657
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: d5047559e3560f5d7870eac6e07c89704146ccab
2023-01-30 16:06:34 +00:00
Daniel Harvey
19d82c8fee [tooling] add make build-console-assets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7680
GitOrigin-RevId: ff9f380d68df9085977462b8752e38cb752ae8a7
2023-01-26 14:45:33 +00:00
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
Solomon
6c7882aa3e GDC Snowflake Integration Tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7528
GitOrigin-RevId: f90ee61899349735dc2fc0fbe6ed499614630a0f
2023-01-25 05:54:31 +00:00
Samir Talwar
4175b53395 server/api-tests: Add a Docker Compose file for the API tests.
We were previously using the Docker Compose file in the root directory
for manual testing _and_ the server API tests.

This splits them so we can e.g. add Yugabyte for easy manual testing.

In the future, this will also allow us to use ephemeral ports for API
test databases, while keeping the fixed ports for manual testing.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7524
GitOrigin-RevId: 7244e296b0ed0ace9782b6f44f321933a9d9a49d
2023-01-16 16:44:10 +00:00
Daniel Harvey
1280ca8533 [tooling] remove ghcid hacks from Makefile
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7491
GitOrigin-RevId: ffde0e86c33fbc8027091de21e0c762e60d50e1d
2023-01-13 13:43:45 +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
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
Daniel Harvey
9a59204525 [server/tests] Round trip tests for BigQuery types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7310
GitOrigin-RevId: aaff93e6288ca933770d9ecfa6c5350ebf8177b3
2022-12-21 13:58:58 +00:00
Daniel Harvey
9c36e27090 [tooling] fix ghcid commands in Makefile
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7311
GitOrigin-RevId: b1ef35807667a1c154bfe4282e65688bd2a40109
2022-12-19 11:43:29 +00:00
Gil Mizrahi
b370ee55f1 remove references to MSSQL_DOCKER in dev.sh
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7316
GitOrigin-RevId: c562bb6a5a7d769620a4119837cfeb992ced4bda
2022-12-19 10:00:13 +00:00
Daniel Harvey
2e7ea7e780 [pro/tests] add sample tests for api-tests-pro
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7180
GitOrigin-RevId: 65f8b5fefbb2341dad0cf73e6b1d2e9d604e6bfb
2022-12-14 03:47:32 +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
Samir Talwar
f430e5b599 dev.sh: Fix mssql_wait to use mssql-tools to run sqlcmd.
On macOS, we use the `azure-sql-edge` image, which doesn't contain
`sqlcmd`. To work around this, we can use another container which _does_
contain the `sqlcmd` binary to verify that MS SQL Server is up.

This was also broken on Linux anyway.

This also updates the PostgreSQL image, in line with _databases.yaml_.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7204
GitOrigin-RevId: ad974cd353c348ec055a153cbba5cb39d85e0967
2022-12-08 10:00:28 +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
Daniel Harvey
d3ee6d46a9 [tooling] add make py-tests command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7196
GitOrigin-RevId: 1507285bb42734a04bfb130f0cd1a0c28be2f3ca
2022-12-07 14:13:22 +00:00
Daniel Harvey
a7c6fd65f5 [ci] fix matrix test setup
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7195
GitOrigin-RevId: 75494d1bb4cb9060f03a918626135cd6f6191744
2022-12-07 09:27:26 +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
fe40ece04f [ci] split out api-tests runs by backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7064
GitOrigin-RevId: b5e5a2e70b69fa901d375f229aa88aed80bcb848
2022-11-30 16:23:03 +00:00
Daniel Harvey
7184c46a4e [server] fix api-tests-pro
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7078
GitOrigin-RevId: 427186eac62926408a8e1cd191fb3363757954b0
2022-11-29 15:43:22 +00:00
Daniel Harvey
60ab8e2ae3 [tooling] make commands for building and formatting CI pipeline
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7051
GitOrigin-RevId: dca45b31608680bf57a2dd190171b2567e1fcb02
2022-11-25 15:49:06 +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
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
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
Abby Sassel
4626084eaf NDAT-293 Cleanup Test.Databases.Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6929
GitOrigin-RevId: ef973937b3d80fba2ffa4a30ba9460c799eb677c
2022-11-17 22:35:40 +00:00
Samir Talwar
80c977da85 server: Split the integration tests out into their own directories.
We currently have a fairly intricate way of running our PostgreSQL and MSSQL integration tests (not the API tests). By splitting them out, we can simplify this a lot. Most prominently, we can rely on Cabal to be our argument parser instead of writing our own.

We can also simplify how they're run in CI. They are currently (weirdly) run alongside the Python integration tests. This breaks them out into their own jobs for better visibility, and to avoid conflating the two.

The changes are as follows:

- The "unit" tests that rely on a running PostgreSQL database are extracted out to a new test directory so they can be run separately.
  - Most of the `Main` module comes with them.
  - We now refer to these as "integration" tests instead.
- Likewise for the "unit" tests that rely on a running MS SQL Server database. These are a little simpler and we can use `hspec-discover`, with a `SpecHook` to extract the connection string from an environment variable.
  - Henceforth, these are the MS SQL Server integration tests.
- New CI jobs have been added for each of these.
  - There wasn't actually a job for the MS SQL Server integration tests. It's pretty amazing they still run well.
- The "haskell-tests" CI job, which used to run the PostgreSQL integration tests, has been removed.
- The makefiles and contributing guide have been updated to run these.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6912
GitOrigin-RevId: 67bbe2941bba31793f63d04a9a693779d4463ee1
2022-11-17 12:56:26 +00:00
Tom Harding
4722029bf4 Remove hpack and its CI jobs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6880
GitOrigin-RevId: 311bfcd0dc663917d8b300cc2806933529fbd4b5
2022-11-16 12:05:33 +00:00
Gil Mizrahi
15b3ac0aee ghc 9.2.5
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6777
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
GitOrigin-RevId: 916abab76446cf7c4e1e63dc112ba4994ab4d23d
2022-11-15 11:26:42 +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
Philip Lykke Carlsen
9d4950f603 server/tests: Integrated tool to probe pg compatibility
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6859
GitOrigin-RevId: 33eb82a22aca5e6982beeee075f904f514dc7a39
2022-11-14 22:01:37 +00:00
Samir Talwar
9fe793e828 Split the Docker Compose files into pieces.
With the vague idea that we can eventually avoid publishing ports at all, at least in CI, while still having the flexibility to publish ports locally.

If we can get there, it should help with the issues we're seeing on CI, where ports are already allocated from previous runs and containers aren't properly cleaned up.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6836
GitOrigin-RevId: 1d636c73ae889e45e80ad52042c56daa1b9d5838
2022-11-14 12:39:37 +00:00
Samir Talwar
99660189d7 Regenerate cabal.project.freeze, and ensure it doesn't drift in the future.
This regenerates _cabal.project.freeze_ using the new `--normalize` flag in _scripts/cabal-freeze-update.sh_. This flag simply skips the `cabal update` step.

I also added a section to preserve the liberal GHC version, as we currently run GHC v9.2.4.20220919 on CI, and most developers just run v9.2.4 locally. This can be removed once we upgrade to v9.2.5.

Finally, I have added a GitHub Action which ensures that the checked-in cabal.project.freeze file does not change upon re-normalization. As we don't run `cabal update`, this should be stable.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6815
GitOrigin-RevId: 8cd3b5f3bbe5c61d8d3f61dfcc93b9d7c278419f
2022-11-14 11:51:51 +00:00
Daniel Harvey
1f4a54347c [tooling] start databases in parallel in makefiles
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6713
GitOrigin-RevId: bd1eb1e6f4cfff1e19f8284d74997208ceae5f98
2022-11-03 17:17:41 +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
Daniel Harvey
4e630170ac [tests] Add Yugabyte to docker compose
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6532
GitOrigin-RevId: 1915c8f073ffb5f97d9e92faf436a8f03f4694b7
2022-11-01 15:19:18 +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
f4f4221d04 tests: Docker Compose healthchecks
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6282
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
GitOrigin-RevId: c2b1f958364ce5e1ef704fa1275d18ac810ca35b
2022-10-17 13:20:31 +00:00
Samir Talwar
96a768e526 Upgrade HLint to v3.4.1.
This upgrades CI and anyone using Nix to HLint v3.4.1.

If you're not using Nix, this doesn't actually _do_ anything on your
local machine; it's just a suggestion.

It also applies a bunch of simple HLint refactors, using
`make lint-hs-fix`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6324
GitOrigin-RevId: de8267e4909d6dcd3f83543188517f3aaeebc5f3
2022-10-12 19:14:56 +00:00
Lyndon Maydwell
d54bb30d3b Structured Error Protocol for Data Connectors Agents - GDW-137
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6061
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 855d96378030f4e01b0c74b00e20e592e51e7a49
2022-10-11 00:26:24 +00:00
Samir Talwar
f9ff7ae00c CI: Remove the custom Microsoft SQL Server image.
Now that we use the mssql-tools image for running `sqlcmd`, we no longer need this (or indeed use it very much).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6152
GitOrigin-RevId: be8852a93889553c3ffd2ec00c0dda81b36c3d05
2022-10-06 16:21:44 +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
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
Samir Talwar
b52dc90663 Nix: Get the Nix shell working on macOS/aarch64.
Improvements to the Nix configuration so that macOS is supported.

Microsoft SQL Server is still not supported (yet; I have something in mind there), but the rest works. You can still use Homebrew to install the SQL Server drivers.

I had to make the following changes:

* I updated nixpkgs, because it's been a while.

* I made `ODBCINSTINI` optional so that it's not loaded on macOS, as it depends on `msodbcsql17`, which is broken on macOS.

* I upgraded OpenSSL.

* I set `DYLD_LIBRARY_PATH` on macOS so GHC finds OpenSSL; otherwise, it uses the wrong version of `libcrypto`, and fails with a fun error:

  > WARNING: ghc is loading libcrypto in an unsafe way

* I patched GHC to fix compilation on macOS (copied from https://github.com/NixOS/nixpkgs/pull/149942).

To test this out, you can run `nix develop` (or install [direnv][] and add `use flake` to _.envrc.local_), and then try building HGE in the shell provided.

Fair warning: GHC needs to be built, and takes _aaages_ the first time. If this becomes useful to others, we can set up a shared cache.

[direnv]: https://direnv.net/

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5989
GitOrigin-RevId: 7130738d47709c37778b31c134061758ce23e959
2022-09-30 19:17:14 +00:00
Samir Talwar
cbdacd1c6c CI: Fix all shellcheck warnings in test-server.sh
* Add `source=` directives.
* Quote variables.
* Don't export variables that can fail to assign; instead, export afterwards.
* Write HGE stderr to the log file.
* Fix warnings around the PIDs.
* Disable a couple of false positives.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6097
GitOrigin-RevId: ed1c696b8735cd5d63ba30b3105040a0a9eca63c
2022-09-28 16:08:15 +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
Samir Talwar
e12923a1b3 Demand Python 3.9 to run the server's Python integration tests.
CI has already been upgraded.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5857
GitOrigin-RevId: 28a56c5fd61f425b76df478fd230e6944ce8122f
2022-09-13 20:20:19 +00:00
ananya-2410
a5c6a5b64a ci: tag release v2.11.2 and v2.12.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5831
GitOrigin-RevId: 8aedf377bf6f80bd7df14b7da9dc52c845a3a844
2022-09-12 07:19:23 +00:00
Samir Talwar
880f165b81 Correct the names and references of various DC SQLite make targets.
`spawn-dc-sqlite-agent` was incorrectly named, and the `start-dc-sqlite-agent` target was missing. In addition, we usually only make the `start-xyz` target public in `make help`, and so only that needs a comment.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5804
GitOrigin-RevId: 8064ce148d004ef73dbd8570ef30435423ede0a1
2022-09-08 07:48:42 +00:00
Daniel Harvey
8c8dc7a52f tests: add CockroachDB hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5789
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 870005475c289634cc2740bc375794267b45da1f
2022-09-07 15:12:03 +00:00
Lyndon Maydwell
cd6fe41b99 SQLite Data Connectors HSpec Tests - GDW-183
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5731
GitOrigin-RevId: 0af22a85bd6b1cb8888562e05cde640047e56b41
2022-09-07 03:43:32 +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
Daniel Harvey
518bf38d48 tooling: make commands for data-connectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5395
GitOrigin-RevId: 76e10ac7ebb1fa655a7523d38174f049dc683105
2022-08-25 12:09:15 +00:00
Philip Lykke Carlsen
e7522978c5 fix: wrong argument in ghcid.mk
Just a small typo I found.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5602
GitOrigin-RevId: 9962f0d245b700f1a9c54604b36302545ccefaff
2022-08-24 09:02:24 +00:00
Samir Talwar
38c94d8cda server/tests-py: Fix some warnings.
They're getting in the way of real problems.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5541
GitOrigin-RevId: 9bc99a0826715f6df77055cca79e428ad49742a8
2022-08-24 08:32:07 +00:00
Vishnu Bharathi
5830720dbf ci: remove changelog check and introduce changelog in PR template
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5520
GitOrigin-RevId: 94f9c54060e22e7cb4812b4fb5337d9391951b09
2022-08-22 04:44:47 +00:00
Daniel Harvey
145fed8a7f tooling: add make commands for running unit tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5537
GitOrigin-RevId: 6427a51f729a4d4724299ea9a6a5d0e808882c86
2022-08-19 11:23:43 +00:00
Samir Talwar
2757c2156b server/tests-py: Move installing node_modules to the makefile.
This means that if `remote_schemas/nodejs/package.json` changes, the
dependencies will be automatically reinstalled.

It also moves `package-lock.json` to the correct location (in the
directory in which we run `npm install`), and updates it.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5481
GitOrigin-RevId: f3fb431afd19de150f39ec2e4cb6572b896c870f
2022-08-16 09:27:04 +00:00
Samir Talwar
b690a3fc3a server/tests-py: Install the pytest-durations plugin.
[pytest-durations][] is an enhancement to pytest over the built-in
[`--durations` parameter][] which also shows the duration of setup,
teardown, and fixtures that take the longest.

While it's not strictly necessary now, I used it to figure out what was
taking so long when trying to run things in parallel, and found it very
helpful, so I think it's worth preserving.

[pytest-durations]: https://pypi.org/project/pytest-durations/
[`--durations` parameter]: https://docs.pytest.org/en/6.2.x/usage.html#profiling-test-execution-duration

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5480
GitOrigin-RevId: b789418dd4c971adb91e08b7837a962bede44452
2022-08-15 16:15:37 +00:00
Samir Talwar
b856d96989 server/tests-py: Factor out service URLs as environment variables.
Making it easier to inject different ones later.

I also included a change to _.prettierignore_ so Visual Studio Code doesn't keep trying to reformat the JavaScript or YAML files in `server/tests-py`, as it can cause diffs to balloon for no obvious benefit.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5456
GitOrigin-RevId: bc6d548708160a328e1e61a00e19be8e124da025
2022-08-15 14:59:05 +00:00
awjchen
edc29ce0d4 tooling: Add make ghcid-library-pro command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5344
GitOrigin-RevId: cf20d7654b26933e8fba870e4ec9750785bb1506
2022-08-06 00:52:17 +00:00
Samir Talwar
aa18f65217 server: Move the schema parsers to their own library.
It's about time.

To do this I had to check a few more boxes.

* I copied the flags from `graphql-engine.cabal` to the libraries in `server/lib`.
* I moved `Cacheable` instances of schema parser types beside the typeclass declaration.
* I removed imports of `Hasura.Prelude` from the tests, and rewrote them accordingly.
* I copied the `TestMonad` parse monad into `server/src-test/Hasura/GraphQL/Schema/RemoteTest.hs`, which was using it. I think this could be done with the real thing, but I tried replacing it with constraints and it messed with my head somewhat.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5311
GitOrigin-RevId: ebebcc50a16f2d517b7f730fe72410827ca3e86c
2022-08-05 13:53:39 +00:00
Samir Talwar
c0a0a5fe87 docker: Mount database data directories as named volumes.
I'm trying to shore up the Python integration tests to make them more reliable. In doing so, I noticed this.

---

This ensures that the data directories are always in a mutable file system, and not going through overlayfs.

In my testing, this sped up PostgreSQL database initialization a lot. In particular, `CREATE DATABASE` commands went from > 5s to < 0.1s.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5248
GitOrigin-RevId: 5104aea32c92559c323803020d727bebfdafb8e6
2022-08-04 10:11:10 +00:00