Commit Graph

2345 Commits

Author SHA1 Message Date
Abby Sassel
7df9dc5832 NDAT-295 Cleanup Tests.Subscriptions structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6882
GitOrigin-RevId: 854d30dc0a1859c08f082df4d3c375325c59cf9c
2022-11-16 13:24:15 +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
Tom Harding
0ff55c37f8 Remove MySQL tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6872
GitOrigin-RevId: 87a55e2384433c076c8815f991e753e4112d60dd
2022-11-16 11:26:01 +00:00
Tom Harding
93a2736c30 String interpolation for Citus backend modules
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6884
GitOrigin-RevId: abb15634de5c0a387284e2bed25622c302df6a3b
2022-11-16 10:38:50 +00:00
ananya-2410
5a7692ba68 ci: tag release v2.15.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6895
GitOrigin-RevId: e8b282490310362bd0cdc4b05988999598a6445a
2022-11-16 08:12:21 +00:00
Brandon Martin
1e6cf5f133 super-connector: More coalesce defaults for rows/aggregates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6861
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 3a3efd89196e619ae7491d3fc95c19f8c5156f2e
2022-11-15 20:53:55 +00:00
Auke Booij
5b93014ee8 Make Schema Cache building code slightly more readable
- Avoid a few banana brackets `(| ... |)`, often by just using local `let` bindings
- Use proper `Arrows` syntax rather than helpers like `>->`
- Use monadic `do` syntax instead of `Arrows` syntax where possible
- Avoid `traverseA @Maybe`, in favor of a `case`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6751
GitOrigin-RevId: c07b22a1a259db6d135486ec71a716705e280717
2022-11-15 20:14:22 +00:00
Samir Talwar
7c452bfca1 server/tests-py: Spawn a new PostgreSQL schema ("database") per test.
When running using the "new" style (with a HGE binary, not a URL), a new PostgreSQL metadata and source database are created for each test. When we get this into CI, this should drastically reduce the flakiness.

I have also enabled parallelization by default when using `run-new.sh`. It's much faster.

I had to basically rewrite _server/tests-py/test_graphql_read_only_source.py_ so that it does two different things depending on how it's run. It's unfortunate, but it should eventually go away.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6879
GitOrigin-RevId: a121b9035f8da3e61a3e36d8b1fbc6ccae918fad
2022-11-15 19:08:53 +00:00
Abby Sassel
3da0e2f1a2 NDAT-295 Cleanup Tests.Query structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6878
GitOrigin-RevId: 521d8366a26ba933ebb7892d243a9ce94b90c8f0
2022-11-15 17:29:46 +00:00
Auke Booij
6ac67a5566 Allow collecting metadata dependencies and inconsistencies separately
`CollectedInfo` was just an awkward sum type. By using an explicit `Either` instead, we can guarantee at the type level that certain methods only write inconsistencies, or only write dependencies. This is useful, because if we can guarantee that no dependencies are written, then we don't need to run `resolveDependencies` on that part of the Metadata. In other words, we can keep it out of `BuildOutputs`, which greatly benefits performance - see e.g. hasura/graphql-engine-mono#6613.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6765
GitOrigin-RevId: 9ce099d2eee2278dbb6e5bea72063e4b6e064b35
2022-11-15 17:00:11 +00:00
Samir Talwar
3670a10ee5 Share database configuration across tests.
This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests.

Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_.

The files in question are:

- _docker-compose/databases.yaml_, which is the base specification for the databases
- _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above
- _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_
- _server/tests-py/docker-compose.yml_, used by the Python integration tests

The changes are summarized as follows:

1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing:
    - the fixed port mappings (in the range 65000–65010)
    - the PostgreSQL initialization
    - the SQL Server initialization
2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden.
3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere.
    - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary.
4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_.
    - This was the point.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864
GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 14:32:46 +00:00
Abby Sassel
a2dcb70500 NDAT-295 Cleanup Tests.Schema structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6871
GitOrigin-RevId: 314d2095de4db104dd9bd1fba6feb84de7bdb98c
2022-11-15 13:17:22 +00:00
Auke Booij
2d055df2a4 server: Simplify BuildOutputs
A bunch of configurations are retrieved from the Metadata, then stored in the `BuildOutputs` structure, only to then be forwarded to the `SchemaCache`, with extremely little processing in between.

So this simplifies the build pipeline for some parts of the metadata: just construct those things from `Metadata` directly, and store them in the `SchemaCache` without any intermediate container.

Why did we have the detour via `BuildOutputs` in the first place? Parts of the Metadata (codified by `MetadataObjId`) can generate _metadata inconsistencies_ and/or _schema dependencies_, which are related.

- Metadata inconsistencies are warnings that we show to the user, indicating that there's something wrong with their configuration, and they have to fix it.
- Schema dependencies are an internal mechanism that allow us to build a consistent view of the world. For instance, if we have a relationship from DB tables `books` to `authors`, but the `authors` table is inconsistent (e.g. it doesn't exist in the DB), then we have schema dependencies indicating that. The job of `resolveDependencies` is to then drop the relationship, so that we can at least generate a legal GraphQL schema for `books`.

If we never generate a schema dependency for a certain fragment of Metadata, then there is no reason to call `resolveDependencies` on it, and so there is no reason to store it in `BuildOutputs`.

---

The starting point that allows this refactor is to apply Metadata defaults before it reaches `buildAndCollectInfo`, so that metadata-with-defaults can be used elsewhere.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6609
GitOrigin-RevId: df0c4a7ff9451e10e02a40bf26304b26584ba483
2022-11-15 12:04:13 +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
Tom Harding
502115f969 Bump aeson to v2.1, drop the Extended module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6869
GitOrigin-RevId: ecb2f7dfe7d00c0a01999c12b0264be7850e0f42
2022-11-15 10:44:36 +00:00
Solomon
d0a77a9f28 Prevents creation of duplicate GDC agent source kinds.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6865
GitOrigin-RevId: e3b3c68e91b22307ef4a9f215e34234b875d802f
2022-11-15 00:40:56 +00:00
Brandon Martin
22e6d7afcd server: Add Uppercase option to tests-dc-api
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6863
GitOrigin-RevId: 6e4950786cebedcbfcff26fed691a6b6bf0c1aa3
2022-11-14 23:08:26 +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
paritosh-08
ec13a55fd5 server: add validation for response transforms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6821
GitOrigin-RevId: 88abcc408d0a1b73024356d9b32881bc3d4d746c
2022-11-14 15:19:23 +00:00
Abby Sassel
b7a09a42c1 NDAT-293 Update feature matrix with features tested in api-tests suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6855
GitOrigin-RevId: 37f8193b8528f90955d55d2812f6f45afca054c8
2022-11-14 14:37:30 +00:00
Lyndon Maydwell
6f9f44a441 Data Connectors API 400 error response - GDC-619
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6839
GitOrigin-RevId: 813ea5e976ff41754e7500abf6bcd0c8b70c960e
2022-11-14 05:26:16 +00:00
Philip Lykke Carlsen
6470eeb7f6 server/tests: Feature Matrix Compatibility Report
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6827
GitOrigin-RevId: f4d93684e5f47a6e43b4e870d2c87dbdee8f0bd8
2022-11-10 22:59:24 +00:00
Abby Sassel
8726236a9d NDAT-316 Improve askSourceInfo error reporting _even more_
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6835
GitOrigin-RevId: c15bea414176878c6ec96674376858294e48255b
2022-11-10 19:24:34 +00:00
paritosh-08
0b827fae66 server: remove built-in scalars from graphql schema printer
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6541
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
GitOrigin-RevId: 5a2e35da2cf8718ee452429c56986066a3dc0c54
2022-11-10 18:53:05 +00:00
Jesse Hallett
31e402e767 server: remaining codecs for function metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6654
GitOrigin-RevId: a9d24c72078d2a2b0c8a62a6084d5ab86518fdeb
2022-11-10 16:17:13 +00:00
Abby Sassel
63ec04493a NDAT-316 Improve askSourceInfo error reporting
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6807
GitOrigin-RevId: b27e642079915c3f0ca85d88195fe323e18800c1
2022-11-10 11:48:02 +00:00
Tom Harding
c0070bfd4b Add the ability to run api-tests against any (Postgres-like) connection string.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6791
GitOrigin-RevId: 5005eba75efbf7a0d7208be0a0794d63be82afd5
2022-11-10 09:44:11 +00:00
Samir Talwar
44a64ed983 server/test-harness: Wrap test resource setup/teardown.
When setting up a resource (typically some kind of web server) for use in tests, we need to remember to tear it down afterwards.

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

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

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

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6806
GitOrigin-RevId: 74e2d76c5c09b8e0fe1cad84c9e77011f5a4d3db
2022-11-10 08:38:09 +00:00
awjchen
7d6e713d9f pro-server: hotfix: respect analyze_query_variables in logs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6754
GitOrigin-RevId: 3f1b0000d2962bd02708786331595828cf99b38c
2022-11-09 23:31:59 +00:00
Philip Lykke Carlsen
eb9506d954 server/tests: Structured logging in tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6805
GitOrigin-RevId: 4e4d3c12bad20948b5ad58b3ad6d1e882f4ceddb
2022-11-09 14:56:12 +00:00
Daniel Harvey
22556a482e tooling: update Mac compile guidance
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6804
GitOrigin-RevId: 43ce24a2dbbf2e8e5d1418d96ff552a324645e5f
2022-11-09 10:23:16 +00:00
Samir Talwar
8be01ae9aa server/api-tests: Use setupTablesAction everywhere.
This removes calls to `setup` and `teardown` in favor of `setupTablesAction`.

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

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

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6769
GitOrigin-RevId: 12cb8f81dd6aced892fe83c49b9a0bdbef8cc1ac
2022-11-09 09:36:43 +00:00
Gil Mizrahi
75ffa94b17 enable citus and cockroach streaming subscriptions and extend test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6711
GitOrigin-RevId: 10e012132bcef27b1ed35a654f349c6d74d72e1d
2022-11-09 07:23:37 +00:00
Daniel Chambers
431311e74e Add support for ordering by related tables and aggregates to the SQLite agent [GDC-313]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6773
GitOrigin-RevId: 9cca50511aa9e8ef7c4e2a20f280be0fa51aab85
2022-11-09 06:06:58 +00:00
Solomon
1ff7d3535f Refactor DataConnector FixtureName constructors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6756
GitOrigin-RevId: 5f736a891ad15d4707f6a9d88037cbc89a4c00e5
2022-11-09 05:09:04 +00:00
Daniel Harvey
2d8e6372e9 [server/tests] - fresh CockroachDB per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6788
GitOrigin-RevId: 71e1f0840de101796d2ebeec240a4f0075640a68
2022-11-08 18:59:17 +00:00
pranshi06
7b7845f697 server: add jwk-refresh-log type to default enabled logs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6775
GitOrigin-RevId: 23fbeceb91e51380ccf0bb5830a4471d8964a3f5
2022-11-08 16:48:44 +00:00
Daniel Harvey
48bb73ecb4 [server/tests] create new Postgres DB for each test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6741
GitOrigin-RevId: 0fa10ff8e3ab0ca9c36b1146ebf70434836f2531
2022-11-08 11:44:13 +00:00
pranshi06
fd6aa0a266 server: add jwk-refresh-log as configurable log type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6705
GitOrigin-RevId: 1f6f45ce555cefc24836a2fc5363660e351fa13b
2022-11-08 07:37:50 +00:00
kodiakhq[bot]
3a76c57adf Some inlining and bang patterns to improve memory residency
Just forcing some of the most numerous thunks (with -hi profiling), it
seems some of these were retaining significant amount of data

this can follow merge of, or supersede #6679

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6710
GitOrigin-RevId: d0566ee288841e264637231a7f238946aa2e3564
2022-11-08 03:55:38 +00:00
Puru Gupta
a4eb5ad95d server: improve DX for heroku integration
## Description ✍️
This PR aims to improve the developer experience when using a heroku postgres instance as source database. Better error messages and relevant documentation are added as a part of this PR.

## Changelog ✍️

__Component__ : server

__Type__: enhancement

__Product__: community-edition

### Short Changelog

Improve DX for heroku integration

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

### Steps to test and verify ✍
- Add a new heroku postgres instance as DB source in Hasura
- Try adding an event trigger
- Improved error message will be emitted:
```json
{
    "arguments": [],
    "error": {
        "description": null,
        "exec_status": "FatalError",
        "hint": null,
        "message": "pgcrypto can only be created in heroku_ext schema. Hint: You can set \"extensions_schema\" to provide the schema to install the extensions. Refer to the documentation here: https://hasura.io/docs/latest/deployment/postgres-requirements/#pgcrypto-in-pg-search-path",
        "status_code": "P0001"
    },
    "prepared": false,
    "statement": "CREATE EXTENSION IF NOT EXISTS pgcrypto SCHEMA public"
}
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6630
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: a46d7c129a4e0378b7f33445f9bda11e0bddbd74
2022-11-08 03:55:30 +00:00
Samir Talwar
9ab4eb3994 server/api-tests: Only export spec from all test modules.
This ensures that tests don't accidentally share setup/teardown code.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6755
GitOrigin-RevId: 51551dfbc0668fcd884e7055ee3790c6f465bbf8
2022-11-08 03:54:52 +00:00
Divi
a509544440 ci: v2.15.0 catalog version update
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6760
GitOrigin-RevId: 87e4318f5cc7960a6e7032c5f2805cbe38564bf0
2022-11-08 03:53:27 +00:00
awjchen
ebb28ad4c9 pro-server: add support for exporting traces over OTLP
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5862
GitOrigin-RevId: fd80a59a1459095716f94cea7b2e54f9b5d19a98
2022-11-07 06:56:08 +00:00
awjchen
3e6840e4fa server: more adjustments to metadata sync logging
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6718
GitOrigin-RevId: 8cab5e6b39b1fa85e42fa176f3fb589c5da2c081
2022-11-05 22:38:22 +00:00
Jesse Hallett
de6e5d71b0 server: codecs for table, function, and remote relationship types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6608
GitOrigin-RevId: 9c91edec06e49b8d44960e322459ba7a05f26b5a
2022-11-04 21:44:41 +00:00
awjchen
8d6b39602a server: remove excessive metadata sync log line
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6715
GitOrigin-RevId: 564ae127b20638b15a6a0e407976ed4d90c81b4a
2022-11-04 19:42:17 +00:00
Daniel Harvey
e6c3113a43 [server]: feature flag to remove _stream fields from schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6698
GitOrigin-RevId: d2b80900d06353647505256fc351a07e6f7cd5f7
2022-11-04 13:10:35 +00:00
Daniel Chambers
381c81c806 Added new agent test to check ordering in deeply nested array relationships [GDC-605]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6721
GitOrigin-RevId: e0478bef0a8f5fffba9ef032be323cadc0f85116
2022-11-04 12:27:35 +00:00
Abby Sassel
8bb537e73b NDAT-72 CRDB Support for Value of Derived Field
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6707
GitOrigin-RevId: 8fab832a8ca225080d2797013f93d122e6424e35
2022-11-04 11:53:48 +00:00