Commit Graph

2334 Commits

Author SHA1 Message Date
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
Daniel Chambers
723c91bef4 Fixed unstable ordering issues in data connector agent test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6687
GitOrigin-RevId: 278a6073923981683cb75cfb922f284e0960c324
2022-11-04 04:36:47 +00:00
Philip Lykke Carlsen
6720d77cd9 Perform fixture setup spec-by-spec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6708
GitOrigin-RevId: ac4b7350f6c0e9719f8b5973b267d72e3e4e444c
2022-11-03 20:27:02 +00:00
Philip Lykke Carlsen
1fa7f9b881 server/tests: Move 'emptySetupAction' to its single usage site
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6704
GitOrigin-RevId: 9adac1913fff3735b44c89c206e92544c9aa760b
2022-11-03 16:29:28 +00:00
Philip Lykke Carlsen
a4792a6b80 server/tests: Remove unnecessary complexity from Harness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6700
GitOrigin-RevId: 3130097581b4e9284cd1074a5d74eb5165354eb4
2022-11-03 15:57:54 +00:00
Tom Harding
d823d201b9 CREATE SCHEMA _ IF NOT EXISTS in api-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6701
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 13ab91a8c4241fb4e60df9e8856bc926afac6be9
2022-11-03 14:54:48 +00:00
Lyndon Maydwell
4db9941b32 Prohibit underscores in dataconnector names [GDC-586]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6681
GitOrigin-RevId: 5335208fc4c8f0d1b16a45415329ef390a269b4c
2022-11-03 14:00:52 +00:00
Philip Lykke Carlsen
5b2877bc8f server/tests: Move subscriptions harness to a separate module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6664
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: f5d7793606a50fb10f871ae757748fe5c21e50c8
2022-11-03 10:58:32 +00:00
Karthikeyan Chinnakonda
d7609233c4 Rename get_event_invocations to get_scheduled_event_invocations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6513
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 172ba6152ed77b90eeec9183a3fb4c6f177e45b3
2022-11-03 10:23:11 +00:00
Nicolas Inchauspe
b0d5238c3b console: globally add missing <!DOCTYPE html>
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6661
GitOrigin-RevId: ee45e493c76ad81569731dcd5468c846ba01cd12
2022-11-03 07:06:06 +00:00
awjchen
700d4616cb server: add logging for debugging metadata sync issues
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6657
GitOrigin-RevId: ab7b8015010d20a641606fad8cd1cc8563466d0c
2022-11-02 23:24:23 +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