Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite GraphQL schema generation and query parsing (close #2801) #4111

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
681 commits
Select commit Hold shift + click to select a range
5a74e56
[skip ci] remove stale benchmark commit from commit_diff
codingkarthik Jul 23, 2020
147165f
[skip ci] Check for root field name conflicts between remotes
Jul 23, 2020
a7c6db9
[skip ci] Additionally check for conflicts between remotes and DB
Jul 23, 2020
d579965
[skip ci] Check for conflicts in schema when tracking a table
Jul 23, 2020
ddd90ef
[skip ci] Fix equality checking in GraphQL AST
Jul 23, 2020
ec04fc6
server: fix mishandling of GeoJSON inputs in subscriptions (fix #3239…
May 13, 2020
10b73cd
Scheduled triggers (close #1914) (#3553)
tirumaraiselvan May 13, 2020
9f07e09
dev.sh: bump version due to addition of croniter python dependency
jberryman May 13, 2020
515c4f1
server: fix an introspection query caching issue (fix #4547) (#4661)
May 18, 2020
1c0be22
flush log buffer on exception in mkWaiApp ( fix #4772 ) (#4801)
tirumaraiselvan May 21, 2020
25724d0
allow logging details of a live query polling thread (#4959)
0x777 Jun 4, 2020
56d180a
Don't compile in developer APIs by default
jberryman Jun 4, 2020
289e646
Tighten up handling of admin secret, more docs
jberryman May 19, 2020
38d54d7
server/docs: add instructions to fix loss of float precision in Postg…
Jun 30, 2020
ce23e36
[skip ci] Add new commits from master to the commit diff
Jul 27, 2020
5639cab
[skip ci] serve default directives (skip & include) over introspection
rakeshkky Jul 27, 2020
55ed62b
[skip ci] Update non-Haskell assets with the version on master
Jul 27, 2020
cacb0bf
server: refactor GQL execution check and config API (#5094)
ecthiender Jun 16, 2020
a86fd33
[skip ci] fix js issues in tests by pinning dependencies version
Jul 27, 2020
fcc282f
[skip ci] bump graphql version
Jul 27, 2020
30976d2
[skip ci] Add note about memory usage
Jul 27, 2020
eee2402
generalize query execution logic on Postgres (#5110)
0x777 Jun 16, 2020
5c6e7de
server: changes catalog initialization and logging for pro customizat…
ecthiender Jun 19, 2020
edbb8b6
[skip ci] cosmetic change
Jul 27, 2020
0e40932
[skip ci] fix test calling a mutation that does not exist
Jul 27, 2020
ab03ed6
[skip ci] minor text change
Jul 27, 2020
09c4462
[skip ci] refactored input values
Jul 28, 2020
cd7de01
[skip ci] remove VString Origin
Jul 28, 2020
ec1c467
server: fix updating of headers behaviour in the update cron trigger …
codingkarthik Jun 23, 2020
63971d7
Lower stack chunk size in RTS to reduce thread STACK memory (closes #…
jberryman Jun 24, 2020
28ff27d
[skip ci] fix todo and schema generation for aggregate fields
rakeshkky Jul 28, 2020
e88668a
5087 libpq pool leak (#5089)
jberryman Jul 1, 2020
22da799
bump pg-client-hs version (fixes a build issue on some environments) …
0x777 Jul 2, 2020
8eb91d4
do not use prepared statements for mutations
0x777 Jul 1, 2020
b82ee09
server: unlock scheduled events on graceful shutdown (#4928)
codingkarthik Jul 2, 2020
4a26594
Fix buggy parsing of new --conn-lifetime flag in 2b0e3774
jberryman Jul 2, 2020
67eb395
[skip ci] remove cherry-picked commit from commit_diff.txt
codingkarthik Jul 28, 2020
5fc96d5
server: include additional fields in scheduled trigger webhook payloa…
codingkarthik Jul 3, 2020
2fe25f0
server: call the webhook asynchronously in event triggers (#5352)
codingkarthik Jul 10, 2020
db7895d
Expose all modules in Cabal file (#5371)
paf31 Jul 14, 2020
078f395
[skip ci] update commit_diff.txt
codingkarthik Jul 28, 2020
dc9fed4
[skip ci] fix cast exp parser & few TODOs
rakeshkky Jul 28, 2020
d553fb2
[skip ci] fix remote fields arguments
Jul 28, 2020
913ffc7
[skip ci] fix few more TODO, no-op refactor, move resolve/action.hs t…
rakeshkky Jul 28, 2020
8904e06
Pass environment variables around as a data structure, via @sordina (…
sordina Jul 14, 2020
13fd501
[skip ci] fix: restrict remote relationship field generation for hasu…
rakeshkky Jul 29, 2020
33dda64
[skip ci] no-op refactor; move insert execution code from schema pars…
rakeshkky Jul 29, 2020
a058892
server: call the webhook asynchronously in event triggers (#5352)
codingkarthik Jul 10, 2020
070d10e
Expose all modules in Cabal file (#5371)
paf31 Jul 14, 2020
7645289
[skip ci] update commit_diff.txt
codingkarthik Jul 28, 2020
b009cb9
Pass environment variables around as a data structure, via @sordina (…
sordina Jul 14, 2020
90480f1
[skip ci] implement header checking
Jul 30, 2020
f2df624
server: refactor 'pollQuery' to have a hook to process 'PollDetails' …
ecthiender Jul 16, 2020
58164d8
update pg-client (#5421)
tirumaraiselvan Jul 20, 2020
3ed7fc2
[skip ci] update commit_diff
codingkarthik Jul 30, 2020
ef2681a
Fix latency buckets for telemetry data
jberryman Jul 21, 2020
72ac164
[skip ci] include the latest commit compared against master in commit…
codingkarthik Jul 30, 2020
8fa42a0
[skip ci] include new commits from master in commit_diff
codingkarthik Jul 30, 2020
23493dd
[skip ci] improve description generation
rakeshkky Jul 30, 2020
e25adc1
[skip ci] sort all introspect arrays
Jul 30, 2020
2a4052e
[skip ci] allow parsers to specify error codes
Jul 30, 2020
a20b892
[skip ci] fix integer and float parsing error code
Jul 30, 2020
78ef076
[skip ci] scalar from json errors are now parse errors
Jul 30, 2020
3400567
[skip ci] fixed negative integer error message and code
Jul 30, 2020
99e6099
[skip ci] Re-fix nullability in relationships
Jul 30, 2020
d05ea4f
[skip ci] no-op refactor and removed couple of FIXMEs
rakeshkky Jul 30, 2020
5f8c361
[skip ci] uncomment code in 'deleteMetadataObject'
rakeshkky Jul 30, 2020
8b6d1bd
[skip ci] Fix re-fix of nullability for relationships
Jul 30, 2020
fd48c6b
[skip ci] fix default arguments error code
Jul 30, 2020
fa569dd
[skip ci] updated test error message
Jul 30, 2020
c0af085
[skip ci] cleanup of int scalar parser
Jul 30, 2020
7bebcba
[skip ci] retro-compatibility of offset as string
Jul 30, 2020
2a59dc4
[skip ci] Remove commit from commit_diff.txt
Jul 31, 2020
7ad271a
Add MonadTrace and MonadExecuteQuery abstractions (#5383)
codingkarthik Jul 29, 2020
1f1f56e
Add MonadTrace and MonadExecuteQuery abstractions #5383
codingkarthik Jul 31, 2020
1bb25c7
[skip ci] Fix accumulation of input object types
Jul 31, 2020
becb4d4
[skip ci] fix fragment error path
Jul 30, 2020
7f546b5
[skip ci] fix node error code
Jul 30, 2020
f1cda26
[skip ci] fix paths in insert queries
Jul 31, 2020
4efd4fd
[skip ci] fix path in objects
Jul 31, 2020
748ba4d
[skip ci] manually alter node id path for consistency
Jul 31, 2020
a5e3068
[skip ci] more node error fixups
Jul 31, 2020
1a83f5f
[skip ci] one last relay error message fix
Jul 31, 2020
b42ba36
[skip ci] update commit_diff
codingkarthik Aug 3, 2020
660ee2e
Propagate the trace context to event triggers (#5409)
paf31 Jul 23, 2020
5323b36
server: log request/response sizes for event triggers (#5463)
ecthiender Jul 28, 2020
84efaa0
Tracing: Simplify HTTP traced request (#5451)
Naveenaidu Jul 28, 2020
b51761b
Attach request ID as tracing metadata (#5456)
paf31 Jul 28, 2020
cc15dcb
server: add logging for action handlers (#5471)
ecthiender Jul 29, 2020
3140eb3
server: pass http and websocket request to logging context (#5470)
ecthiender Jul 29, 2020
ff479a2
server: stop eventing subsystem threads when shutting down (#5479)
ecthiender Jul 30, 2020
44881e8
[skip ci] update commit_diff with new commits added in master
codingkarthik Aug 3, 2020
eabf62e
Bugfix to support 0-size HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE
jberryman Jul 27, 2020
a08a9e9
Support only the bounded cache, with default HASURA_GRAPHQL_QUERY_PLA…
jberryman Jul 28, 2020
738c948
[skip ci] remove merge commit from commit_diff
codingkarthik Aug 3, 2020
f22431b
server: Fix compiler warning caused by GHC upgrade (#5489)
Jul 31, 2020
e64442b
[skip ci] update all non server code from master
codingkarthik Aug 3, 2020
8986f48
[skip ci] aligned object field error message with master
Aug 4, 2020
cdea348
[skip ci] fix remaining undefined?
Aug 4, 2020
bf47458
[skip ci] remove unused import
Aug 4, 2020
8d3aafc
[skip ci] revert to previous error message, fix tests
Aug 4, 2020
35ed919
Merge branch 'master' into original-pdv-refactor-merge-master
codingkarthik Aug 4, 2020
d7cb4a4
Merge branch 'pdv-refactor-merge-master' into original-pdv-refactor
codingkarthik Aug 4, 2020
393cdf4
Move nullableType/nonNullableType to Schema.hs
lexi-lambda Aug 4, 2020
618eff3
[skip ci] fix setup to fix backend only test
Aug 4, 2020
3f2dfd2
[skip ci] fix insert geojson tests to reflect new paths
Aug 4, 2020
da59125
[skip ci] fix enum test for better error message
Aug 4, 2020
86cf797
[skip ci] fix header test for better error message
Aug 4, 2020
31042ac
[skip ci] fix fragment cycle test for better error message
Aug 4, 2020
d45c234
[skip ci] fix error message for type mismatch
Aug 4, 2020
8de999d
[skip ci] fix variable path in test
Aug 4, 2020
4b28c2e
[skip ci] adjust tests after bug fix
Aug 4, 2020
bf37b39
[skip ci] more tests fixing
Aug 4, 2020
66e85ab
Add hdb_catalog.current_setting abstraction for reading Hasura settings
lexi-lambda Aug 4, 2020
bbe8b54
[skip ci] Update CONTRIBUTING.md to mention Node setup for Python tests
lexi-lambda Aug 4, 2020
6c526ec
[skip ci] Add missing Python tests env var to CONTRIBUTING.md
lexi-lambda Aug 4, 2020
f2e726c
[skip ci] fix order of result when subscription is run with multiple …
codingkarthik Aug 5, 2020
9a22055
[skip ci] no-op refactor: fix a warning in Internal/Parser.hs
codingkarthik Aug 5, 2020
88203d0
[skip ci] throw error when a subscription contains remote joins
codingkarthik Aug 5, 2020
50a768d
[skip ci] Enable easier profiling by hiding AssertNF behind a flag
Jul 31, 2020
8af9e76
[skip ci] Fix two warnings
Aug 5, 2020
fe5aeb0
[skip ci] Fix warnings by commenting out query plan caching
Aug 5, 2020
3aaffc4
[skip ci] improve masking/commenting query caching related code & few…
rakeshkky Aug 5, 2020
c0e7757
[skip ci] Fixed compiler warnings in graphql-parser-hs
Aug 5, 2020
a2ead33
Sync non-Haskell assets with master
Aug 5, 2020
a04bfc0
[skip ci] add a test inserting invalid GraphQL but valid JSON value i…
codingkarthik Aug 5, 2020
7322151
[skip ci] Avoid converting to/from Map
Aug 5, 2020
c35839e
[skip ci] Apply some hlint suggestions
Aug 5, 2020
5e93f63
[skip ci] remove redundant constraints from buildLiveQueryPlan and ex…
codingkarthik Aug 5, 2020
f031751
[skip ci] add NOTEs about missing Tracing constraints in PDV from master
codingkarthik Aug 5, 2020
ae3e619
Remove -fdefer-typed-holes, fix warnings
lexi-lambda Aug 5, 2020
45cbc01
Update cabal.project.freeze
lexi-lambda Aug 5, 2020
8cdf618
Limit GHC’s heap size to 8GB in CI to avoid the OOM killer
lexi-lambda Aug 6, 2020
10b827d
Commit package-lock.json for Python tests’ remote schema server
lexi-lambda Aug 6, 2020
e194503
restrict env variables start with HASURA_GRAPHQL_ for headers configu…
rakeshkky Aug 5, 2020
3868f69
add test for table_by_pk node when roles doesn't have permission to PK
codingkarthik Aug 6, 2020
a6450e1
[skip ci] fix introspection query if any enum column present in prima…
rakeshkky Aug 5, 2020
70e89dc
[skip ci] test case fix for a6450e126bc2d98bcfd3791501986e4627ce6c6f
rakeshkky Aug 6, 2020
ac97776
[skip ci] add tests to agg queries when role doesn't have access to a…
codingkarthik Aug 6, 2020
b2d59b0
fix backend test
Aug 6, 2020
223f67c
Simplify subscription execution
Aug 6, 2020
2fdbbd9
[skip ci] add test to check if required headers are present while que…
codingkarthik Aug 6, 2020
e70a51c
fix mutations not checking for view mutability
Aug 6, 2020
6dac93b
[skip ci] add variable type checking and corresponding tests
Aug 5, 2020
9e3761a
[skip ci] add test to check if update headers are present while doing…
codingkarthik Aug 7, 2020
8cb612d
[skip ci] add positive counterparts to some of the negative permissio…
codingkarthik Aug 7, 2020
4e22f2a
fix args missing their description in introspect
Aug 7, 2020
0d117b4
[skip ci] Remove unused function; insert missing markNotReusable call
lexi-lambda Aug 7, 2020
bca3cc2
[skip ci] Add a Note about InputValue
lexi-lambda Aug 7, 2020
3b911fa
[skip ci] Delete LegacySchema/ 🎉
lexi-lambda Aug 7, 2020
622db6d
[skip ci] Delete GraphQL/{Resolve,Validate}/ 🎉
lexi-lambda Aug 7, 2020
7d6b6ec
[skip ci] Delete top-level Resolve/Validate modules; tidy .cabal file
lexi-lambda Aug 7, 2020
541bcb7
[skip ci] Delete LegacySchema top-level module
lexi-lambda Aug 7, 2020
cc3e834
fix input value to json
Aug 7, 2020
05f36d5
[skip ci] elaborate on JSON objects in GraphQL
Aug 7, 2020
9bf6f35
[skip ci] add missing file
Aug 7, 2020
5a02143
[skip ci] add a test with subscription containing remote joins
codingkarthik Aug 7, 2020
0c174ad
add a test with remote joins in mutation output
codingkarthik Aug 7, 2020
2f1ec30
[skip ci] Add some comments to Schema/Mutation.hs
Aug 7, 2020
b0013bd
[skip ci] Remove no longer needed code from RemoteServer.hs
Aug 7, 2020
95bd0e3
[skip ci] Use a helper function to generate conflict clause parsers
Aug 7, 2020
4ef43b2
[skip ci] fix type checker error in fields with default value
Aug 7, 2020
2094268
capitalize the header keys in select_articles_without_required_headers
codingkarthik Aug 7, 2020
016b433
[skip ci] Add a long Note about optional fields and nullability
lexi-lambda Aug 7, 2020
2250e18
Improve comments a bit; simplify Schema/Common.hs a bit
Aug 7, 2020
3631e2e
[skip ci] full implementation of 5.8.5 type checking.
Aug 7, 2020
8555bf8
[skip ci] fix validation test teardown
Aug 7, 2020
0c487c3
[skip ci] fix schema stitching test
Aug 7, 2020
07911fa
fix remote schema ignoring enum nullability
Aug 10, 2020
604bfd6
[skip ci] fix fieldOptional to not discard nullability
Aug 7, 2020
c931b61
revert nullability of use_spheroid
Aug 10, 2020
14505e6
fix comment
Aug 10, 2020
610ed48
add required remote fields with arguments for tests
Aug 10, 2020
fdc497a
[skip ci] add missing docstrings
Aug 10, 2020
b98dedc
[skip ci] fixed description of remote fields
Aug 10, 2020
07bff01
[skip ci] change docstring for consistency
Aug 10, 2020
a6bc45f
fix several schema inconsistencies
Aug 10, 2020
7616d53
revert behaviour change in function arguments parsing
Aug 10, 2020
c49e3bc
fix remaining nullability issues in new schema
Aug 10, 2020
37ef19b
minor no-op refactor; use isListType from graphql-parser-hs
codingkarthik Aug 11, 2020
34b5d00
use nullability of remote schema node, while creating a Remote reln
codingkarthik Aug 11, 2020
546342e
fix 'ID' input coercing & action 'ID' type relationship mapping
rakeshkky Aug 11, 2020
17641a9
include ASTs in MonadExecuteQuery
codingkarthik Aug 12, 2020
425b821
Delete code for "interfaces implementing ifaces" (draft GraphQL spec)
Aug 12, 2020
b451375
Ignore a remote schema test during the upgrade/downgrade test
Aug 12, 2020
a1f49fb
add haddock documentation to the action's field parsers
codingkarthik Aug 12, 2020
26a6bf4
Deslecting some tests in server-upgrade
nizar-m Aug 12, 2020
c4de1f4
[skip ci] Add a long Note about interfaces and object types
lexi-lambda Aug 12, 2020
8fcd90c
send the response headers back to client after running a query
codingkarthik Aug 13, 2020
10825df
Deselect a few more tests during upgrade/downgrade test
Aug 13, 2020
9ad1611
Update commit_diff.txt
Aug 13, 2020
5654b40
change log kind from db_migrate to catalog_migrate (#5531)
tirumaraiselvan Aug 5, 2020
f2b0f83
Show method and complete URI in traced HTTP calls (#5525)
paf31 Aug 5, 2020
0b57f2b
restrict env variables start with HASURA_GRAPHQL_ for headers configu…
rakeshkky Aug 5, 2020
0f9a5af
fix introspection query if any enum column present in primary key (fi…
rakeshkky Aug 5, 2020
0b50695
Fix telemetry reporting of transport (websocket was reported as http)
jberryman Aug 6, 2020
c727fc3
add log kinds in cli-migrations image (#5529)
tirumaraiselvan Aug 6, 2020
ce18739
server: set hasura.tracecontext in RQL mutations [#5542] (#5555)
paf31 Aug 10, 2020
20780a9
Add bulldozer auto-merge and -update configuration
jberryman Aug 10, 2020
a449ff9
Remove 'bulldozer' config, try 'kodiak' for auto-merge
jberryman Aug 12, 2020
678a89e
Cherry-picked all commits
Aug 13, 2020
899e1f1
[skip ci] Slightly improve formatting
Aug 13, 2020
535c779
Revert "fix introspection query if any enum column present in primary…
Aug 13, 2020
fb086b0
Do a small bit of tidying in Hasura.GraphQL.Parser.Collect
lexi-lambda Aug 12, 2020
183f2d2
Fix cherry-picking work
Aug 13, 2020
2074291
[skip ci] clarified comment regarding insert representation
Aug 17, 2020
4b7d91c
[skip ci] removed obsolete todos
Aug 17, 2020
4f16dd9
cosmetic change
Aug 17, 2020
5ad7736
fix action error message
Aug 17, 2020
53e97e2
[skip ci] remove obsolete comment
Aug 17, 2020
c836e1d
[skip ci] synchronize stylish haskell extensions list
Aug 17, 2020
e11b804
use previously defined scalar names in parsers rather than ad-hoc lit…
Aug 17, 2020
907a89f
Apply most syntax hlint hints.
Aug 19, 2020
f6aaa21
Clarify comment on update mutation.
Aug 19, 2020
b5a60af
[skip ci] Clarify what fields should be specified for objects
Aug 19, 2020
82a0ada
Update "_inc" description.
Aug 19, 2020
de012b1
Use record types rather than tuples fo IntrospectionResult and Parsed…
Aug 19, 2020
2eed647
Get rid of checkFieldNamesUnique (use Data.List.Extended.duplicates)
Aug 19, 2020
af72e73
Throw more errors when collecting query root names
Aug 19, 2020
b73976b
Merge branch 'master' into original-pdv-refactor
codingkarthik Aug 20, 2020
74856e1
[skip ci] clean column parser comment
Aug 20, 2020
baa51d4
Remove dead code inserted in ab65b39
Aug 20, 2020
f9b3584
avoid converting to non-empty list where not needed
codingkarthik Aug 20, 2020
d68efa1
add note and TODO about the disabled checks in PDV
codingkarthik Aug 20, 2020
1a14acd
minor refactor in remoteField' function
codingkarthik Aug 20, 2020
bd6bb40
Unify two getObject methods
Aug 20, 2020
48a2a6b
Nitpicks in Remote.hs
Aug 20, 2020
636adb3
Update CHANGELOG.md
Aug 20, 2020
5035fd9
Revert "Unify two getObject methods"
Aug 21, 2020
5b18a33
Fix error message in Remote.hs
Aug 21, 2020
07f511d
Update CHANGELOG.md
nicuveo Aug 21, 2020
c350585
Apply suggested Changelog fix.
nicuveo Aug 21, 2020
4fd8e4d
Fix typo in Changelog.
Aug 21, 2020
5bb0a10
[skip ci] Update changelog.
Aug 21, 2020
b481cb9
reuse type names to avoid duplication
Aug 21, 2020
7b8ca53
Fix Hashable instance for Definition
Aug 21, 2020
3f175b1
[skip ci] Update commit_diff.txt
Aug 21, 2020
2ec09ea
Bump parser version.
Aug 21, 2020
c50b2b9
Bump freeze file after changes in parser.
Aug 21, 2020
b6a59ec
Merge branch 'master' into 2801-graphql-schema-parser-refactor
Aug 21, 2020
e9fad5c
[skip ci] Incorporate commits from master
Aug 21, 2020
c177d88
Fix developer flag in server/cabal.project.freeze
nicuveo Aug 21, 2020
07e38e8
Merge remote-tracking branch 'release/master' into 2801-graphql-schem…
Aug 21, 2020
8c7d38d
Deselect a changed ENUM test for upgrade/downgrade CI
Aug 21, 2020
f930962
Deselect test here as well
Aug 21, 2020
fc043fd
[skip ci] remove dead code
Aug 21, 2020
1bb57d5
Disable more tests for upgrade/downgrade
Aug 21, 2020
aac4b47
Fix which test gets deselected
Aug 21, 2020
6d0605b
Revert "Add hdb_catalog.current_setting abstraction for reading Hasur…
Aug 21, 2020
69c4c6a
Remove circular reference in cabal.project.freeze
Aug 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .circleci/server-upgrade-downgrade/err_msg.patch
@@ -0,0 +1,13 @@
diff --git a/server/tests-py/validate.py b/server/tests-py/validate.py
index 3eecd52a..a18b3113 100644
--- a/server/tests-py/validate.py
+++ b/server/tests-py/validate.py
@@ -318,7 +318,7 @@ def assert_graphql_resp_expected(resp_orig, exp_response_orig, query, resp_hdrs=
# If it is a batch GraphQL query, compare each individual response separately
for (exp, out) in zip(as_list(exp_response), as_list(resp)):
matched_ = equal_CommentedMap(exp, out)
- if is_err_msg(exp):
+ if is_err_msg(exp) and is_err_msg(out):
if not matched_:
warnings.warn("Response does not have the expected error message\n" + dump_str.getvalue())
return resp, matched
11 changes: 7 additions & 4 deletions .circleci/server-upgrade-downgrade/run-dev.sh
Expand Up @@ -6,7 +6,9 @@
# and sets some of the required variables that run.sh needs,
# before executing run.sh
set -euo pipefail
ROOT="${BASH_SOURCE[0]%/*}"
cd "${BASH_SOURCE[0]%/*}"
ROOT="${PWD}"
cd - > /dev/null

SERVER_DIR="$ROOT/../../server"

Expand All @@ -18,8 +20,8 @@ echo "server binary: $SERVER_BINARY"
cd -
set +x

export SERVER_OUTPUT_DIR="server-output"
export LATEST_SERVER_BINARY="./graphql-engine-latest"
export SERVER_OUTPUT_DIR="$ROOT/server-output"
export LATEST_SERVER_BINARY="$ROOT/graphql-engine-latest"

# Create Python virtualenv
if ! [ -f ".venv/bin/activate" ] ; then
Expand All @@ -40,7 +42,8 @@ log_duration=on
port=$PG_PORT
EOF
)
export HASURA_GRAPHQL_DATABASE_URL="postgres://postgres:$PGPASSWORD@127.0.0.1:$PG_PORT/postgres"
# Pytest is giving out deprecated warnings when postgres:// is used
export HASURA_GRAPHQL_DATABASE_URL="postgresql://postgres:$PGPASSWORD@127.0.0.1:$PG_PORT/postgres"

DOCKER_PSQL="docker exec -u postgres -it $PG_CONTAINER_NAME psql -p $PG_PORT"

Expand Down
33 changes: 29 additions & 4 deletions .circleci/server-upgrade-downgrade/run.sh
Expand Up @@ -12,7 +12,9 @@ set -euo pipefail
# # echo an error message before exiting
# trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT

ROOT="${BASH_SOURCE[0]%/*}"
cd "${BASH_SOURCE[0]%/*}"
ROOT="${PWD}"
cd - > /dev/null

download_with_etag_check() {
URL="$1"
Expand Down Expand Up @@ -119,6 +121,17 @@ trap rm_worktree ERR

make_latest_release_worktree() {
git worktree add --detach "$WORKTREE_DIR" "$RELEASE_VERSION"
cd "$WORKTREE_DIR"
# FIX ME: Remove the patch below after the next stable release
# The --avoid-error-message-checks in pytest was implementated as a rather relaxed check than
# what we intended to have. In versions <= v1.3.0,
# this check allows response to be success even if the expected response is a failure.
# The patch below fixes that issue.
# The `git apply` should give errors from next release onwards,
# since this change is going to be included in the next release version
git apply "${ROOT}/err_msg.patch" || \
(log "Remove the git apply in make_latest_release_worktree function" && false)
cd - > /dev/null
}

cleanup_hasura_metadata_if_present() {
Expand Down Expand Up @@ -148,7 +161,18 @@ get_server_upgrade_tests() {
cd $RELEASE_PYTEST_DIR
tmpfile="$(mktemp --dry-run)"
set -x
python3 -m pytest -q --collect-only --collect-upgrade-tests-to-file "$tmpfile" -m 'allow_server_upgrade_test and not skip_server_upgrade_test' "${args[@]}" 1>/dev/null 2>/dev/null
# FIX ME: Deselecting some introspection tests from the previous test suite
# which throw errors on the latest build. Even when the output of the current build is more accurate.
# Remove these deselects after the next stable release
python3 -m pytest -q --collect-only --collect-upgrade-tests-to-file "$tmpfile" \
-m 'allow_server_upgrade_test and not skip_server_upgrade_test' \
--deselect test_schema_stitching.py::TestRemoteSchemaBasic::test_introspection \
--deselect test_schema_stitching.py::TestAddRemoteSchemaCompareRootQueryFields::test_schema_check_arg_default_values_and_field_and_arg_types \
--deselect test_graphql_mutations.py::TestGraphqlInsertPermission::test_user_with_no_backend_privilege \
--deselect test_graphql_mutations.py::TestGraphqlInsertPermission::test_backend_user_no_admin_secret_fail \
--deselect test_graphql_mutations.py::TestGraphqlMutationCustomSchema::test_update_article \
--deselect test_graphql_queries.py::TestGraphQLQueryEnums::test_introspect_user_role \
"${args[@]}" 1>/dev/null 2>/dev/null
set +x
cat "$tmpfile"
cd - >/dev/null
Expand All @@ -174,11 +198,12 @@ run_server_upgrade_pytest() {
set -x

# With --avoid-error-message-checks, we are only going to throw warnings if the error message has changed between releases
# FIX ME: Remove the deselect below after the next stable release
pytest --hge-urls "${HGE_URL}" --pg-urls "$HASURA_GRAPHQL_DATABASE_URL" \
--avoid-error-message-checks "$@" \
-m 'allow_server_upgrade_test and not skip_server_upgrade_test' \
--deselect test_graphql_mutations.py::TestGraphqlUpdateBasic::test_numerics_inc \
--deselect test_graphql_mutations.py::TestGraphqlInsertPermission::test_user_with_no_backend_privilege \
--deselect test_graphql_mutations.py::TestGraphqlMutationCustomSchema::test_update_article \
--deselect test_graphql_queries.py::TestGraphQLQueryEnums::test_introspect_user_role \
-v $tests_to_run
set +x
cd -
Expand Down
4 changes: 1 addition & 3 deletions .circleci/test-server.sh
Expand Up @@ -191,9 +191,7 @@ pip3 install -r requirements.txt
# node js deps
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
npm_config_loglevel=error npm install $PYTEST_ROOT/remote_schemas/nodejs/

npm install apollo-server graphql
(cd remote_schemas/nodejs && npm_config_loglevel=error npm ci)

mkdir -p "$OUTPUT_FOLDER/hpc"

Expand Down
2 changes: 1 addition & 1 deletion .kodiak.toml
@@ -1,7 +1,7 @@
###############################################################################
## Configuration for auto-merge / auto-update bot
##
## See: https://kodiakhq.com/
## See: https://kodiakhq.com/
###############################################################################

# Kodiak's configuration file should be placed at `.kodiak.toml` (repository
Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,19 +2,31 @@

## Next release

### Breaking changes

This release contains the [PDV refactor (#4111)](https://github.com/hasura/graphql-engine/pull/4111), a significant rewrite of the internals of the server, which did include some breaking changes:

- The semantics of explicit `null` values in `where` filters have changed according to the discussion in [issue 704](https://github.com/hasura/graphql-engine/issues/704#issuecomment-635571407): an explicit `null` value in a comparison input object will be treated as an error rather than resulting in the expression being evaluated to `True`. For instance: `delete_users(where: {id: {_eq: $userId}}) { name }` will yield an error if `$userId` is `null` instead of deleting all users.
- The validation of required headers has been fixed (closing #14 and #3659):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is The validation of required headers has been fixed considered a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right, this should rather be among the fixes. I can fix this in an hour or so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because some queries might fail where they used to "work" before.
Imagine you do the following:

query {
  author {
    name
    articles {
      name
    }
  }
}

Now imagine that header X-ARTICLE-VIEW-PERMIT is required for the select permissions on table articles. That header was not checked before this patch, because we only checked the headers for the root table, which means this query would have succeeded without the required header. It would have returned no article, since the header was missing, and its value would have been evaluated to an empty string, but still: the query would have gone through. Now it will properly fail: a header is required to select from table articles, and you don't have it.

- if a query selects table `bar` through table `foo` via a relationship, the required permissions headers will be the union of the required headers of table `foo` and table `bar` (we used to only check the headers of the root table);
- if an insert does not have an `on_conflict` clause, it will not require the update permissions headers.
nicuveo marked this conversation as resolved.
Show resolved Hide resolved


### Bug fixes and improvements

(Add entries here in the order of: server, console, cli, docs, others)

- docs: add docs page on networking with docker (close #4346) (#4811)
- server: some mutations that cannot be performed will no longer be in the schema (for instance, `delete_by_pk` mutations won't be shown to users that do not have select permissions on all primary keys) (#4111)
- server: miscellaneous description changes (#4111)
- server: treat the absence of `backend_only` configuration and `backend_only: false` equally (closing #5059) (#4111)
- cli: add missing global flags for seeds command (#5565)
- docs: add docs page on networking with docker (close #4346) (#4811)

## `v1.3.1`, `v1.3.1-beta.1`

### Breaking change

Headers from environment variables starting with `HASURA_GRAPHQL_` are not allowed
Headers from environment variables starting with `HASURA_GRAPHQL_` are not allowed
in event triggers, actions & remote schemas.

If you do have such headers configured, then you must update the header configuration before upgrading.
Expand Down
7 changes: 7 additions & 0 deletions server/.stylish-haskell.yaml
Expand Up @@ -229,6 +229,7 @@ language_extensions:
- BangPatterns
- BlockArguments
- ConstraintKinds
- DataKinds
- DefaultSignatures
- DeriveDataTypeable
- DeriveFoldable
Expand All @@ -238,9 +239,11 @@ language_extensions:
- DeriveTraversable
- DerivingVia
- EmptyCase
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- LambdaCase
Expand All @@ -249,12 +252,16 @@ language_extensions:
- NamedFieldPuns
- NoImplicitPrelude
- OverloadedStrings
- QuantifiedConstraints
- QuasiQuotes
- RankNTypes
- RecordWildCards
- RoleAnnotations
- ScopedTypeVariables
- StandaloneDeriving
- TemplateHaskell
- TupleSections
- TypeApplications
- TypeFamilies
- TypeFamilyDependencies
- TypeOperators
23 changes: 16 additions & 7 deletions server/CONTRIBUTING.md
Expand Up @@ -24,6 +24,11 @@ Additionally, you will need a way to run a Postgres database server. The `dev.sh
- [PostgreSQL](https://www.postgresql.org) >= 9.5
- [postgis](https://postgis.net)

Additionally, you will need a way to run a Postgres database server. The `dev.sh` script (described below) can set up a Postgres instance for you via [Docker](https://www.docker.com), but if you want to run it yourself, you’ll need:

- [PostgreSQL](https://www.postgresql.org) >= 9.5
- [postgis](https://postgis.net)

### Upgrading npm

If your npm is too old (>= 5.7 required):
Expand Down Expand Up @@ -116,16 +121,13 @@ cabal new-run -- test:graphql-engine-tests \

##### Running the Python test suite

1. To run the Python tests, you’ll need to install the necessary Python dependencies first. It is
recommended that you do this in a self-contained Python venv, which is supported by Python 3.3+
out of the box. To create one, run:
1. To run the Python tests, you’ll need to install the necessary Python dependencies first. It is recommended that you do this in a self-contained Python venv, which is supported by Python 3.3+ out of the box. To create one, run:

```
python3 -m venv .python-venv
```

(The second argument names a directory where the venv sandbox will be created; it can be anything
you like, but `.python-venv` is `.gitignore`d.)
(The second argument names a directory where the venv sandbox will be created; it can be anything you like, but `.python-venv` is `.gitignore`d.)

With the venv created, you can enter into it in your current shell session by running:

Expand All @@ -141,19 +143,26 @@ cabal new-run -- test:graphql-engine-tests \
pip3 install -r tests-py/requirements.txt
```

3. Start an instance of `graphql-engine` for the test suite to use:
3. Install the dependencies for the Node server used by the remote schema tests:

```
(cd tests-py/remote_schemas/nodejs && npm ci)
```

4. Start an instance of `graphql-engine` for the test suite to use:

```
env EVENT_WEBHOOK_HEADER=MyEnvValue \
WEBHOOK_FROM_ENV=http://localhost:5592/ \
SCHEDULED_TRIGGERS_WEBHOOK_DOMAIN=http://127.0.0.1:5594 \
cabal new-run -- exe:graphql-engine \
--database-url='postgres://<user>:<password>@<host>:<port>/<dbname>' \
serve --stringify-numeric-types
```

The environment variables are needed for a couple tests, and the `--stringify-numeric-types` option is used to avoid the need to do floating-point comparisons.

4. With the server running, run the test suite:
5. With the server running, run the test suite:

```
cd tests-py
Expand Down
11 changes: 9 additions & 2 deletions server/cabal.project
Expand Up @@ -15,10 +15,17 @@
packages: .

constraints:
-- ensure we dont end up with a freeze file that forces an incompatible
-- ensure we don't end up with a freeze file that forces an incompatible
-- version in CI for Setup.hs scripts.
setup.Cabal <3.4

allow-newer:
-- dependent-map depends on constraints-extras, but its bounds have not yet
-- been relaxed for GHC 8.10.
constraints-extras-0.3.0.2:base,
constraints-extras-0.3.0.2:constraints,
constraints-extras-0.3.0.2:template-haskell

package *
optimization: 2
-- For tooling, e.g. 'weeder', and IDE-like stuff:
Expand All @@ -41,7 +48,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/hasura/graphql-parser-hs.git
tag: f4a093981ca5626982a17c2bfaad047cc0834a81
tag: 8f1cd3a9bf6ec91f1ba1d83f704ab078113e035b

source-repository-package
type: git
Expand Down
8 changes: 7 additions & 1 deletion server/cabal.project.ci
Expand Up @@ -3,6 +3,12 @@
reject-unconstrained-dependencies: all

package graphql-engine
ghc-options: -j3 -Werror
ghc-options:
-j3 -Werror
-- Limit heap size to 8GB, which is the amount of available memory on a
-- CircleCI `large` instance. (GHC interprets G as GB, i.e. 1,000^3 bytes,
-- but instances seem to have 8GiB, i.e. 1,024^3 bytes, so that leaves us
-- a little breathing room.)
+RTS -M8G -RTS
tests: true
benchmarks: true
6 changes: 4 additions & 2 deletions server/cabal.project.dev
Expand Up @@ -6,13 +6,15 @@
-- Or, if you want to customize the configuration:
-- $ cp cabal.project.dev cabal.project.local

with-compiler: ghc-8.10.1

package *
documentation: true

package graphql-engine
-- NOTE: this seems to work so long as there is no 'ghc-options: -O2' in the cabal file,
-- but new-build will report 'Build profile: -O1' for some reason.
-- See:https://github.com/haskell/cabal/issues/6221
-- but new-build will report 'Build profile: -O1' for some reason.
-- See:https://github.com/haskell/cabal/issues/6221
optimization: 0
documentation: false
flags: +developer
11 changes: 6 additions & 5 deletions server/cabal.project.freeze
Expand Up @@ -79,6 +79,8 @@ constraints: any.Cabal ==3.2.0.0,
any.conduit ==1.3.2,
any.connection ==0.3.1,
any.constraints ==0.12,
any.constraints-extras ==0.3.0.2,
constraints-extras +build-readme,
any.containers ==0.6.2.1,
any.contravariant ==1.5.2,
contravariant +semigroups +statevar +tagged,
Expand Down Expand Up @@ -112,8 +114,8 @@ constraints: any.Cabal ==3.2.0.0,
any.deepseq ==1.4.4.0,
any.deferred-folds ==0.9.10.1,
any.dense-linear-algebra ==0.1.0.0,
any.dependent-map ==0.2.4.0,
any.dependent-sum ==0.4,
any.dependent-map ==0.4.0.0,
any.dependent-sum ==0.7.1.0,
any.directory ==1.3.6.1,
any.distributive ==0.6.2,
distributive +semigroups +tagged,
Expand All @@ -127,7 +129,6 @@ constraints: any.Cabal ==3.2.0.0,
any.erf ==2.0.0.0,
any.errors ==2.3.0,
any.exceptions ==0.10.4,
exceptions +transformers-0-4,
any.fail ==4.9.0.0,
any.fast-logger ==3.0.1,
any.file-embed ==0.0.11.2,
Expand Down Expand Up @@ -242,8 +243,6 @@ constraints: any.Cabal ==3.2.0.0,
any.primitive-unlifted ==0.1.3.0,
any.process ==1.6.8.2,
any.profunctors ==5.5.2,
any.protolude ==0.3.0,
protolude -dev,
any.psqueues ==0.2.7.2,
any.quickcheck-instances ==0.3.22,
quickcheck-instances -bytestring-builder,
Expand Down Expand Up @@ -277,6 +276,8 @@ constraints: any.Cabal ==3.2.0.0,
any.simple-sendfile ==0.2.30,
simple-sendfile +allow-bsd,
any.socks ==0.6.1,
any.some ==1.0.1,
some +newtype-unsafe,
any.split ==0.2.3.4,
any.splitmix ==0.0.4,
splitmix -optimised-mixer +random,
Expand Down
1 change: 1 addition & 0 deletions server/commit_diff.txt
@@ -0,0 +1 @@
**** Latest commit compared against master - fd7fb580831fe9054164a285441c99562f34c815