Commit Graph

973 Commits

Author SHA1 Message Date
Vamshi Surabhi
35542df93f
candidate id shouldn't be part of the plan in multiplexed subscriptions (#2029) 2019-04-18 16:50:27 +05:30
Vamshi Surabhi
b714923ffb fix typo in the field name for accessing headers (#2026)
The diff says it all
2019-04-18 00:19:50 +05:30
Shahidh K Muhammed
4f289813af update manifests to v1.0.0-alpha43 2019-04-17 22:52:38 +05:30
Rakesh Emmadi
1d7cbc7f24 recover from inconsistent database state (closes #231) (#1863) 2019-04-17 21:59:39 +05:30
Rikin Kachhia
afc2331951
update docs (#2023)
* add missing column error to troubleshooting
* update subscription headers section
* docs for using {} expression
* fix create foreign-key section
2019-04-17 19:07:42 +05:30
Vamshi Surabhi
ce243f5899
multiplexed subscriptions (#1934)
* add types to represent unparsed http gql requests

This will help when we add caching of frequently used ASTs

* query plan caching

* move livequery to execute

* add multiplexed module

* session variable can be customised depending on the context

Previously the value was always "current_setting('hasura.user')"

* get rid of typemap requirement in reusable plan

* subscriptions are multiplexed when possible

* use lazytx for introspection to avoid acquiring a pg connection

* refactor to make execute a completely decoupled module

* don't issue a transaction for a query

* don't use current setting for explained sql

* move postgres related types to a different module

* validate variableValues on postgres before multiplexing subs

* don't user current_setting for queries over ws

* plan_cache is only visible when developer flag is enabled

* introduce 'batch size' when multiplexing subscriptions

* bump stackage to 13.16

* fix schema_stitching test case error code

* store hashes instead of actual responses for subscriptions

* internal api to dump subscriptions state

* remove PlanCache from SchemaCacheRef

* allow live query options to be configured on server startup

* capture metrics for multiplexed subscriptions

* more metrics captured for multiplexed subs

* switch to tvar based hashmap for faster snapshotting

* livequery modules do not expose internal details

* fix typo in live query env vars

* switch to hasura's pg-client-hs
2019-04-17 15:18:41 +05:30
Rishichandra Wawhal
393110420d fix fk bug in non-public schemas (#2010) 2019-04-15 21:44:57 +05:30
Rikin Kachhia
5626a30f8d
refactor permissions types handling (#2009) 2019-04-15 18:57:37 +05:30
Rikin Kachhia
ef00e5f8f3
persist explorer / endpoint / headers collapsed state in ApiExplorer (#1992) 2019-04-15 18:57:07 +05:30
Rishichandra Wawhal
e94ee34017 make console function fetchTableListBySchema reusable (#2008) 2019-04-15 16:04:26 +05:30
Yann IRBAH
f567f7f586 re-organise translations, add french (#1922) 2019-04-15 13:46:32 +05:30
Rakesh Emmadi
bfe53e9d9a fix incorrect default values for inserts after column drop, fix #1991 (#1993) 2019-04-15 12:34:30 +05:30
Rikin Kachhia
f833191939 update docs dependency (#2005) 2019-04-15 12:19:10 +05:30
Karthik Venkateswaran
bf3cf7ff8e fix webhook url edit for event triggers (#1987) 2019-04-11 13:32:11 +05:30
Shahidh K Muhammed
de24cfd43a read version from env var during server build time (close #1398) (#1897)
* read version from env var at build time (close #1398)

* remove un-used imports, edit makefile

* edit makefile to add new targets and export variables

* only export VERSION in makefile

* read version by executing the script if env var is absent
2019-04-11 09:41:48 +05:30
Rishichandra Wawhal
ac523b8f2b fix cli contrib instructions (#1958) 2019-04-11 09:15:18 +05:30
Aravind Shankar
22656cefbd support metadata.json in cli-migrations image (close #1947) (#1968)
/scripts/cli-migrations/docker-entrypoint.sh only checks for metadata.yaml, however, https://docs.hasura.io/1.0/graphql/manual/migrations/manage-metadata.html#exporting-hasura-metadata talks about a metadata.json
2019-04-11 09:11:44 +05:30
Rikin Kachhia
86192511a4
show default values as placeholder during insert row (#1985) 2019-04-10 19:16:32 +05:30
Rikin Kachhia
605ecda832
handle permission api shorthands in console (#1986) 2019-04-10 19:15:53 +05:30
Petr Kohut
ba4451fa29 update auto apply migrations doc with latest tag (#1984) 2019-04-10 19:04:32 +05:30
Rikin Kachhia
b316bf60cb
optimise introspection query calls (#1971) 2019-04-10 18:05:35 +05:30
Rikin Kachhia
1330382960
fix width of docs for larger screens (close #1955) (#1982) 2019-04-10 18:04:45 +05:30
Clément
fd959cc63b add scroll to literal blocks in docs (close #1954) (#1978) 2019-04-10 17:08:50 +05:30
Mathias Griffe
39135d0990 fix save function in console's retry config editor (fix #1975) (#1976) 2019-04-10 16:55:45 +05:30
nizar-m
cadc41b09d Use UTF-8 encoding for stack hpc report generation (#1974) 2019-04-10 14:41:50 +05:30
Rikin Kachhia
c58acaf641
add placeholder for bool type fields while inserting rows (#1962) 2019-04-10 13:40:34 +05:30
Rakesh Emmadi
7b5bbb758a fix excessive memory consumption with bulk queries (#1972)
Use 'Strict' State monad instead of 'Lazy' to avoid unevaluated memory thunks
2019-04-09 21:41:06 +05:30
Rikin Kachhia
6b3e544069
re-add same as other action options in permissions (#1970) 2019-04-09 19:12:50 +05:30
Rikin Kachhia
1a4f172f6e
update console permissions ui (#1924)
* Make permissions sections as collapsibles with tooltips
* Remove 'use same permission as select' type options from row permissions section
* Added clone section to apply same permission to any table-role-action
* Disable other subsections till row permissions are set
2019-04-09 17:25:02 +05:30
Rikin Kachhia
60b450b903
fix styles in browse rows, relationship and permission tables (#1969) 2019-04-09 17:22:12 +05:30
Shahidh K Muhammed
8187f400a6 edit-pg-dump: fix a missing semi-colon 2019-04-09 09:24:59 +05:30
Rishichandra Wawhal
70cd78fec0 support composite foreign keys and primary keys through console (close #1707) (#1854) 2019-04-08 18:47:02 +05:30
Shahidh K Muhammed
883646334a
update regex to delete event triggers in edit-pg-dump (close #1959) (#1960) 2019-04-08 15:59:11 +05:30
Shahidh K Muhammed
8c005795f6 update manifests to v1.0.0-alpha42 2019-04-08 13:35:01 +05:30
nizar-m
a40bf10b9f run graphql tests on both http and websocket; add parallelism (close #1868) (#1921)
Examples 
1)  `
pytest --hge-urls "http://127.0.0.1:8080" --pg-urls "postgresql://admin@127.0.0.1:5432/hge_tests" -vv
`
2)  `pytest --hge-urls "http://127.0.0.1:8080"   "http://127.0.0.1:8081" --pg-urls "postgresql://admin@127.0.0.1:5432/hge_tests"  "postgresql://admin@127.0.0.1:5432/hge_tests2" -vv
`
### Solution and Design
<!-- How is this issue solved/fixed? What is the design? -->
<!-- It's better if we elaborate -->
#### Reducing execution time of tests
- The Schema setup and teardown, which were earlier done per test method, usually takes around 1 sec. 
- For mutations, the model has now been changed to only do schema setup and teardown once per test class.
-  A data setup and teardown will be done once per test instead (usually takes ~10ms).
- For the test class to get this behaviour, one can can extend the class `DefaultTestMutations`. 
    - The function  `dir()` should be define which returns the location of the configuration folder.
    - Inside the configuration folder, there should be 
        - Files `<conf_dir>/schema_setup.yaml` and `<conf_dir>/schema_teardown.yaml`, which has the metadata query executed during schema setup and teardown respectively
        - Files named `<conf_dir>/values_setup.yaml` and `<conf_dir>/values_teardown.yaml`. These files are executed to setup and remove data from the tables respectively. 

#### Running Graphql queries on both http and websockets
- Each GraphQL query/mutation is run on the both HTTP and websocket protocols
- Pytests test parameterisation is used to achieve this
- The errors over websockets are slightly different from that on HTTP
   - The code takes care of converting the errors in HTTP to errors in websockets

#### Parallel executation of tests.
- The plugin pytest-xdist helps in running tests on parallel workers.
- We are using this plugin to group tests by file and run on different workers.
- Parallel test worker processes operate on separate postgres databases(and separate graphql-engines connected to these databases). Thus tests on one worker will not affect the tests on the other worker.
- With two workers, this decreases execution times by half, as the tests on event triggers usually takes a long time, but does not consume much CPU.
2019-04-08 12:52:38 +05:30
Rakesh Emmadi
3708f95036 fix input argument types for custom SQL functions (close #1952) (#1953) 2019-04-08 12:28:56 +05:30
Gordon Johnston
a7eabe034c mention required key length for HMAC encryption to user (#1956)
Following on from a discussion in discord, a small tweak to make the required key length for a HMAC key more obvious
2019-04-06 08:20:16 +05:30
Tirumarai Selvan
cab1aa0cb1 fix update_event_trigger query not persisting the changes (#1950)
fix #1949
2019-04-05 17:50:46 +05:30
Vladimir Novick
1575519224 add realtime chat sample app with vue (#1885) 2019-04-05 12:16:29 +05:30
Rishichandra Wawhal
c964c90a7b persist queries in GraphiQL (closes #1894) (#1903) 2019-04-03 19:43:09 +05:30
Praveen Durairaj
39b623f715 add nextjs 8 jwt sample app (#1943) 2019-04-03 19:21:11 +05:30
Anne Ogborn
44d6bb8b7e improve console error page (close #272) (#1890) 2019-04-03 19:08:17 +05:30
Rishichandra Wawhal
abfe7ae88f firebase2graphql (v0.0.2): support array types in firebase json (close #1829) (#1900) 2019-04-03 17:11:28 +05:30
Aravind Shankar
5f02ebdefa added feedback on migration commands (close #1410) (#1931) 2019-04-03 16:59:58 +05:30
Rikin Kachhia
56c67509aa
update track relationship text in console (#1927) 2019-04-03 15:07:14 +05:30
Rikin Kachhia
29d6e85e42
add better upsert example to docs (#1930) 2019-04-03 15:05:51 +05:30
Aravind Shankar
f147f6d6a6 improve error messages for metadata apply (close #1877) (#1895) 2019-04-03 12:27:59 +05:30
Aravind Shankar
1e20026ea2 added feedback for metadata commands (close #1411) (#1929) 2019-04-03 11:22:03 +05:30
Tirumarai Selvan
d53c70cbcd specify better error msgs for remote schema conflicts (fix #1805) (#1904) 2019-04-03 06:48:19 +05:30
Rikin Kachhia
1c6e962776
remove remote schema env var note (#1932) 2019-04-02 16:44:02 +05:30