Commit Graph

5910 Commits

Author SHA1 Message Date
Auke Booij
cca0b6e81a Further schema cache cleanups
Mostly trying to avoid tricky `Arrows` syntax, and unnecessary use of the `Hasura.Incremental` framework.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6997
GitOrigin-RevId: 9a2f5883e7e29af164e1581049ae003afec2cbe4
2022-11-29 01:02:09 +00:00
Auke Booij
7928179024 Delete SourceM type class
I encountered this dead code while doing other things: it's a type class with a single method which is never called. Deleting the type class allows us to simplify `TableCoreCacheRT` and `TableCacheRT`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7075
GitOrigin-RevId: 121320349c478a93717b0706037553d8406cbfa9
2022-11-28 20:20:32 +00:00
Brandon Simmons
1b7602a2a5 server: define instance Functor InputFieldsParser by hand to lower memory usage slightly
fwiw: I was looking here because ghc-debug showed many closures associated with the Applicative instance,
but defining Monoid/Semigroup by hand and inlining didn't seem to have any effect

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7026
GitOrigin-RevId: 4ad2fd26519da98b2380658d89942c700de4ffa2
2022-11-28 15:58:11 +00:00
Philip Lykke Carlsen
a6e25a9e01 server/tests: Re-enable ObjectRelationshipsSpec for Citus
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7074
GitOrigin-RevId: 72592a29d6ea7897f93718b656fce4ac7179f4cc
2022-11-28 13:58:35 +00:00
Luca Restagno
e27ed1eb5b fix: show the accelerate project box on the cloud console only
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7060
GitOrigin-RevId: 6718c5412d8541f0ab19f4d53e6afa20543b9e8c
2022-11-28 13:00:47 +00:00
Nicolas Inchauspe
25cc0b75d6 console: fix REST endpoint creation form width
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7061
GitOrigin-RevId: 6fa530518051fab25443889c261b8ae879e8af8f
2022-11-28 11:07:39 +00:00
Erik Magnusson
6980054a35 console: removed unnecessary null defaulting from input fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6988
Co-authored-by: Luca Restagno <59067245+lucarestagno@users.noreply.github.com>
GitOrigin-RevId: 0b56327130bd268403054479c9cfd725b65dfb72
2022-11-28 10:35:35 +00:00
Auke Booij
b0d4493b5c Replace non-canonical Select instance with a canonical one
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7066
GitOrigin-RevId: ef65253ad816d669d109cf45662817b3115b37c3
2022-11-28 09:50:18 +00:00
Mohd Bilal
9335e40d76 cli: remove os.IsNotExist and os.IsExist error checks
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7068
GitOrigin-RevId: 37735c0020df23857015871890d2f6774166d7b1
2022-11-28 08:45:42 +00:00
Varun Choudhary
b74c2952dd console: enable naming convention check to enable/disable naming convention carded radio button
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6897
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 9dba07b1febf44fe10426e6c383cc8f3e0b799a6
2022-11-28 07:36:27 +00:00
Abby Sassel
37e7480822 server/tests: refactor XToDBArrayRelationshipSpec setup/teardown
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7055
GitOrigin-RevId: 71d631165e4364d9cc22c303becf75fef5d01497
2022-11-25 17:59:19 +00:00
Rahul Agarwal
5f2490b26c Adding features to the enterprise listing docs page
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7048
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
GitOrigin-RevId: 916a20213a137d2f797648d12c6976351d67e59d
2022-11-25 15:49:13 +00:00
Daniel Harvey
60ab8e2ae3 [tooling] make commands for building and formatting CI pipeline
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7051
GitOrigin-RevId: dca45b31608680bf57a2dd190171b2567e1fcb02
2022-11-25 15:49:06 +00:00
Philip Lykke Carlsen
afa1e2fc02 server/tests: Port Citus table relationship tests from pytest
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7047
GitOrigin-RevId: 1ddcc656a43adc2c34f36fa4cf220eebb91f09ae
2022-11-25 15:40:49 +00:00
Daniel Harvey
9dc863e479 [server/tests] allow api-tests to be filtered by backend type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7056
GitOrigin-RevId: 84618c3d5a0c2273b51584831287968b4df73fba
2022-11-25 15:40:41 +00:00
Tom Harding
b85a6572bf Make fixtureRepl work again
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6906
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: cf00c31f610ad65305a007d8fbc6b7971ce9b7a9
2022-11-25 13:15:43 +00:00
Philip Lykke Carlsen
88af86e21a server/tests: Add ghci macros to ease working with fixtureRepl
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7046
GitOrigin-RevId: 6a3f4780cfd86646bfdd933839ca0dfb865fd32c
2022-11-25 12:34:37 +00:00
Daniel Harvey
5ab101acd5 [server/tests] Re-add Citus views test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7043
GitOrigin-RevId: f737af39d5f6b46b29587400f53e2c6e2a772706
2022-11-25 10:33:25 +00:00
Philip Lykke Carlsen
375aa28c4e server/tests: Improve details in feature matrix tool
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7041
GitOrigin-RevId: ba0c6a28ac507d5d57fa1faf37f6e69deaba3a61
2022-11-24 17:54:40 +00:00
Nicolas Beaussart
b01a9e2784 frontend: re import code into new mono
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6966
GitOrigin-RevId: 92a8909a3d316f6a6d5dc512057e60995389383d
2022-11-24 17:21:59 +00:00
Tirumarai Selvan
4662d75bc6 revamp elastic connection pool docs
Restructure elastic connection pool docs to remove internal details and describe connection pooling benefits.

[Rendered](https://tiru-elastic-connection-pool.hasura-docs-mono.pages.dev/docs/latest/databases/connect-db/cloud-connection-pooling/)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6960
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 10c0ebfe1313fcf0c25631e6103978ce774502f8
2022-11-24 15:18:13 +00:00
hasura-bot
0df52d8497 docs: fix streaming subscription example (close #9241)
GITHUB_PR_NUMBER: 9242
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/9242

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6984
Co-authored-by: Jeff Lambert <11539524+jflambert@users.noreply.github.com>
GitOrigin-RevId: ed0965a016e3957ecc91184595478741e1cc7b25
2022-11-24 14:33:03 +00:00
Samir Talwar
a0dc296ede Document and automate spinning up AlloyDB for testing.
We sometimes need to test against cloud databases. Here, we add a Terraform module to start a new AlloyDB cluster and instance, which we can then use for testing purposes.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7002
GitOrigin-RevId: 2d661b5cc6d60e47485ea68b781e13426ed4f097
2022-11-24 14:16:21 +00:00
Abby Sassel
eebeb5cc3b Server/tests: Remote Relationships > Citus
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7040
GitOrigin-RevId: 1a177e2d8a903144576990d047addcef70c69544
2022-11-24 13:31:04 +00:00
Varun Choudhary
3061f7a90c console: forwardClientHeader is not saved while creating action
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7012
GitOrigin-RevId: 3c343a794a581033cfbf1e2759e08694b4839e74
2022-11-24 12:54:25 +00:00
Stefano Magni
fdb2d87174 console: Fix the RequestHeadersSelector interaction tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6963
GitOrigin-RevId: 5e6b56d5536d82cb93189b5b33c7cb14bc88d899
2022-11-24 12:16:08 +00:00
Varun Dey
248ea61600 cli: expose deploy command in public API [GT-307]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6994
GitOrigin-RevId: 915e60952bc7c8f21169e4d49bb7733988a8ee40
2022-11-24 11:43:05 +00:00
Luca Restagno
4c109f9b85 Console: retain filters and sorts conditions while moving from one tab to the other
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6905
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
Co-authored-by: Erik Magnusson <32518962+ejkkan@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Krushan Bauva <31391329+krushanbauva@users.noreply.github.com>
GitOrigin-RevId: 889feeb75b8119f94d9d5da071c50374ac59f589
2022-11-24 10:11:43 +00:00
Karthikeyan Chinnakonda
e9794a6639 server: fix bug with customized remote schema enum variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6993
GitOrigin-RevId: 0458c806176e752aea5a848e68246744c3e5b38a
2022-11-24 08:47:46 +00:00
Mohd Bilal
c55cca3061 cli: refactor migrate/ to use internal/errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7006
GitOrigin-RevId: bfa2be15cef0460b32576e8297cfa177ed59031a
2022-11-23 17:15:19 +00:00
Daniel Harvey
79b50add5e [server] regularly ping selected sources
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6945
GitOrigin-RevId: cad67b121090d4100330067d3d50f575292b4584
2022-11-23 16:41:46 +00:00
Stefano Magni
c50cfad476 console: Improve the analytics docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7015
GitOrigin-RevId: 66e461f20173d5e669056f3d818821a1f1384bb4
2022-11-23 16:04:30 +00:00
Abby Sassel
4598e1e008 NDAT-300: skip fewer CockroachDB tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7016
GitOrigin-RevId: 0fbbfd9fed46301759ee4d62827c9ab7989617b6
2022-11-23 15:22:19 +00:00
Nicolas Beaussart
1b33ebc32d ci: introduce required review github action
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7011
GitOrigin-RevId: 357186328a784ad5b44a155d098944c242b08ca8
2022-11-23 14:33:45 +00:00
Kailash Sudhakar
458ce8b384 Build configs for preview builds through GKE
Build configs for preview builds through GKE

## Description ✍️

Moving the docs preview builds from Cloudflare to "websitecloud" Google Cloud Project which is currently handling the staging and production deployments:

The preview triggers are expected to be called only on changes to the docs folder

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6999
GitOrigin-RevId: 1699fe7677ebc03b8ce6338394e91d8e848640c3
2022-11-23 14:18:37 +00:00
Samir Talwar
43779ff0c1 server/tests-py: Fix test_inconsistent_meta.py for split databases.
This test did not work when splitting the metadata and source backends. Fixed mostly by running the relevant SQL using `source_backend.engine`, but I also took the time to clean it up a little, and broke up _test.yaml_ into 3 files.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6957
GitOrigin-RevId: bbca60a8906caba2d0cffd834b3b8595fca058fd
2022-11-23 14:14:01 +00:00
Matthew Goodwin
7a1dc37bf6 refactor (console): create global metadata hooks that use the new metadata types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6931
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: e57ed8bf14f2b855c6f4c20e072ecd25a784d08b
2022-11-23 13:18:15 +00:00
Varun Choudhary
8a35522970 console: console crashes on searching special character on table and action search bar
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7008
GitOrigin-RevId: 29e445da8d4be0daba60b02eb8a40c640086df2b
2022-11-23 12:07:23 +00:00
Sameer Kolhar
42d2e9bf10 console: add UI to show DB connection latency reports on cloud console
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6808
GitOrigin-RevId: 2768bdf3611ecaf40ed1b967d27c57aa3d80034a
2022-11-23 11:08:29 +00:00
Shahidh K Muhammed
e495c788b2 docs: update security team's email address
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6968
GitOrigin-RevId: d65596d0b5b6a36f4b2b35db4a50c3b6d0a91c72
2022-11-23 10:32:19 +00:00
awjchen
339e19048b server: update metadata api for the OpenTelemetry exporter
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6844
GitOrigin-RevId: 3d808215fc46a79caf85a1c4d964ac874f905029
2022-11-23 07:54:53 +00:00
Samir Talwar
c6557ced13 server/test-harness: Do not fail if the database cannot be dropped.
Sometimes this happens, especially in CI. It's alright. We can just leave it lying around and it will be destroyed when the container and associated volume are removed.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7003
GitOrigin-RevId: dcb74920c12341d7a15f9b6ebfe52d0864de4738
2022-11-23 07:54:44 +00:00
Abby Sassel
9c4aaccdb2 Server/test: fix enum test for CosmosDB: cleanup types in teardown
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6992
GitOrigin-RevId: 4c872e5837367b1449c9c0eeb085b708560d9bbd
2022-11-23 07:54:36 +00:00
Daniel Harvey
80c3846aaa [server/tests] run setup for each set of tests again
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7000
GitOrigin-RevId: 2e85870c970144dbd417cf555b14b63c18f495ab
2022-11-23 07:54:28 +00:00
Sean Park-Ross
26a5946622 Docs: Docusaurus update fixes
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6998
GitOrigin-RevId: 2b60acba07f8c0bdce116ec44986efcaa3f4587d
2022-11-23 07:54:19 +00:00
Daniel Harvey
bc2d173161 [server/tests] New SQLServer DB per test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6834
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 3ee30313e47ba64d5b50ff46345ce507735c4d1f
2022-11-23 07:54:10 +00:00
Auke Booij
67b922bac1 Avoid GraphQL schema rebuild when changing irrelevant Metadata
This increases the speed of `create_query_collection` and `add_collection_to_allowlist` by a factor ~~10~~ 65, by caching the in-memory GraphQL schema. This speedup also applies more broadly to Metadata changes relating to:
- allowlists
- query collections
- cron triggers
- REST endpoints
- API limits
- metrics config
- GraphQL introspection options
- TLS allow lists
- OpenTelemetry

When is construction of the in-memory GraphQL schema cached between Metadata operations?

Before this PR, **never**! It's rebuilt fully, for every role, on every Metadata operation.

However, there are many Metadata operations that don't influence the GraphQL schema. So we should be caching its construction.

The `Hasura.Incremental` framework allows us to cache such constructions: whenever we have an arrow `Rule m a b`, where `a` is the input to the arrow and `b` the output, we can use the `Inc.cache` combinator to obtain a new arrow which is only re-executed when the input `a` changes in a material way. To test this, `a` needs an `Eq` instance. (Before hasura/graphql-engine-mono#6877, this was a `Cacheable` type class which has now been removed.)

We can't simply apply `Inc.cache` to the "Steps 3 and 4" in `buildSchemaCacheRule`, because the inputs (components of `BuildOutputs` such as `SourceCache`) don't have an `Eq` instance.

So the changes to `buildSchemaCacheRule` restructure the code so that the input to "Step 1", namely the Metadata, can be used as a caching key instead, so that `Inc.cache` can be applied to the whole sequence of steps.

That works to cache construction of the GraphQL schema, but it means that now only those Metadata operations that _don't_ influence any of the products of steps 1-4 can use a cached build of the GraphQL schema. The most important intermediate product is `BuildOutputs`. So now the exercise becomes to minimize the amount of stuff stored in `BuildOutputs`, so that as many Metadata operations as possible can be handled outside of the codepath that produces a GraphQL schema.

Per hasura/graphql-engine-mono#6609, the `BuildOutputs` structure is too big, and stores things unnecessarily. Refer to the PR description there for reasoning - the same logic applies to this PR, and simply goes a few steps further. In doing so, it can benefit from hasura/graphql-engine-mono#6765, which allows us to verify at compile time that certain Schema Cache building steps _don't_ generate "Metadata dependencies". If a certain Metadata dependency is never generated, we don't need to handle that case in `deleteMetadataObject`. Thus such intermediate products don't need to be passed through `resolveDependencies`, and thus they don't need to be stored in `BuildOutputs`, and thus their rebuild won't trigger a GraphQL schema rebuild.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6613
GitOrigin-RevId: 27d2e69d3461bd4c32f08febef9995c0369fab3a
2022-11-23 07:54:01 +00:00
Gil Mizrahi
b213907671 use schemaName in postgres event triggers tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6964
GitOrigin-RevId: b05a1333583d59684b5fbd33b43544080d542696
2022-11-23 07:53:53 +00:00
Varun Choudhary
489d1fe493 console: browse back from allow list using browser back button
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6990
GitOrigin-RevId: 1c99dbdb7098dee57839cd98e4d19c19edd470b9
2022-11-23 07:53:45 +00:00
Nicolas Inchauspe
0ebb4a04ec console: fix code exporter style
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6952
GitOrigin-RevId: 269cff9788a12a02f13f89c2d98793b8aa50ca25
2022-11-23 07:53:36 +00:00