Commit Graph

4776 Commits

Author SHA1 Message Date
Daniel Harvey
7bb5c2760a tests: convert DataConnector hspec tests from Context -> Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5388
GitOrigin-RevId: d645b360cd6f471c4bcaa18842cb2de2dc7a04d8
2022-08-10 07:54:26 +00:00
Lyndon Maydwell
4b86dfa4ad Adding metrics endpoint to SQLite Data Connector Agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5418
GitOrigin-RevId: 28f3b3e14f610ca6b880711d03cf01486413d5ab
2022-08-10 06:38:07 +00:00
Gil Mizrahi
e1d0fbe0ff Fix querying multicolumn relationship in bigquery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5407
GitOrigin-RevId: 21517278991a54a0f06231a10b36b7b69e352608
2022-08-09 18:40:39 +00:00
Rob Dominguez
f132524fed docs: update heroku admonition to link to gh issue
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5398
GitOrigin-RevId: 03f29984071631538a0b005c4503b315c8ab33ed
2022-08-09 12:32:17 +00:00
Divi
ddbfcf5aa3 ci: use pro image as base image for pro cli migration images
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5027
GitOrigin-RevId: 0e5aec72331e06e7a529f65814bb61f92c76e2a3
2022-08-09 12:11:30 +00:00
Karthikeyan Chinnakonda
66caae4a44 server: accept schema name as a target for the graphql-engine to install DB extensions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5362
GitOrigin-RevId: 5e246c3af3bdf2a7b5b2a66e2e09f40abcdfd9c9
2022-08-09 11:43:48 +00:00
Tom Harding
d26b16106f Migrate ViewsSpec to the new structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5337
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: c1056790b42039630d649c96ad7aa2aa5c691ecf
2022-08-09 11:16:30 +00:00
hasura-bot
08e5b815cb [security] Update Debian base image to debian:buster-20220711-slim
GITHUB_PR_NUMBER: 8737
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8737

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5302
Co-authored-by: Andrew Louis <996681+andrewlouis93@users.noreply.github.com>
GitOrigin-RevId: 4b1569ae8c543c49ccb0b6a283b4b20e3c9fe293
2022-08-09 10:45:25 +00:00
Daniel Harvey
f3aefc8418 tests: expose SchemaName from Harness.Test.Schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5389
GitOrigin-RevId: fae69b4f49068bd05d6799f62d56b58bcbb96d06
2022-08-09 09:34:56 +00:00
Luca Restagno
a7fb4b9853 console: upgrade tailwind css to the latest version 3.1.7 (CON-416)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5377
GitOrigin-RevId: 57c945fb6cbcc1998c492b4f1a7196ef05f4e23e
2022-08-09 09:05:29 +00:00
Daniel Harvey
bcd7c01161 tests: Convert more Context -> Fixture in hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5384
GitOrigin-RevId: 582583b1722bb9942eda96c6b418eff8a69921d5
2022-08-09 08:21:23 +00:00
Tom Harding
0460d7d6d1 Migrate CustomFieldNamesSpec to the new structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5323
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 612cb72edf61227d8315102cb22eaaa603405b86
2022-08-09 07:26:14 +00:00
Rob Dominguez
796a977950 docs: add admonition for heroku integration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5387
GitOrigin-RevId: 8d33059dc828930bd91c57e8a6be36f3ae0b6bae
2022-08-08 18:42:34 +00:00
Rob Dominguez
7823921214 docs: update first columns to fixed width
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5381
GitOrigin-RevId: 2e4330d6dc5d75bd36d6ac2d9131d993fb38e14c
2022-08-08 16:10:07 +00:00
Vijay Prasanna
5f88a183f5 feature (console): add DAL method to fetch columns for a particular table
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5349
GitOrigin-RevId: 653c48b75ccc4cf94aee3dae97e92ac4c8fd3180
2022-08-08 15:34:12 +00:00
Daniel Harvey
744c03a84e tests: create BigQuery datasets for each test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5288
GitOrigin-RevId: 7caedacd280fc6f8ea71af16397bb2c9641effc8
2022-08-08 14:29:51 +00:00
Antoine Leblanc
6c14a018e4 Run the reader context per schema block
### Description

This PR is a first step towards having a dedicated reader context per schema block. It adds the required Reader instance, and switches from a `SchemaT ReaderT` stack to a `ReaderT SchemaT` stack. Furthermore, it cleans up / harmonizes some of the top-level schema building functions.

Sources and remotes are now built each within their own run of `runReaderT`: for now, the reader context is the same in both cases, meaning no special care is required at the boundary of remote relationships.

Actions are explicitly run with the source context for now; we could envision creating a third and distinct context for them.

This PR is expected to be a no-op.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5300
GitOrigin-RevId: a014e5b3504eb4ef740c820d305d6d2695f622f7
2022-08-08 13:05:51 +00:00
Tom Harding
70f5b04ea2 Update InsertVarcharColumnSpec test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5353
GitOrigin-RevId: 74f6e0a9322aa8926a162f8cfaae112669003f0b
2022-08-08 12:21:21 +00:00
Tom Harding
59d5853a95 Move EnumSpec into the Schema directory
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5324
GitOrigin-RevId: 50aa48c1ef42ee73b76742ab934ab90c5153b855
2022-08-08 10:56:35 +00:00
Vijay Prasanna
fdb3748a96 fix (console/relationships): add forward compatiblity for DB-to-RS for old relationship UI
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5313
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: daab28a164375125dd251cbaa9d3d8fb2147a260
2022-08-08 09:54:55 +00:00
Matt Hardman
451ed44f36 console: storybook create dynamic form component for gdc configuration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5331
GitOrigin-RevId: a08167d63d389456b4bc1757fe665f5811bc89cb
2022-08-08 09:17:38 +00:00
Vijay Prasanna
1bd1cc45eb refactor (console/gdc): clean up the hierarchy abstraction for nav tree
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5328
GitOrigin-RevId: 4386bddbe6ede0e3dd2b78eb92b2bf6af5fbb7d6
2022-08-08 06:06:43 +00:00
awjchen
edc29ce0d4 tooling: Add make ghcid-library-pro command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5344
GitOrigin-RevId: cf20d7654b26933e8fba870e4ec9750785bb1506
2022-08-06 00:52:17 +00:00
Evie Ciobanu
72cfb7fc9b server/nada: test mkUpdateCTE
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5341
GitOrigin-RevId: 39db14cc2d2329d8cadb7a6080b1e2361eba1fb5
2022-08-05 21:42:19 +00:00
Nicolas Beaussart
79d9be5669 frontend: initial nx generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5355
GitOrigin-RevId: b54bb378389ab4fae1fdf6b5a5cc97d1fd6abaf9
2022-08-05 18:53:54 +00:00
hasura-bot
11b46d2f49 Add warning about ordering of keys in order_by object
GITHUB_PR_NUMBER: 8753
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8753

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5366
Co-authored-by: Benoit Ranque <25712958+BenoitRanque@users.noreply.github.com>
GitOrigin-RevId: 2025193c9fd962cb3c6f14a1b87651c079ec0b08
2022-08-05 18:21:08 +00:00
Chris Martin
0a8662ca1c Update lux-2.0.8.tgz references to lux-2.0.13.tgz
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5357
GitOrigin-RevId: ff1ac904170d8db8b12f3e277bd58f80f8b19280
2022-08-05 17:53:49 +00:00
Rob Dominguez
b6cf8205b1 Docs: Updates env vars page (closes #4418 & closes #4669)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5161
GitOrigin-RevId: 3bce830e283aa3c84044851be41e3c0db2f43e8b
2022-08-05 16:54:13 +00:00
Philip Lykke Carlsen
13113a5387 Reformat instance declarations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5332
GitOrigin-RevId: 58b40e445dc0eac5e15efa725eaee128989aeeb5
2022-08-05 15:29:01 +00:00
Samir Talwar
aa18f65217 server: Move the schema parsers to their own library.
It's about time.

To do this I had to check a few more boxes.

* I copied the flags from `graphql-engine.cabal` to the libraries in `server/lib`.
* I moved `Cacheable` instances of schema parser types beside the typeclass declaration.
* I removed imports of `Hasura.Prelude` from the tests, and rewrote them accordingly.
* I copied the `TestMonad` parse monad into `server/src-test/Hasura/GraphQL/Schema/RemoteTest.hs`, which was using it. I think this could be done with the real thing, but I tried replacing it with constraints and it messed with my head somewhat.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5311
GitOrigin-RevId: ebebcc50a16f2d517b7f730fe72410827ca3e86c
2022-08-05 13:53:39 +00:00
Tom Harding
a61741fbf5 Migrate the GatheringUniqueConstraintsSpec test to the new structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5350
GitOrigin-RevId: ae622a859af4c308daf1aacc2825657ec7f0f8ab
2022-08-05 12:22:57 +00:00
Puru Gupta
2ca81b37e8 multitenant: fix dubious config status updates during tenant start
## Description ✍️
This PR fixes the config status update when the `Service configured successfully` message is written before the server is actually spawned. Now the status is updated only when the server is spawned successfully. To be specific, this change posts the status closer to where we log `starting API server`.

### Related Issues ✍
#2751

### Solution and Design ✍
We update the status inside `runHGEServer` function. This helps in adding the message only when the server is started. If any exception is thrown before the server is spawned, only that message is written to `config_status` table instead of the `Service configured successfully` message.

## Affected components ✍️

-  Server

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5179
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: 7860008403aa0645583e26915f620b66a5bbc531
2022-08-05 11:51:13 +00:00
Daniel Harvey
6f5416db3e tests: move yaml expectations out of yaml quoter file
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5295
GitOrigin-RevId: 66239be3f2b7c83721af174dc72a1e0796211842
2022-08-05 09:36:03 +00:00
Erik Magnusson
61ccf968b9 feature (console): disable query and subscription root fields
## Description 🔖

Adding root field level section for permissions for select and subscriptions.
One can choose specific root permissions per role that can be enabled or disabled. This is done on a role basis.

By default the permissions does not exist. When this is the case, all permission are enabled per default.
Once a permission has been tampered with, the permissions work as expected by the ui.

## Related Issues 👾

Jira issue: https://hasurahq.atlassian.net/browse/CON-259

## Solution and Design 🎨

Feature showcase video recording: https://app.iterspace.com/recording/6faa1c87-fd17-450b-ac57-3a788bfcc6e4

The solution is made in our legacy part of the Data -> Permissions-tab. The section is going to be migrated in a short future.

### Steps to test

- go to Data tab -> any table -> Permissions tab
- create and edit roles by playing around with the new "Root fields permissions" section

## Known issues
The vertical alignment of the "Don't ask me again" is not the expected one.
It is due to the current `Checkbox` component that includes a label and an error message div, that is not needed in this use case.

As discussed with @nicoinch I could refactor the current `Checkbox` component into a `FormCheckbox` component, make a new atom component `Checkbox` with the input and right label only, and use it inside the `FormCheckbox`.

This will be done on another card ([CON-415](https://hasurahq.atlassian.net/browse/CON-415))

![image](https://user-images.githubusercontent.com/59067245/181784002-19b07ff2-5eb4-4867-92d8-4d2e51afbeb3.png)

### Typescript & State management

- [x] Migrate modified JS files to TS

### Pro console
- [x] Pro console build has been verified. If this check is not relevant, please remove this line.

## Changelog ✍️

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4873
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Luca Restagno <59067245+lucarestagno@users.noreply.github.com>
GitOrigin-RevId: 51aa05af3c4de4dea957e7a12aaf4108e797d3ba
2022-08-05 08:53:11 +00:00
Lyndon Maydwell
fc907201a0 Sqlite reference agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5263
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: fb5cf3cb80ab59cd5ee0d064e3f776c062856aa3
2022-08-05 07:12:51 +00:00
Anon Ray
162e51c668 multitenant: refactor config status updates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4383
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
GitOrigin-RevId: f1e376d0b7ef8a64fb7f8bc38e8b764350f054ac
2022-08-05 06:31:07 +00:00
awjchen
66a9c6b045 pro-server: document Prometheus metrics via help text
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5345
GitOrigin-RevId: 7f0f4ba787393deb4b2c631ffdb7aaa89d4df8a4
2022-08-05 05:50:55 +00:00
Solomon
07e4a49e5e Consolidate Arg/Env Parser Defaults and cleanup arg merging code
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5262
GitOrigin-RevId: 2501e44a8fe0a57b13141c307d2dd44b028052b6
2022-08-05 00:29:52 +00:00
Rob Dominguez
0016216cd3 Docs: update GCP PG connection string
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5298
GitOrigin-RevId: bbbc0220ab967c5baaa47daf17c6cfb6b544d320
2022-08-04 20:32:33 +00:00
Tom Harding
d8a4f2cf9b Update HelloWorldSpec to reflect the usual test structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5325
GitOrigin-RevId: 85b5aabcdf9fbca51d31eaa36e8a81dfac0a40d1
2022-08-04 14:34:28 +00:00
Auke Booij
1007ea27ae server: refactor MonadSchema into MonadMemoize
Followup to hasura/graphql-engine-mono#4713.

The `memoizeOn` method, part of `MonadSchema`, originally had the following type:
```haskell
  memoizeOn
    :: (HasCallStack, Ord a, Typeable a, Typeable b, Typeable k)
    => TH.Name
    -> a
    -> m (Parser k n b)
    -> m (Parser k n b)
```
The reason for operating on `Parser`s specifically was that the `MonadSchema` effect would additionally initialize certain `Unique` values, which appear (nested in) the type of `Parser`.

hasura/graphql-engine-mono#518 changed the type of `memoizeOn`, to additionally allow memoizing `FieldParser`s. These also contained a `Unique` value, which was similarly initialized by the `MonadSchema` effect. The new type of `memoizeOn` was as follows:
```haskell
  memoizeOn
    :: forall p d a b
     . (HasCallStack, HasDefinition (p n b) d, Ord a, Typeable p, Typeable a, Typeable b)
    => TH.Name
    -> a
    -> m (p n b)
    -> m (p n b)
```

Note the type `p n b` of the value being memoized: by choosing `p` to be either `Parser k` or `FieldParser`, both can be memoized. Also note the new `HasDefinition (p n b) d` constraint, which provided a `Lens` for accessing the `Unique` value to be initialized.

A quick simplification is that the `HasCallStack` constraint has never been used by any code. This was realized in hasura/graphql-engine-mono#4713, by removing that constraint.

hasura/graphql-engine-mono#2980 removed the `Unique` value from our GraphQL-related types entirely, as their original purpose was never truly realized. One part of removing `Unique` consisted of dropping the `HasDefinition (p n b) d` constraint from `memoizeOn`.

What I didn't realize at the time was that this meant that the type of `memoizeOn` could be generalized and simplified much further. This PR finally implements that generalization. The new type is as follows:
```haskell
  memoizeOn ::
    forall a p.
    (Ord a, Typeable a, Typeable p) =>
    TH.Name ->
    a ->
    m p ->
    m p
```

This change has a couple of consequences.

1. While constructing the schema, we often output `Maybe (Parser ...)`, to model that the existence of certain pieces of GraphQL schema sometimes depends on the permissions that a certain role has. The previous versions of `memoizeOn` were not able to handle this, as the only thing they could memoize was fully-defined (if not yet fully-evaluated) `(Field)Parser`s. This much more general API _would_ allow memoizing `Maybe (Parser ...)`s. However, we probably have to be continue being cautious with this: if we blindly memoize all `Maybe (Parser ...)`s, the resulting code may never be able to decide whether the value is `Just` or `Nothing` - i.e. it never commits to the existence-or-not of a GraphQL schema fragment. This would manifest as a non-well-founded knot tying, and this would get reported as an error by the implementation of `memoizeOn`.

   tl;dr: This generalization _technically_ allows for memoizing `Maybe` values, but we probably still want to avoid doing so.

   For this reason, the PR adds a specialized version of `memoizeOn` to `Hasura.GraphQL.Schema.Parser`.
2. There is no longer any need to connect the `MonadSchema` knot-tying effect with the `MonadParse` effect. In fact, after this PR, the `memoizeOn` method is completely GraphQL-agnostic, and so we implement hasura/graphql-engine-mono#4726, separating `memoizeOn` from `MonadParse` entirely - `memoizeOn` can be defined and implemented as a general Haskell typeclass method.

   Since `MonadSchema` has been made into a single-type-parameter type class, it has been renamed to something more general, namely `MonadMemoize`. Its only task is to memoize arbitrary `Typeable p` objects under a combined key consisting of a `TH.Name` and a `Typeable a`.

   Also for this reason, the new `MonadMemoize` has been moved to the more general `Control.Monad.Memoize`.
3. After this change, it's somewhat clearer what `memoizeOn` does: it memoizes an arbitrary value of a `Typeable` type. The only thing that needs to be understood in its implementation is how the manual blackholing works. There is no more semantic interaction with _any_ GraphQL code.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4725
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 089fa2e82c2ce29da76850e994eabb1e261f9c92
2022-08-04 13:45:53 +00:00
Luca Restagno
1f7eed1bc5 console: fix row-level permission restrictions with boolean fields for bigquery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5322
GitOrigin-RevId: 3609585c4cf735aeb98747a5b701bfaa88cb46ba
2022-08-04 11:22:41 +00:00
Samir Talwar
c0a0a5fe87 docker: Mount database data directories as named volumes.
I'm trying to shore up the Python integration tests to make them more reliable. In doing so, I noticed this.

---

This ensures that the data directories are always in a mutable file system, and not going through overlayfs.

In my testing, this sped up PostgreSQL database initialization a lot. In particular, `CREATE DATABASE` commands went from > 5s to < 0.1s.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5248
GitOrigin-RevId: 5104aea32c92559c323803020d727bebfdafb8e6
2022-08-04 10:11:10 +00:00
paritosh-08
f6067cb977 server/console: add metadata API set_apollo_federation_config
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5294
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 274d76ff92970ecffa43943125313ba84b07c495
2022-08-04 09:38:02 +00:00
Gil Mizrahi
52c1e9b0a8 Prefix the string md5_ to md5 renames
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5231
GitOrigin-RevId: 6e628a82b889dbc04e93dc5461adb302424c332c
2022-08-04 09:06:33 +00:00
Daniel Chambers
c209b60239 server: Support the namespacing of table names in Data Connectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5329
GitOrigin-RevId: 5cf492bc2b09fef6250f4dd50f74f750f55ebe6a
2022-08-04 08:35:52 +00:00
Tom Harding
bbafd0339c Add the HelloWorldSpec link back in the README
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5326
GitOrigin-RevId: 567c852117f5873f948c2cbbb7b62e467ceba171
2022-08-04 07:17:25 +00:00
Solomon
ca1bb1d745 Resolve a variety of smaller TODOs in the OSS Arg/Env Parser
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5303
GitOrigin-RevId: f45cf4b828c31d918ed16f5de19d9880bf8a5579
2022-08-04 03:23:30 +00:00
Solomon
24932c0d56 Monomorphize AuthHookG
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5279
GitOrigin-RevId: a54d23ca96c3178f134ad8be271645775fe3edd4
2022-08-04 02:25:41 +00:00
Daniel Chambers
b24b12b2e6 server: Improve test failure error message in Data Connector agent test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5304
GitOrigin-RevId: 8238c1b59c378b7fe37ae0c9afecbf04f8841e2e
2022-08-04 01:02:22 +00:00