Commit Graph

2810 Commits

Author SHA1 Message Date
Tom Harding
3cef692dd7 feature(server): Get _all_ source tables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8649
GitOrigin-RevId: 4bb9311d1d7ab4e8ee641bde5df2babcb1b8b306
2023-04-05 20:16:14 +00:00
Philip Lykke Carlsen
41a5092b97 refactor(tests): Support componentised Postgres fixtures, port SimpleObjectSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8607
GitOrigin-RevId: b068f7308fa8fa4b626aa2f9352da3965b03fa34
2023-04-05 18:05:37 +00:00
Vishnu Bharathi
60afce2b94 ci: tag release v2.23.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8641
GitOrigin-RevId: e4395099602829a41d66c47e2c821b7a8912acef
2023-04-05 12:27:36 +00:00
Antoine Leblanc
d00f4ef497 Always flush the loggers without explicitly relying on onException
### Description

This PR makes use of the fact that the `LoggerSet` is created in a `ManagedT` context to guarantee that we flush it when the `ManagedT` context terminates, which is guaranteed even when an exception is thrown since `allocate` is implemented using `bracket`.

This allows us to remove several manual calls to `flip onException flushLoggers`, and avoids having to manually perform that check everywhere.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8629
GitOrigin-RevId: 47657b910dc1bb7cfc0594f02e6cce9893ae3439
2023-04-05 11:07:14 +00:00
Rishichandra Wawhal
c6d65508b2 [feature branch] EE Lite Trials
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8208
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
Co-authored-by: gneeri <10553562+gneeri@users.noreply.github.com>
GitOrigin-RevId: 454ee0dea636da77e43810edb2f427137027956c
2023-04-05 08:59:09 +00:00
Daniel Chambers
fde4c0fae5 Enhance insert table schema with extra info and remove need for cached schema usage in Super Connector mutations
[GDC-643]: https://hasurahq.atlassian.net/browse/GDC-643?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8560
GitOrigin-RevId: 0e965da447eb6a5acf5a0f291f9e205882630e6e
2023-04-05 02:23:20 +00:00
Antoine Leblanc
e6a8bcb1c9 Make flag value a part of the cache's dynamic config.
### Description

If i understand correctly, the _value_ of a feature flag **can** change at runtime. Since this has an impact on how the schema cache is built, this PR makes the value of the flag a part of the cache's "dynamic" config, therefore making it an arrow-ish argument for the incremental framework. It also removes `CheckFeatureFlag` from the static config, now obsolete.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8631
GitOrigin-RevId: 2ca898e4193e8552c40d2b21a819d3dd414601fe
2023-04-04 19:39:39 +00:00
Antoine Leblanc
306162f477 Remove ServerConfigCtx.
### Description

This PR removes `ServerConfigCtx` and `HasServerConfigCtx`. Instead, it favours different approaches:
- when the code was only using one field, it passes that field explicitly (usually `SQLGenCtx` or `CheckFeatureFlag`)
- when the code was using several fields, but in only one function, it inlines
- for the cache build, it introduces `CacheStaticConfig` and `CacheDynamicConfig`, which are subsets of `AppEnv` and `AppContext` respectively

The main goal of this is to help with the modularization of the engine: as `ServerConfigCtx` had fields whose types were imported from several unrelated parts of the engine, using it tied together parts of the engine that should not be aware of one another (such as tying together `Hasura.LogicalModel` and `Hasura.GraphQL.Schema`).

The bulk of this PR is a change to the cache build, as a follow up to #8509: instead of giving the entire `ServerConfigCtx` as a incremental rule argument, we only give the new `CacheDynamicConfig` struct, which has fewer fields. The other required fields, that were coming from the `AppEnv`, are now given via the `HasCacheStaticConfig` constraint, which is a "subset" of `HasAppEnv`.

(Some further work could include moving `StringifyNumbers` out of `GraphQL.Schema.Options`, given how it is used all across the codebase, including in `RQL.DML`.)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8513
GitOrigin-RevId: 818cbcd71494e3cd946b06adbb02ca328a8a298e
2023-04-04 16:01:42 +00:00
Tom Harding
794690f30c Implement get_source_tables command for all backends
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8619
GitOrigin-RevId: 5e1b2c11775d801a77dc6d92de4c5abc1c9b8c60
2023-04-04 15:27:19 +00:00
Gil Mizrahi
352d8ff09c validate logical models custom return type against postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8563
GitOrigin-RevId: 462a608e0e90d1923bc1d735257f4506825f5db1
2023-04-04 14:02:59 +00:00
Puru Gupta
8a6a8459ab server: zero-downtime env vars update on cloud
[GS-232]: https://hasurahq.atlassian.net/browse/GS-232?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8475
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
GitOrigin-RevId: fb47f02f4e0d6d889c0348abc50fd46382f1bd5e
2023-04-04 13:26:21 +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
Antoine Leblanc
0177510b8f Fix haskell error in example code block
Fix trivial error in documentation.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8620
GitOrigin-RevId: 1b8410ae213b1e5f0954bdf4e957d29f1a668696
2023-04-04 11:28:35 +00:00
Antoine Leblanc
e9ae080d28 Add ManagedT deep dive.
### Description

This small documentation PR explains why and how we use `ManagedT`, and how it solves problems we would have with `Managed`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8615
GitOrigin-RevId: 5b7710a8cb6373fefb69bb4e9e8eda389c14c2da
2023-04-04 10:34:58 +00:00
Tom Harding
4854d3ca21 Add extremely basic support for BigQuery JSON fields
[NDAT-501]: https://hasurahq.atlassian.net/browse/NDAT-501?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8614
GitOrigin-RevId: 24530130499174a1a02e0fb4510859fcfeed207d
2023-04-04 09:45:17 +00:00
Philip Lykke Carlsen
df12c7cf46 fix(api-tests): Ensure the test runner runs the logger cleanup function.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8602
GitOrigin-RevId: 7e07b8b0556a22edf4e058e23ff020cc5e8528f6
2023-04-04 09:01:44 +00:00
pranshi06
e6c8abf7d4 server: add connection_template as an argument in pg_test_connection_template API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8520
GitOrigin-RevId: 525bba9015ad4e143e94124e42ec4518252932cb
2023-04-03 14:27:12 +00:00
Auke Booij
7cc33dd8ec server: refactor Hasura.Metadata.Class
- Remove `MonadMetadataStorageQueryAPI` which was only implemented by a default implementation
- Introduce `TransT` which can be used to easily derive `lift`ing implementations for `MonadBlaBlaBla` classes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8579
GitOrigin-RevId: 4f804fda7e2de5c9d75ee4df269f500ebd46b8c9
2023-04-03 13:36:50 +00:00
Gil Mizrahi
ed4f3b7406 feature(server): CockroachDB now supports distinct. Document and test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8596
GitOrigin-RevId: 3dbc5fccb1d4387041a5a80794158c4f50b70848
2023-04-03 11:51:22 +00:00
Daniel Harvey
cb9f822fc0 chore(server): move user-defined-functions into Hasura.Function.*
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8595
GitOrigin-RevId: b3b7dec8504fe4daf324125e4017fa7d1945b3ca
2023-04-03 10:20:20 +00:00
Tom Harding
7e06b30e4d Add metadata commands for custom return type permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8587
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 660f2eda9cf1c7c612d66745064b3998c77804e0
2023-03-31 16:29:24 +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
Auke Booij
79b8a6a07b chore(server): move some query tags code to a sensible place
Also add a `default` implementation for `MonadQueryTags`.

This avoids a bunch of imports on `Hasura.GraphQL.Execute.Backend` which is a big module with lots of (transitive) dependencies.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8571
GitOrigin-RevId: 8ecca452721b77953e6d088c79d8d6f003f2996f
2023-03-30 21:19:38 +00:00
Jesse Hallett
b5ac49d1b5 server: codec for dataconnector ConnSourceConfig
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8271
GitOrigin-RevId: b5aaa86a5e453fecb1e88c2afb223857e50c8b7d
2023-03-30 18:37:51 +00:00
Daniel Harvey
4905dc1675 chore(tests): pass BigQuery service account env var through to HGE
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8532
GitOrigin-RevId: 68e4c846e23369f476fa672b987d6769fad43cbf
2023-03-30 17:59:01 +00:00
Anon Ray
5a81eaa9b6 server: core changes for zero-downtime env vars update on cloud
[GS-232]: https://hasurahq.atlassian.net/browse/GS-232?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7207
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
GitOrigin-RevId: 90a771036da5275cd277f3daaf410381955c69de
2023-03-30 16:33:39 +00:00
Jesse Hallett
bd9f93eaef server: codecs for backend configs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8269
GitOrigin-RevId: 34330f383ca82fb159842a171a763c178b462788
2023-03-30 15:53:55 +00:00
Daniel Harvey
7227e96278 feature(server): custom return types as discreet metadata entity
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8556
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: b7dcbcf378279c3bf4c8d223174b90c2cb4b9e53
2023-03-30 15:15:11 +00:00
Auke Booij
cfd33e0dba ci(server): fix hlint ignore pragmas
Some fixes as a followup to #8311. In particular, some pragmas were referring to a now-nonexistent hlint rule.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8569
GitOrigin-RevId: 2a180427b3e93a71c47569ff10b6c8b6b407f7a2
2023-03-30 14:31:59 +00:00
hasura-bot
22d9b54eae Support _is_null operator in MSSQL permissions. fix #8479
GITHUB_PR_NUMBER: 9414
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/9414

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7800
Co-authored-by: Nakano as a Service <20109935+NKNaaS@users.noreply.github.com>
GitOrigin-RevId: 9a409bd023a21cbc43c13f028d088bde7a21c62f
2023-03-30 13:46:49 +00:00
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