Commit Graph

353 Commits

Author SHA1 Message Date
Daniel Harvey
b85272224e chore(postgres-agent): use capabilities from Rust POC agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9106
GitOrigin-RevId: 2536335b59ddf7e1353a41476f41ad4cfb389642
2023-05-10 11:42:25 +00:00
Gil Mizrahi
181f780273 WIP IN PROGRESS Query for postgres dc
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9071
GitOrigin-RevId: 863417976f6c2483ba092a8e8d660dfea8aca0a4
2023-05-05 16:31:13 +00:00
Samir Talwar
37fe99418c dc-agents/postgres: Test on random ports.
The ports we use for testing often collide with other containers that other test suites leave lying around. This is annoying.

This fixes the problem by ensuring that PostgreSQL runs a on random port. FWe can query Docker to find out the allocated port.

I also changed the `make` target to run the agent too (though I kept the old behavior under a different target name).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9053
GitOrigin-RevId: 3ddea297905c0019c5ac42d896f5609f0d079e93
2023-05-05 13:02:02 +00:00
Nicolas Beaussart
8b447a5880 frontend: switch to yarn berry
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9052
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
GitOrigin-RevId: d9c8bc29f9309247944d130d545c6dcaccff366a
2023-05-05 08:57:54 +00:00
Daniel Harvey
cb9056ab8a chore(postgres-agent): introspect table names from database
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9042
GitOrigin-RevId: de2412ee2511d4cd0b72a660a85ac26a3214d735
2023-05-04 13:13:12 +00:00
Samir Talwar
397e95fc6a Upgrade Citus to v11.3.0 in tests.
Upgrades Citus to v11.3.0 in tests.

This breaks an assumption made by the tests for the `get_source_tables` metadata API, in which data is expected to be ordered. We fix it by explicitly ordering rather than relying on the goodwill of the database.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9039
GitOrigin-RevId: ee86db7e1c264d5009bb0203ac2f3fb2cda7b39f
2023-05-04 11:40:10 +00:00
Daniel Harvey
e62339d20c feat(postgres data connector): Adding initial support for /Schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9018
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 4330c1201bac790b370d3d53d915f8ffe00ba0c9
2023-05-03 21:12:45 +00:00
Samir Talwar
c1705a09df api-tests: Fix the error messages to match those reported by Citus v11.3.0.
I also pinned Citus to v11.3. This should hopefully stop us from being surprised with random test failures in the future. We will need to bump this every now and again.

I have updated the Makefile to standardize Docker commands, and made sure we start all the containers even when running tests for a single database, as we need to test cross-DB remote joins. This ensures `make test-citus` actually works and runs all tests.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9035
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 9c36ab65eb05206bfddd639c257d6c5c5cedd2bd
2023-05-03 20:22:26 +00:00
Gil Mizrahi
990fd54e8c Stored Procedures schema parsers and codegen
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9000
GitOrigin-RevId: 951a8b949359db11df183964b4ce217ae02a301c
2023-04-29 08:05:37 +00:00
Samir Talwar
53749aa796 CI: Use "12345" for the server version instead of generating one.
We bake the version number into the binary, which means that changing it causes a lot of files to rebuild (also thanks to Template Haskell). We can avoid this by simply using a dummy value which does not change.

When releasing, we still use the Git tag.

This should speed up the server build a lot, most of the time.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8916
GitOrigin-RevId: 7e5f9d4d582dba3eecab52fd37a216cadefba941
2023-04-28 18:19:40 +00:00
Gil Mizrahi
930df62de7 Stored procedures api commands
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8975
GitOrigin-RevId: c71a9f74bf01bb8c0bc8c8cd4b744b530d99476a
2023-04-28 13:38:34 +00:00
Samir Talwar
e3b46b78a9 server/upgrade-tests: Tests that ensure that HGE upgrades successfully.
These tests ensure that upgrading HGE preserves the GraphQL schema.

They do this by running two different versions of HGE against the same metadata, and ensuring that the GraphQL schema doesn't change.

We might find that in the future, we make an additive change that makes these tests fail. Improving the tests to allow for this is left as an exercise to whoever triggers it. (Sorry.)

Currently, we do this with:

  * an empty database (zero tracked relations)
  * the Chinook dataset
  * the "huge schema" dataset

The base version of HGE tested against can be overridden with an option. The version must be available on Docker Hub.

Further information is in the Haddock documentation.

[NDAT-627]: https://hasurahq.atlassian.net/browse/NDAT-627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8982
GitOrigin-RevId: 97b4deda1e6fe1db33ce35db02e12c6acc6c29e3
2023-04-28 12:54:51 +00:00
Daniel Harvey
d663207f5e chore(tooling): fix make test-integration-mssql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8987
GitOrigin-RevId: ad9c3bc6f1dcfe034f33260a151a3424cb7f433d
2023-04-28 10:23:09 +00:00
Daniel Harvey
a0b1d69392 chore(server): make native queries pro-only
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8926
GitOrigin-RevId: 68d2091c97ed80e86f851d656749eab865f73ec4
2023-04-27 14:31:53 +00:00
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