Commit Graph

6357 Commits

Author SHA1 Message Date
ananya-2410
36db970a34 ci: tag release v2.20.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8081
GitOrigin-RevId: 0e13f833e881a5acf648f43ce16358a13945f5c3
2023-02-23 06:52:12 +00:00
Daniel Chambers
190e429eef Add tests for delete mutations to the Data Connector agent test suite
[GDC-721]: https://hasurahq.atlassian.net/browse/GDC-721?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8067
GitOrigin-RevId: bf5b7e7c20c6011d438888be6017331def7063bf
2023-02-22 23:41:47 +00:00
Nicolas Beaussart
d2832f1067 frontend: use relative paths instead of absolute within modules
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8050
GitOrigin-RevId: 7fc12b2855d1632919613c77348119238b88ce6f
2023-02-22 16:38:45 +00:00
Antoine Leblanc
6e574f1bbe harmonize network manager handling
## Description

### I want to speak to the `Manager`

Oh boy. This PR is both fairly straightforward and overreaching, so let's break it down.

For most network access, we need a [`HTTP.Manager`](https://hackage.haskell.org/package/http-client-0.1.0.0/docs/Network-HTTP-Client-Manager.html). It is created only once, at the top level, when starting the engine, and is then threaded through the application to wherever we need to make a network call. As of main, the way we do this is not standardized: most of the GraphQL execution code passes it "manually" as a function argument throughout the code. We also have a custom monad constraint, `HasHttpManagerM`, that describes a monad's ability to provide a manager. And, finally, several parts of the code store the manager in some kind of argument structure, such as `RunT`'s `RunCtx`.

This PR's first goal is to harmonize all of this: we always create the manager at the root, and we already have it when we do our very first `runReaderT`. Wouldn't it make sense for the rest of the code to not manually pass it anywhere, to not store it anywhere, but to always rely on the current monad providing it? This is, in short, what this PR does: it implements a constraint on the base monads, so that they provide the manager, and removes most explicit passing from the code.

### First come, first served

One way this PR goes a tiny bit further than "just" doing the aforementioned harmonization is that it starts the process of implementing the "Services oriented architecture" roughly outlined in this [draft document](https://docs.google.com/document/d/1FAigqrST0juU1WcT4HIxJxe1iEBwTuBZodTaeUvsKqQ/edit?usp=sharing). Instead of using the existing `HasHTTPManagerM`, this PR revamps it into the `ProvidesNetwork` service.

The idea is, again, that we should make all "external" dependencies of the engine, all things that the core of the engine doesn't care about, a "service". This allows us to define clear APIs for features, to choose different implementations based on which version of the engine we're running, harmonizes our many scattered monadic constraints... Which is why this service is called "Network": we can refine it, moving forward, to be the constraint that defines how all network communication is to operate, instead of relying on disparate classes constraint or hardcoded decisions. A comment in the code clarifies this intent.

### Side-effects? In my Haskell?

This PR also unavoidably touches some other aspects of the codebase. One such example: it introduces `Hasura.App.AppContext`, named after `HasuraPro.Context.AppContext`: a name for the reader structure at the base level. It also transforms `Handler` from a type alias to a newtype, as `Handler` is where we actually enforce HTTP limits; but without `Handler` being a distinct type, any code path could simply do a `runExceptT $ runReader` and forget to enforce them.

(As a rule of thumb, i am starting to consider any straggling `runReaderT` or `runExceptT` as a code smell: we should not stack / unstack monads haphazardly, and every layer should be an opaque `newtype` with a corresponding run function.)

## Further work

In several places, i have left TODOs when i have encountered things that suggest that we should do further unrelated cleanups. I'll write down the follow-up steps, either in the aforementioned document or on slack. But, in short, at a glance, in approximate order, we could:

- delete `ExecutionCtx` as it is only a subset of `ServerCtx`, and remove one more `runReaderT` call
- delete `ServerConfigCtx` as it is only a subset of `ServerCtx`, and remove it from `RunCtx`
- remove `ServerCtx` from `HandlerCtx`, and make it part of `AppContext`, or even make it the `AppContext` altogether (since, at least for the OSS version, `AppContext` is there again only a subset)
- remove `CacheBuildParams` and `CacheBuild` altogether, as they're just a distinct stack that is a `ReaderT` on top of `IO` that contains, you guessed it, the same thing as `ServerCtx`
- move `RunT` out of `RQL.Types` and rename it, since after the previous cleanups **it only contains `UserInfo`**; it could be bundled with the authentication service, made a small implementation detail in `Hasura.Server.Auth`
-  rename `PGMetadaStorageT` to something a bit more accurate, such as `App`, and enforce its IO base

This would significantly simply our complex stack. From there, or in parallel, we can start moving existing dependencies as Services. For the purpose of supporting read replicas entitlement, we could move `MonadResolveSource` to a `SourceResolver` service, as attempted in #7653, and transform `UserAuthenticationM` into a `Authentication` service.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7736
GitOrigin-RevId: 68cce710eb9e7d752bda1ba0c49541d24df8209f
2023-02-22 15:55:54 +00:00
Erik Magnusson
3423e53480 console: add insert handling for permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7973
Co-authored-by: Julian@Hasura <118911427+julian-mayorga@users.noreply.github.com>
GitOrigin-RevId: 6367c6bbf66e58fe2e08caacdf3217125c29a4c7
2023-02-22 15:27:16 +00:00
Varun Choudhary
d3287e5fb3 console: filter view from event trigger while selecting table
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8073
GitOrigin-RevId: 6f47bc21c5ec9ef6f20d420bb87849c9129b98ec
2023-02-22 14:58:22 +00:00
Gil Mizrahi
625e41cd77 rename naqi to logimo part 3 - data types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8068
GitOrigin-RevId: 435527a98e645ed69c9be484ff0bd21af8181d69
2023-02-22 13:46:54 +00:00
Vijay Prasanna
983a08d296 bugfix (console): fix alignment issue in manage database section
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8072
GitOrigin-RevId: 32c1d47c044c110d47c56a2e31cc6423eb8e9f8e
2023-02-22 11:31:10 +00:00
Daniele Cammareri
a5e4141eef console: use naming convention for suggested relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8058
GitOrigin-RevId: 5a47e814478fe29e0abf47430992ec6217041659
2023-02-22 09:59:27 +00:00
Gil Mizrahi
2b0e9ea14c rename NativeQuery module hierarchy to LogicalModel
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8063
GitOrigin-RevId: 0ed0cee7fb1d77f166770caae21cc05d5dd30b75
2023-02-22 09:23:54 +00:00
Varun Choudhary
68e8091fda console: allow users to execute read only SQL queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8057
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 3685e43e52ce3c7e29b8afef52169720e26bb67c
2023-02-22 07:52:04 +00:00
Daniel Chambers
72e319e486 Add tests for update mutations to the Data Connector agent test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8054
GitOrigin-RevId: 6869e8938e7a70128770f959bf34e3a291074d14
2023-02-22 04:19:16 +00:00
Nicolas Beaussart
7dfd2d60f9 frontend: rework import between ce and ee libs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8034
GitOrigin-RevId: 317eeaccea1318451cc14b4c94086cb54720dd33
2023-02-21 14:56:41 +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
Samir Talwar
bb881c2b84 docs: Add a documentation page for BigQuery views.
This adds documentation for tracking and querying a BigQuery view. I simply copied the PostgreSQL documentation, then verified it all worked.

I had to make a few changes, of course:

1. the links point to BigQuery documentation
2. the metadata calls reference `bigquery_track_table`
3. the `text` datatype has been changed to `string`

I also renumbered the pages to match the PostgreSQL section.

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

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8052
GitOrigin-RevId: 2989bdf31ce768cb96c05b2258452789a61b4285
2023-02-21 12:28:17 +00:00
Krushan Bauva
2b1d5be10a server: catch TimeoutThread and InvalidRequest exceptions in websocket connections
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8014
GitOrigin-RevId: eef2d1ce99ec87bb239584c3ca4a9f056131b5cc
2023-02-21 11:55:54 +00:00
Nicolas Beaussart
782c905bf4 ci: setup nx cache
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7916
GitOrigin-RevId: 1949c1f225693c4c8a8d447edd155ae44ead3b72
2023-02-21 11:05:29 +00:00
Rikin Kachhia
c402edee02 console: do not hide one-click-deploy error box till retried step is reached
[GT-497]: https://hasurahq.atlassian.net/browse/GT-497?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7969
GitOrigin-RevId: b99544359fc15b83261f7cc790421b7fea5513ff
2023-02-21 10:24:44 +00:00
Rakesh Emmadi
39f3e90be8 server: accept "strict" param in healthz API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8009
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: f535a84dc8aa35f60aaeab15ec5b54ba6f80ef6b
2023-02-21 09:13:44 +00:00
Rikin Kachhia
c652fa547b console: add env vars page link in one-click-deploy in case of database connection error
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8033
GitOrigin-RevId: d72923eb12d6edb860efe43b93d6b4a7e78c4805
2023-02-21 08:37:07 +00:00
Jesse Hallett
37100138b6 server: codecs for rest endpoint definitions in metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8030
GitOrigin-RevId: 0980502c535ab308e2458a98cebfd166fa55f8b6
2023-02-20 18:37:55 +00:00
Philip Lykke Carlsen
e979a39f6d chore: Fix all outstanding hlint hints
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8042
GitOrigin-RevId: 87c718fa7b09f375ea0e7c2465788ac49f575290
2023-02-20 17:43:28 +00:00
Jesse Hallett
99a982d4dd server: codecs for the metadata Action type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7898
GitOrigin-RevId: 4211854f656ab02bb058b2d0831637477b3d4767
2023-02-20 17:10:19 +00:00
Daniele Cammareri
cad96fbbfb doc: import from openapi milestone 2 documentation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8031
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: c0d146c6bb95e71eccc80e68857fabebc44abf57
2023-02-20 14:25:24 +00:00
paritosh-08
17c3d25b1b server: warning in replace_metadata API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7575
GitOrigin-RevId: 0171514056f725cb7a86dc7856eb57c674937c83
2023-02-20 14:20:38 +00:00
Philip Lykke Carlsen
384bb1b9d4 refactor(server): Add HLint rules discouraging getEnvironment
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7959
GitOrigin-RevId: c3189553a7f419a46510463dad7985f2953ef3c3
2023-02-20 13:45:24 +00:00
Daniel Harvey
2720f0a25a chore(server): store Native Queries as ordered map
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8027
GitOrigin-RevId: bfcf4001d82970e25e0a85e6cd720b2b3a52a5be
2023-02-20 11:48:16 +00:00
Daniele Cammareri
47fc7f846f console: Import from OpenAPI beta
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7768
GitOrigin-RevId: 49eeaa8feba212dce7f505ebe567672616e1383c
2023-02-20 10:42:23 +00:00
Jesse Hallett
8640346b4f server: codecs for cron triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8029
GitOrigin-RevId: c26308782618c760921a0eff3e4bd87702bd3eb2
2023-02-20 02:52:00 +00:00
Mohd Bilal
54125f2ae6 cli: Update docs for hasura metadata reload and hasura migrate create
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7338
GitOrigin-RevId: 35aeca6704d802c2e09903395335641704e61186
2023-02-18 06:12:08 +00:00
Solomon
316c2cc4e1 Remove suffix from source kind display name
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7788
GitOrigin-RevId: 17eea4c8de746daab120d8bd1e7fce43ac6618bf
2023-02-17 23:18:54 +00:00
Erik Magnusson
904a15a446 console: gdc permissions bug fixes
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8013
GitOrigin-RevId: c0d1040d24808050e86583b3f23b6f92545bff7a
2023-02-17 14:35:36 +00:00
Rob Dominguez
8d0e4a2a50 docs: modify feedback component
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8020
GitOrigin-RevId: 3f32bbb63c8fba3a285d0b0174321f64b6674004
2023-02-17 14:02:57 +00:00
Gil Mizrahi
0054a6feca add basic naqi telemetry
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8026
GitOrigin-RevId: d82fa3ce10a40b9f8ead0e40400295a17eb66d25
2023-02-17 13:58:48 +00:00
Gil Mizrahi
f57786a22d remove .ToSource.hs.swp
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8025
GitOrigin-RevId: d041fa09cf2faacb12a4b5e3bdd238fdde8d1957
2023-02-17 10:19:38 +00:00
Nicolas Inchauspe
ea5a50bdda console: fix header notification count position
[PLAT-451]: https://hasurahq.atlassian.net/browse/PLAT-451?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8017
GitOrigin-RevId: 4fbe52879ecb61a43a78be4e7473b919bd2c361c
2023-02-17 08:14:17 +00:00
Varun Choudhary
77ed947701 console: update the cron and scheduled events webhook placeholder
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8023
GitOrigin-RevId: da1f29dc426bf7f77a8c05be196cea8586a5f4ba
2023-02-17 07:40:07 +00:00
Vijay Prasanna
50627a3af2 feature (console): add GDC connect DB widget
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7893
Co-authored-by: Matthew Goodwin <49927862+m4ttheweric@users.noreply.github.com>
GitOrigin-RevId: c0b5fa4b89a83b953781f78025e7da9c29843c74
2023-02-17 05:33:19 +00:00
Solomon
fd0ba0013d Adds Agent availability check to dc_add_agent metadata action
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7792
GitOrigin-RevId: 5ba1669b27078a45a4efe2ba736908a4929a2a50
2023-02-17 01:30:51 +00:00
Samir Talwar
d1ddf27159 packaging/cli-migrations: Clean up curl containers.
We don't want to leave these curl containers lying around.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8002
GitOrigin-RevId: 5ceabc1cbe0a07fe4831b4752b6f71e79444a346
2023-02-16 19:56:10 +00:00
Vijay Prasanna
b72173c8cb fix (console): remove latency check after adding GDC source
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8006
GitOrigin-RevId: 46e37de155a80486868315fe197a3900ce85b761
2023-02-16 13:50:24 +00:00
Sean Park-Ross
374eb27902 Docs: Update FAQ GraphQL Answer
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8000
GitOrigin-RevId: f03d9836706885e4fa20a032e8c7ec3a759848a4
2023-02-16 12:39:05 +00:00
Philip Lykke Carlsen
ecd0e7c3f4 fix, Sql Server: Properly quote delimited identifiers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7929
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 4ed630dcf6851a92980571c8041273512c69c622
2023-02-16 11:20:11 +00:00
Rikin Kachhia
2e57bfe0ea console: send telemetry event on feature flag enable/disable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7948
GitOrigin-RevId: 0dbb12e0bd291249f447ac58968b63c960630c49
2023-02-16 10:45:41 +00:00
Varun Choudhary
fc40739f62 console: unify webhook handler UX for action, remote schemas and events
[GS-397]: https://hasurahq.atlassian.net/browse/GS-397?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7796
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: 620aea50e7d1b45835a5996246f46017b2ba5904
2023-02-16 10:14:35 +00:00
Daniel Chambers
ac475fa02e Added weird table edge-case insert mutation tests to agent test suite
[GDC-719]: https://hasurahq.atlassian.net/browse/GDC-719?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7964
GitOrigin-RevId: d3077aafd29f3b5553e00bf6bba4c1ff9966485d
2023-02-16 07:51:36 +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
Shraddha Agrawal
b7c71468ae docs: update entitlements access for cloud new free
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7998
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: 02b6c6f2c26f964e4d39a756dab7fb3f70e85f65
2023-02-15 21:11:54 +00:00
Jesse Hallett
b235e94e28 ci: fix an error in a recently-added buildkite test script
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8001
GitOrigin-RevId: 12f7d66772eb6d9b011b7a77a85544ffeb6ec270
2023-02-15 21:07:52 +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