Commit Graph

4797 Commits

Author SHA1 Message Date
Evie Ciobanu
80cbf3ae33 server/nada: add unit test infrastructure for Postgres delete SQL generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5434
GitOrigin-RevId: 839a45a1469272def9d28c0f3e7454a5bf506f35
2022-08-11 10:46:49 +00:00
Daniel Harvey
99509da1f2 tests: convert EventTrigger hspec tests to use Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5432
GitOrigin-RevId: 402aa785255333bc90b6df6a398eefb09611dee0
2022-08-11 10:12:56 +00:00
Auke Booij
8888e06bbb Spell out the TH in Hasura.SQL.{Tag,AnyBackend}
The module `Hasura.SQL.AnyBackend` was introduced (in #751) to centralize the logic for case-switching behavior that depends on the particular flavor of relational DB backend (Postgres vs MSSQL vs BigQuery vs MySQL vs DataConnectors). This allows us to write a bunch of code in a backend-agnostic way, even if runtime behavior does depend on the chosen backend. At the same time, it allows us to write backend-specific code without having to care (too much) about the existence of other backends.

In #851 this module was rewritten to use Template Haskell.

I've heard that one of the reasons for the use of TH was that this would make it easier to keep backends out of the compilation product entirely. This would allow customers, especially on OSS, to benefit from simpler software licensing.

However:
1. This conditional compilation never materialized.
2. It's not clear whether writing this particular module based on TH would be sufficient for conditional compilation. And in any case, it can be done using CPP pragmas as well.
3. The TH code is extraordinarily complex. Since its introduction, it has been documented extraordinarily well, but it's still very difficult to maintain and/or refactor, due to its non-idiomatic nature.
4. Hasura's company objectives are now Cloud-oriented, so that software licensing issues work differently, and in particular, do not depend on what's part of the compilation product.

So this PR reverts on #851 by spelling out the code generated by TH. This is a net-negative diff size. IOW we used to generate less code than the size of the code doing the generating. This makes the code readable and maintainable.

The generated code has been modified in one way, which I'll now describe.

In the scenario that support for a new backend is introduced, a constructor is added to the `BackendType` type. This would then cause `liftTag` to be partial, thus raising a compiler warning. Resolving this requires adding corresponding constructors to the `BackendTag` and `AnyBackend` types. This would then require amending **almost** all other methods.

The exceptions are `composeAnyBackend` and `unpackAnyBackend`. These methods test whether two values are compatible, i.e. belong to the same backend. Both have a default case that in one way or another ignores the input values. Using TH here ensures that all values that belong together are caught. But after spelling out the TH, the presence of the default case means that no compiler warning is thrown for a missing match of matching values. So in the default case, we now do an explicit check for equality. If there _is_ an equality, that means that there is a missing `case`. So this is reported as an `error` (which is very crude, but it should be).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5333
GitOrigin-RevId: 5aaf0a93394bd740aa7371526d3175c8142b3541
2022-08-11 09:11:07 +00:00
Luca Restagno
fe88cfed3d console: removed beta label from BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5442
GitOrigin-RevId: 27e72fba777b5baeccef7f666d579c8a81882e11
2022-08-11 08:39:26 +00:00
Antoine Leblanc
3b7cfcd10a move strictness where it is needed
### Description

This PR moves some strictness annotations to a concrete use site, rather than putting `seq` in an helper function.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5436
GitOrigin-RevId: 1f279e05333ab80167ad2e18d09b8792eddc52c3
2022-08-11 07:53:44 +00:00
Gil Mizrahi
51ceff71f7 server/tests-hspec: port Context to Fixture - DisableRootFields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5430
GitOrigin-RevId: f31a692c0f2ac4dd6c88b2c60c9aeb26d6f5bfae
2022-08-11 07:25:39 +00:00
Vijay Prasanna
c3545f7a89 fix(console): warnings for un-exported actions in TableReducer
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5437
GitOrigin-RevId: 7eedfd8450660d20ada2ac238a5557b41c3decb9
2022-08-11 05:33:54 +00:00
Daniel Chambers
4d9aa3a78d Fix SQLite Agent port conflict with Data Connector mock agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5440
GitOrigin-RevId: 1872c9021d641407abc8ce2a9e8693dbcf1adb1e
2022-08-11 03:22:32 +00:00
Solomon
7ae2a491ec Gardening: Cleanup Metadata Types Module
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5416
GitOrigin-RevId: 1d2d29da825942f9a0a472d034e68f0eb09a5c26
2022-08-10 23:19:25 +00:00
Gil Mizrahi
c08bb5377f server/tests-hspec: porting more tests to fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5404
GitOrigin-RevId: 0be4f50b17765a8f0b1fb37944777ead7ec6bfc9
2022-08-10 20:38:39 +00:00
Solomon
3855efa9a5 Move soEventsHttpPoolSize and soEventsFetchInterval defaulting into arg parser
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5284
GitOrigin-RevId: f2302b3219f3aa9ebde623b4efa7f3ee8a97c031
2022-08-10 19:18:11 +00:00
Daniel Harvey
2bdc54ebb4 tests: convert RemoteRelationships hspec tests to use Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5424
GitOrigin-RevId: 0b23ba62aa0e2d279d8238aecd6c84ef8994097e
2022-08-10 16:45:19 +00:00
Daniel Harvey
548edcc6e6 tests: convert InsertDefaults Context test to Fixture
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5382
GitOrigin-RevId: 3964dda7307bde6e294be36791a76c8e459afa25
2022-08-10 16:16:49 +00:00
Sooraj
712e3aeddd console: support extensions_schema on postgres connect/edit DB form
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5422
GitOrigin-RevId: c88e84530ca40f788b2f47cba4f6282f6a5ca6ff
2022-08-10 14:46:36 +00:00
Vishnu Bharathi
a785c664e5 ci: tag release v2.10.0 and v2.11.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5423
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: c0513156c9527f58bab86e8a67435e7be6ee035d
2022-08-10 13:54:03 +00:00
Stefano Magni
e8cb480b13 test(platform): Add a script to automatically export the E2E test request and responses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5386
GitOrigin-RevId: 5458dadc7a23f82a1b344fcd19d8c431d6bd8c78
2022-08-10 13:44:37 +00:00
Gil Mizrahi
d5936a0a9b server/tests-hspec: port Context to Fixture - permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5420
GitOrigin-RevId: aaf785b05bf54d8996c3f3c5148dd6c52e6aea5c
2022-08-10 13:09:07 +00:00
Varun Choudhary
be3196432a Console: deprecate _ne from the permissions builder
closes: [#6253](https://github.com/hasura/graphql-engine/issues/6253)

Description:

[rikinsk] removed the option to select _ne from the dropdown while ensuring existing permissions with _ne are still rendered properly

Test:

- [ ]  the `_ne` operator is not showed as an option while creating a permission rule
- [ ] if a permission rule already has `_ne` in it, the permission builder renders it properly

Effected component:

- [x] Console

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/265
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 8c07425aefc5bc0897831e36f429c31c4c87fd2d
2022-08-10 10:27:32 +00:00
Karthikeyan Chinnakonda
f3dd172821 server: accept extensions_schema while adding a source
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5401
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
GitOrigin-RevId: 75b68c439fc68662a8e312f84132126d761dda48
2022-08-10 09:42:09 +00:00
Evie Ciobanu
8cb490d7d4 docs: add docs for multiple updates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5400
GitOrigin-RevId: b5ec4850025e1a2ed2a76e9d56f1956ed3a27dbb
2022-08-10 08:54:42 +00:00
Matt Hardman
4a792a2054 refactor (console/gdc): clean up the connect DB components + hooks
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5390
GitOrigin-RevId: 7f1f13ca4453c7c436880494576d916403ed974f
2022-08-10 08:24:27 +00:00
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