Commit Graph

2780 Commits

Author SHA1 Message Date
Rakesh Emmadi
454fbc7f69 server/pro/cloud: add resolved connection template context in error response in dev mode
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8541
GitOrigin-RevId: 57f97ac336be8e656dcfcf4e339ad2ccc5c62393
2023-03-30 12:09:32 +00:00
Philip Lykke Carlsen
ed813655f6 refactor(tests): late binding of shouldReturnYaml
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8558
GitOrigin-RevId: 5044f4c726b71760fdbb05b71a1fc79e4eaa8a31
2023-03-30 09:05:04 +00:00
paritosh-08
e317c1a53f server: add new metrics for scheduled triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8401
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: 0cdec9e7b5e9251bf7c8b710b7552d065d62e195
2023-03-30 05:52:54 +00:00
Philip Lykke Carlsen
e40e89d2d7 refactor(test-harness): Split up and move Harness.Test.Schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8545
GitOrigin-RevId: 9069737c23a286b3cefab59714064beac1465295
2023-03-29 17:40:33 +00:00
paritosh-08
b7bae6dfec server: add new metric for event trigger observability
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8380
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: df7d5c53668fc84e7d70d471e29774136f5d560a
2023-03-29 16:48:19 +00:00
paritosh-08
677a972956 server: improve connection template error message
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8517
GitOrigin-RevId: 3240e569322f3c9bf9376bbf4ea01c5d48218f07
2023-03-29 13:37:33 +00:00
Karthikeyan Chinnakonda
f5ffeeba52 Process scheduled events with a timeout
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8542
GitOrigin-RevId: f6c9300af3d038d17848ac0c001a6044dbafa464
2023-03-29 11:26:12 +00:00
Naveen Naidu
4e3dbed938 server: revert changes to created_at column of 'hdb_catalog.event_log'
This PR reverts the following two commits:
1. https://github.com/hasura/graphql-engine-mono/pull/8287
2. https://github.com/hasura/graphql-engine-mono/pull/8467

We are undoing a migration that was done on `hdb_catalog.event_log` table which was done in d4ae6a517da63f2f43567dc16fda135b3cd1d7e6 . And as such, users who were using event triggers on that version will come across the error:
```json
{"detail":{"info":{"code":"not-supported","error":"Expected source catalog version <= 3, but the current version is 4","path":"$"},"kind":"catalog_migrate"},"level":"error","timestamp":"2023-03-28T10:17:24.289+0530","type":"startup"}
{"code":"not-supported","error":"Expected source catalog version <= 3, but the current version is 4","path":"$"}
```
To fix these errors please run the following SQL on the source where event triggers were created on:
```
UPDATE hdb_catalog.hdb_source_catalog_version SET version = 3, upgraded_on= NOW();
ALTER table hdb_catalog.event_log ALTER COLUMN created_at SET DEFAULT NOW();
ALTER table hdb_catalog.event_invocation_logs ALTER COLUMN created_at SET DEFAULT NOW();
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8534
GitOrigin-RevId: b6bbcce0163c8beed80619d3cea056e643b8c180
2023-03-29 10:33:30 +00:00
Vishnu Bharathi
b0643d32d5 ci: tag release v2.22.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8553
GitOrigin-RevId: 48d121b042d66a52cf5a7e6e4d65cde44cc619cd
2023-03-29 09:53:09 +00:00
Gil Mizrahi
4b33b17f93 chore(ci): show bigquery error details when requested
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8525
GitOrigin-RevId: 882f3ee0dbe7776b15d53a66851b2a57b41fad73
2023-03-29 09:03:47 +00:00
Auke Booij
51774be7d6 fix(server): error handling for serving console assets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8222
GitOrigin-RevId: c7f49b35f659fbcd2b4471797b8d25e306aa56e7
2023-03-29 08:31:21 +00:00
Daniel Harvey
bbf71665d3 chore(pg-client: remove flaky running queries test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8530
GitOrigin-RevId: fe4c5dbdb607a808a6de0463433d710d16348ca0
2023-03-28 14:37:41 +00:00
Rakesh Emmadi
bfca9fd986 server/gardening: refactor scMetadataResourceVersion in SchemaCache
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8377
GitOrigin-RevId: 999a5112f8940b267c2765f4bed39bf6151f18f0
2023-03-28 13:27:32 +00:00
Divi
58edd357b8 ci: tag release v2.22.0-beta.2
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8531
GitOrigin-RevId: 3eb2d27b0457b0a1b114148ecefa8158dfeeeb61
2023-03-28 12:19:40 +00:00
Philip Lykke Carlsen
926d5ecdb0 feat: Handle logical models in metadata when the feature is disabled
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8443
GitOrigin-RevId: 4df0f62979dc78103b786b6f0f8ffcde6def0739
2023-03-28 11:57:11 +00:00
Daniel Harvey
2fb455b813 chore(tests): increase BigQuery test retries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8522
GitOrigin-RevId: c412a45ceddd18caed7e5b505cfe4163ec9beb88
2023-03-28 11:20:21 +00:00
Daniel Harvey
913f254a1f chore(tests): explicitly set BigQuery retry limit in py-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8523
GitOrigin-RevId: 52cb1f6c1d7eb61ebb1bf9a8318c9369f4594a30
2023-03-28 10:42:00 +00:00
Samir Talwar
69c238dc95 server/test-manual: A way to start PostgreSQL with a read replica.
This is for local testing. Details are in the README.

[DSF-218]: https://hasurahq.atlassian.net/browse/DSF-218?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8449
GitOrigin-RevId: 758aa9600fe79ed5c2917def3c86ac185267259e
2023-03-28 09:20:51 +00:00
Samir Talwar
d85de6bb6a CI: Get the GHC version from VERSIONS.json for all GitHub workflows.
Ideally, we'd have one place for this.

I have also removed the pinned Cabal version because v3.10 should address the bug we were seeing in the v3.8 series.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8497
GitOrigin-RevId: d0c68792c30e2e28ff2e210dd3ac8d28b83ac851
2023-03-27 18:53:18 +00:00
Antoine Leblanc
7aa341944b Remove HasServerConfigCtx from the schema cache build.
## Description

This PR is a incremental step towards achieving the goal of #8344. It is a less ambitious version of #8484.

This PR removes all references to `HasServerConfigCtx` from the cache build and removes `ServerConfigCtx` from `CacheBuildParams`, making `ServerConfigCtx` an argument being passed around manually instead. This has several benefits: by making it an arrow argument, we now properly integrate the fields that change over time in the dependency framework, as they should be, and we can clean up some of the top-level app code.

## Implementation

In practice, this PR introduces a `HasServerConfigCtx` instance for `CacheRWT`, the monad we use to build the cache, so we can retrieve the `ServerConfigCtx` in the implementation of `CacheRWM`. This contributes to reducing the amount of `HasServerConfigCtx` in the code: we can remove `SchemaUpdateT` altogether, and we can remove the `HasServerConfigCtx` instance of `Handler`. This makes `HasServerConfigCtx` almost **an implementation detail of the Metadata API**.

This first step is enough to achieve the goal of #8344: we can now build the schema cache in the app monad, since we no longer rely on `HasServerConfigCtx` to build it.

## Drawbacks

This PR does not attempt to remove the use of `ServerConfigCtx` itself in the schema cache build: doing so would make this PR much much bigger. Ideally, to avoid having all the static fields given as arrow-ish arguments to the cache, we could depend on `HasAppEnv` in the cache build, and use `AppContext` as an arrow argument. But making the cache build depend on the full `AppEnv` and `AppContext` creates a lot of circular imports; and since removing `ServerConfigCtx` itself isn't required to achieve #8344, this PR keeps it wholesale and defers cleaning it to a future PR.

A negative consequence of this is that we need an `Eq` instance on `ServerConfigCtx`, and that instance is inelegant.

## Future work

There are several further steps we can take in parallel after this is merged. First, again, we can make a new version of #8344, removing `CacheBuild`, FINALLY. As for `ServerConfigCtx`, we can split it / rename it to make ad-hoc structures. If it turns out that `ServerConfigCtx` is only ever used for the schema cache build, we could split it between `CacheBuildEnv` and `CacheBuildContext`, which will be subsets of `AppEnv` and `AppContext`, avoiding import loops.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8509
GitOrigin-RevId: 01b37cc3fd3490d6b117701e22fc4ac88b62b6b5
2023-03-27 17:44:27 +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
Daniel Harvey
77d6058f3e chore(server): add basic Explain test for Logical Models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8502
GitOrigin-RevId: 7cc64139d98155b94c0aadf16f8717881ea2add6
2023-03-27 15:21:42 +00:00
Daniel Harvey
305eebb3ab feature(server): add Logical Models support for CockroachDB
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8500
GitOrigin-RevId: 0205bd207843f50ad4fa12ad6e6c07d1f2740912
2023-03-27 14:00:07 +00:00
Antoine Leblanc
dd635fbbc7 Build the first schema cache in the app monad.
### Description

This PR is one more step towards #8344: it splits `initializeContext` into two parts: the first one builds the `AppEnv`, and the second builds the `AppContext` and its corresponding `AppStateRef`. Splitting it allows us to run the first schema cache build _in the app monad_, which was one of the steps required to remove `CacheBuild`, and ultimately to achieve #8344, which in turn is a blocker for several projects.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8445
GitOrigin-RevId: 0ef9eeec0c941b915da505cc9b1c60f36b108a56
2023-03-27 10:27:25 +00:00
Daniel Chambers
8acd447803 Fix non-determinism in expected ordering in agent test suite test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8493
GitOrigin-RevId: 210b6beb991d806e9a3e4cc901ee922ede0e3c84
2023-03-27 02:22:51 +00:00
Samir Talwar
0256e1da7d nix: Switch to nixpkgs-unstable.
I am making this change for two reasons:

  * We expect to upgrade to GHC 9.2.7 imminently, which is not available on the nixos-22.11 branch.
  * We need to upgrade unixODBC, which has stagnated on nixos-22.11.

While we expect a new NixOS release in a month or two, we can't really afford to wait that long. In addition, we might need to upgrade GHC again soon after that.

I removed `hpack` because we don't actually use it any more.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8483
GitOrigin-RevId: 9a7ef1a97599a218e34dfde1ad4f6a7279d2ba0e
2023-03-24 20:36:48 +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
Brandon Martin
63eabc2374 Add dataset support to Oracle in the Super Connector
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8469
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 6f2aebc150d7c93490e6da3ada5c282dd3d9a56c
2023-03-24 14:35:30 +00:00
Tom Harding
fe140ee791 Remove Fixture.Options argument from api-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8480
GitOrigin-RevId: a6dd5c6c2cc6274b7bd1694cf1100efa48e6bdbd
2023-03-24 13:59:35 +00:00
Rakesh Emmadi
e12b12c274 server: improve schema-sync logs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8386
GitOrigin-RevId: a90a792389576dcfda493ab96aed279459c60d92
2023-03-24 09:41:36 +00:00
Antoine Leblanc
9e8c06e971 Split catalog migration and cache build, and solve the manager chicken-egg problem.
### Description

This PR is the logical continuation of #8343 and #8357, and replaces both.

One core problem that this PR addresses: we had to create temporary a `HTTP.Manager` to initialize both the OSS and the Pro app: a manager is required to build the schema cache, but the dynamic TLS allow list is read from the schema cache... This PR solves this, by introducing the `TLSAllowListRef`, based on @abooij 's idea: it allows us to create a valid `HTTP.Manager` as soon as we have the metadata list, and then update the ref at a later point to make it point to the schema cache, allowing us to only build one and only one `HTTP.Manager`.

This paves the way towards building the schema cache _in the app monad_ and deprecating `CacheBuild`. Towards this, and also to clean the code, this PR also splits the catalog migration and the first schema cache build into two distinct functions. This doesn't result in a change of behaviour, as the transaction to update the catalog would always be done before attempting to build the schema cache.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8421
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
GitOrigin-RevId: 0e0402122b4fc008c1932bccbdbadf11878e27eb
2023-03-23 16:42:53 +00:00
Antoine Leblanc
068b5e4523 Rename and clean CE app monad.
### Description

This small PR is on top of #8440. It continues the cleanup of `Hasura/App` by grouping together all instances on the app monad, renaming the app monad, and removing its `m` parameter.

See [this commit](cb6ecba3d4) to see the diff in isolation.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8441
GitOrigin-RevId: 7abb6524a160bcb4f75e729e726ce2af69643998
2023-03-23 15:52:48 +00:00
Anon Ray
14fcaafa43 server: pass a partially applied function instead of passing AppStateRef to http handlers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8464
GitOrigin-RevId: b9dff36d2c560a093a6aff669315fe4fbc18b3f6
2023-03-23 14:33:29 +00:00
pranshi06
bc75136019 pro, server: fix event trigger log cleanup regression in Postgres event triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8460
GitOrigin-RevId: 17e7b73d3b92459ff9149391ecd46ccb9a0846e5
2023-03-23 13:56:11 +00:00
Gil Mizrahi
c8c0fd200f Allow running read-only run_sql queries in read-only mode
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8409
GitOrigin-RevId: f7e92c0ba03d5b2b1d6a9d8060a49b351c56bd52
2023-03-23 13:05:02 +00:00
Daniel Harvey
e6da837dbf chore(tests): move postgres-specific queries to own Logical Model tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8462
GitOrigin-RevId: 4032a2eb6dbb63d04688747e28ad293c6963e696
2023-03-23 12:25:34 +00:00
Puru Gupta
3758b8ae26 server: consolidate schema cache and app context into a single IORef
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8370
GitOrigin-RevId: ad79849fc78ce98d060a569b2cbc3625c9588a05
2023-03-23 11:31:01 +00:00
ananya-2410
45decbeb89 ci: tag release v2.22.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8453
GitOrigin-RevId: e721250920b47b367026243b06eef3c37547bdcd
2023-03-23 06:38:09 +00:00
Antoine Leblanc
d7309b811e Partial cleanup of Hasura/App, refactor of GlobalCtx
### Description

As part of another project (the continuation of #8421), i have started a cleanup of `Hasura.App`, focusing on deleting old code and grouping together things that belong together. This quickly grew into a refactor of `GlobalCtx`, now renamed into `BasicConnectionInfo`. This small refactor adds comments, and aims at making clear what the purpose of those types and functions is.

Furthermore, it also changes the way the default postgres connection info is created, by making that part of the process of creating the `BasicConnectionInfo`, to deduplicate similar effort across different files.

This is expected to be a no-op.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8440
GitOrigin-RevId: 412c5b1905f629beb9c6cd262b9798cb31c93bdb
2023-03-22 21:41:53 +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
7e437fc32b feature(server): ordered columns in Logical Model return type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8434
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 4ebd569bef868e01b15583e4af90d583d6713da7
2023-03-22 16:35:56 +00:00
Philip Lykke Carlsen
34e40e6caf refactor: newtype alias for action checking feature flags
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8429
GitOrigin-RevId: e543b608a91e0c39c39f06b772a7d43f360d5dc3
2023-03-22 10:48:22 +00:00
Philip Lykke Carlsen
a763eeeeb2 refactor: Componentizing Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8428
GitOrigin-RevId: 8295a85b4a42dc3821d100371de1f350ed97cda3
2023-03-22 09:55:48 +00:00
pranshi06
f194c47156 server: fix value of created_at for postgres event triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8287
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: d4ae6a517da63f2f43567dc16fda135b3cd1d7e6
2023-03-22 07:32:42 +00:00
Daniel Chambers
08f05d45cf Include SQLite agent in Remote Joins HSpec API tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8382
GitOrigin-RevId: 6e264b4b3e49c1072b042b69ee256817a105c470
2023-03-22 03:30:02 +00:00
Solomon
cca1a92399 Simplify Transformable Requests Module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8400
GitOrigin-RevId: 10728012c3d74e178c34b926e13d3627d514ce17
2023-03-22 00:01:07 +00:00
Tom Harding
e3d76a8fe5 Implement logical models metadata commands for BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8415
GitOrigin-RevId: d972abb9a0763f036c8b1d58feca34967abfac5f
2023-03-21 18:47:49 +00:00
Tom Harding
dba32d91c2 Generalise logical model test return types across backends
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8411
GitOrigin-RevId: b2c2c761415ed5e6fae172d1ccdc72afb0d01574
2023-03-21 17:41:53 +00:00
Tom Harding
6651e9b60d Use DerivingStrategies in BigQuery.Types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8405
GitOrigin-RevId: ef3cd6cba009cb18e9441aabef146b060963dc65
2023-03-21 16:27:57 +00:00
Antoine Leblanc
e6b8b16478 Further remove explicit AppEnv threading in favour of askAppEnv
### Description

This PR continues some of the work done in #8392, and makes use of `HasAppEnv` to reduce the amount of explicit env passing in init functions, including removing it from the setup hook.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8408
GitOrigin-RevId: 4d6c906f78fbcc303571f9aac16d163d68b77e41
2023-03-21 15:51:30 +00:00