Commit Graph

295 Commits

Author SHA1 Message Date
Abby Sassel
25d77afaff server/tests: Fix BigQuery test failure Job exceeded rate limits error in CI
Fixes https://github.com/hasura/graphql-engine-mono/issues/3695.

Error: [BigQuery test failure Job exceeded rate limits](https://github.com/hasura/graphql-engine-mono/issues/3695)

Cause:
1. [this command](2325755954/.circleci/test-server.sh (L1263)) runs tests matching the `Bigquery or Common` string, for the `test-oss-server-bigquery` CI job.
2. in this case, the pytest filter matched on `TestGraphQLQueryBoolExpSearchCommon`. Although unrelated pytests are skipped, BQ setup and teardown runs uneccesarily for the [MSSQL and Postgres backends](e444cf1f5d/server/tests-py/test_graphql_queries.py (L868)).
4. the setup and teardown runs three times in quick succession, _for each of_ SQL Server, Postgres and BigQuery. Occasionally, this surpassed [BigQuery's maximum rate of 5 table update operations in 10 seconds](https://cloud.google.com/bigquery/quotas#load_job_per_table.long).

Fix: restrict setup/teardown to only the relevant backends...
- Hotfix (this PR): ...by renaming pytest classes and changing the pytest filters in `test-server`
	- ok, this is faintly horrifying and an inelegant convention change. On the bright side, it shaves a minute or so off our integration test suite run by skipping fewer tests. Anecdata for `test-oss-server-bigquery`
		- before: 87 passed, 299 skipped, 1 warning, 1 error in 192.99s
		- after: 87 passed, 20 skipped, 1 warning in 170.82s
	- [`Common` was a terrible name, anyway](https://github.com/hasura/graphql-engine-mono/issues/2079), for `AnyCombinationOfBackends`.
- Better fix: ...by refactoring the `conftest.py` helpers. I ran out of a timebox so will write up a separate issue. Given we're actively [porting pytests over to hspec](https://github.com/hasura/graphql-engine/issues/8432), I don't know how much it's worth investing time in a refactor.

To verify the fix: I ran a full CI build a few times [[1]](https://buildkite.com/hasura/graphql-engine-mono/builds/8069#078c781a-c8ef-44f2-a400-15f91fb88e42)[[2]](https://buildkite.com/hasura/graphql-engine-mono/builds/8072#f9e7f59d-264f-46a4-973d-21aa762cca35)[[3]](https://buildkite.com/hasura/graphql-engine-mono/builds/8075#bb104e80-ff76-408c-a46b-6f40e92e6317) whilst troubleshooting to convince myself this fixed the problem.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4362
GitOrigin-RevId: 4c3283f0654b70e9dcda642d9012f6376aa95290
2022-04-27 18:40:41 +00:00
Karthikeyan Chinnakonda
2325755954 server: streaming subscriptions schema generation and tests (incremental PR - 3)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4259
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 4d1b4ec3c01f3a839f4392d3b77950fc3ab30236
2022-04-22 19:54:11 +00:00
jkachmar
6720aef26f server: Clean up Cabal project files
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4105
GitOrigin-RevId: 423eecf04061ca8d5ee036a84ee6792036a149e4
2022-04-07 07:16:12 +00:00
Daniel Chambers
69501b2657 server: Use max-age when refreshing JWKs if must-revalidate is present
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3979
GitOrigin-RevId: 5f5ebfb25ff9729e34397084d86b0fe968099b25
2022-03-15 07:36:43 +00:00
Rakesh Emmadi
b844c5d732 server/tests: unify HASURA_BIGQUERY_SERVICE_KEY and HASURA_BIGQUERY_SERVICE_ACCOUNT env vars
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3914
GitOrigin-RevId: 66f75420504d1b864b91599c2bdaa832784bb956
2022-03-14 07:50:35 +00:00
paritosh-08
dd2f190352 server: fix flaky test test_startup_db_calls_logs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3813
GitOrigin-RevId: 9a1f946cf8de617220fdd7c04bae7e416ce1cedd
2022-02-28 05:16:21 +00:00
Anon Ray
e87433c2bb server: remove hdb_lib and add tests for read-only source
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3634
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 2db62a279496cd7e5dd57bdf02c3efa7b70042c8
2022-02-21 10:00:00 +00:00
paritosh-08
4d2a5dba51 server: fix multiple calls to database on startup
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3569
GitOrigin-RevId: 820d56a7af7faa05292ef65734d5d40fe3dd4641
2022-02-09 05:14:29 +00:00
Gil Mizrahi
efec0bf9ca server/postgres: LIMIT 1 on object relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3489
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: f09a75508545cdbc34cf8728fad95bbb00bde018
2022-02-08 17:40:24 +00:00
Daniel Chambers
4d9417fac4 server: Refresh JWKs maximum once per second
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3429
GitOrigin-RevId: 123fe33f026a36282ee1137eeefd612191ff4844
2022-01-28 00:18:56 +00:00
Abby Sassel
a091110364 server/tests: ephemeral BigQuery projects for CI test jobs
_Problem_
We currently run teardown/`DELETE` statements on the same, shared `hasura_test` dataset. This is not ideal as parallel test runs can and do affect each other, resulting in nondeterministic CI failures.

Closes https://github.com/hasura/graphql-engine-mono/issues/2521

_Solution and design_
This PR introduces ephemeral, isolated projects for each test run _in CI only_. Projects are created within [the Google Cloud Platform `data-sources-test-bigquery` directory](https://console.cloud.google.com/iam-admin/settings?folder=704256416468&orgonly=true&supportedpurview=organizationId) on each test run, and destroyed afterwards.

I've only introduced this change in CI for the time being:
  1. this isn't as much of an issue locally because we're less likely to run bigquery tests in parallel.
  2. to more quickly unblock https://github.com/hasura/graphql-engine/issues/7929.
  3. to limit the number of new projects created until we have a better idea of our usage vs GCP quota/limits.

Also updated the [internal wiki here](https://github.com/hasura/graphql-engine-mono/wiki/Testing-BigQuery) with this info.

_To verify_
- CI: [this job](https://buildkite.com/hasura/graphql-engine-mono/builds/3770#89e5bac6-16fe-447e-bcda-85cd47ea1b77) successfully runs all tests on a temporary project & dataset
- local: follow [these steps](https://github.com/hasura/graphql-engine-mono/wiki/Testing-BigQuery#ci--optional-dedicated-gcp-project-for-tests) to try the same setup locally

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3240
GitOrigin-RevId: d88d9cb7922266bfa962cfcb481e0272b8929a5d
2022-01-25 08:28:06 +00:00
Robert
63f1a93b54 tests: break out flag tests into separate step
`test-server.sh` is largely concerned with running the python test suite in `server/tests-py`.
However, there are two odd test sets in there which don't belong, and make `test-server.sh`
awkward to work with.

One is `haskell-tests` (the "postgres" part of server unit tests), which we're not touching here.
The other is `test-server-flags`, which runs some shell script based tests against the command
line interface.

This commit moves `test-server-flags` out of `test-server.sh`, and into a separate buildkite step.
Reasons are largely:
- it doesn't belong with the python tests
- it doesn't need to run against various backends

The larger scope within which I'd place this change is that we
should aim to move the logic that's in test-server.sh to live closer
to server/tests-py and be shared between the local dev setup and
CI. There shouldn't be this much logic in CI scripts at all
(choosing with what flags to run graphql-engine, choosing which
arguments to pass to pytest, etc.).

This change hardly gets us there, but the way that test-server.sh
mixes concerns is one obstacle in ever getting away from the
current state.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3300
GitOrigin-RevId: a15300a1dd276fa9f0cc29ddbf4ba7497919a6ec
2022-01-24 09:55:32 +00:00
Robert
1a0627d6fa tests: wait for children (graphql-engine in particular) before exiting
- call stop_services on exit
- update stop_services to wait for child PIDs the same way
  kill_hge_servers already does
- update stop_services to also kill GQL_SERVER_PID, which
  had been missed before

The important part is that we wait for graphql-engine children to exit
and finish writing their logs, even if a test case bailed out before
making it to kill_hge_servers.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3333
GitOrigin-RevId: 046bc0f424889a5de0a730fbde626ea6dcda8e1c
2022-01-20 18:28:55 +00:00
Robert
501cb32604 tests: drop stale coverage-related functionality from test-server.sh
This coverage-related functionality has been inactive for a while, so
chances are it's rotted by now anyway. Removing in order to make
things a little bit simpler.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3299
GitOrigin-RevId: 1ac4d4e101fecca1931a099bdcb7ed4dce675575
2022-01-18 03:19:03 +00:00
Vamshi Surabhi
2e1be1d2c5 bump python test suite dependencies
This PR upgrades some of the pinned dependencies do not build with python 3.10 - cffi, ruamel, py. Further, it upgrades other packages where the effort is minimal.

For the reviewers: Please review it commit by commit.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3367
GitOrigin-RevId: c5401fe289d3185a79c4d382297f86fbde139825
2022-01-17 07:40:56 +00:00
Evie Ciobanu
db22401e4f server: document python integration test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3350
GitOrigin-RevId: 47dcebbfa84ed3681da40b3ea52e9b849b2fe8e4
2022-01-13 14:29:10 +00:00
Robert
a3e042c9ba tests: fail don't skip if the environment isn't right for webhook tests
This removes a weird bit of code that skips the webhook tests if the tests aren't run
as root. We want those tests to run, so they should fail if they can't run. The
check passes on buildkite, so it's all a bit theoretical.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3298
GitOrigin-RevId: c930b5baab07f8e33a4bcf54df251d84e55b412f
2022-01-11 15:29:35 +00:00
Robert
b892927c45 tests: run server test shell files through shfmt for consistent indentation
I don't have any particular opinion on what would be a desirable format,
it's just a pain working on them as is.

This is the first in a series of several smallish changes largely to `test-server.sh`,
chipping away at it to make things a bit less convoluted. Ultimately I'm trying to
run the python tests against graphql-engine-pro, but to get there I need to get
a bit more structure into what we have.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3297
GitOrigin-RevId: 08ecf0604a4d8ace73e9f008bf4abfbf7bdb9393
2022-01-11 11:22:42 +00:00
Vishnu Bharathi
777a78ceff ci: automatically computes SHA for dockerfiles
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3193
GitOrigin-RevId: 34aa92c7e03b1b9bf10f7b3177d9d9a1fd44a8ac
2022-01-05 04:52:21 +00:00
Brandon Simmons
2fedf61687 ci: increase parallelism for console and server tests
Build time before: 56min
Build time after: 44min

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3199
GitOrigin-RevId: d19e13c8c883019f1e10b388e7be2a17f9b3d6bf
2021-12-23 09:18:46 +00:00
Divi
ef585f70e6 ci: create draft release in oss repo
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3077
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 88d67689cbdd120d48504e3c94ba6f7a7ff180e6
2021-12-09 09:46:33 +00:00
pranshi06
dee86453ea server: fallback to unauthorised role when JWT is not found in cookie
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2882
GitOrigin-RevId: ad03fbd0572e00ffe7abea106388a4df4d12af2c
2021-12-08 18:29:29 +00:00
Brandon Simmons
0f21cbd6fa ci: make server upgrade test run in parallel and introduce build pro image job
These changes improve build time by 26%
- old: 75 min
- new: 55 min

For context: https://github.com/hasura/ci-timing

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3007
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 6bd4e615303a8749b43258a04d9681476cf6e797
2021-12-02 17:18:06 +00:00
Kali Vara Purushotham Santhati
4edc723d64 cli: codesign the cli binaries
closes https://github.com/hasura/graphql-engine/issues/7147

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2100
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 1816493b6cdf1b00b267ee8852c7b8a7c5fc3ee9
2021-12-02 10:21:30 +00:00
Vishnu Bharathi
2b459ed125 ci: add release graphql-engine-heroku pipeline
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2832
GitOrigin-RevId: 33436bf1a4dd81fca2326c57505545ae713cee68
2021-11-19 07:36:12 +00:00
jkachmar
576b07db28 ci,server: upgrades to GHC 8.10.7 and reworks server builder image
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2727
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Swann Moreau <62569634+evertedsphere@users.noreply.github.com>
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
GitOrigin-RevId: 0779ab7755fd4bdb7ed1551629b2c01d99c5ccf0
2021-11-15 13:22:39 +00:00
Vishnu Bharathi
df143cf048 ci: init release graphql-engine oss pipeline on buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2652
GitOrigin-RevId: 91a57792d8bc0657b8d206678814e9c7ff270817
2021-11-11 04:41:45 +00:00
Puru Gupta
504f13725f server: forward auth webhook set-cookies header on response
>

High-Level TODO:

* [x] Code Changes
* [x] Tests
* [x] Check that pro/multitenant build ok
* [x] Documentation Changes
* [x] Updating this PR with full details
* [ ] Reviews
* [ ] Ensure code has all FIXMEs and TODOs addressed
* [x] Ensure no files are checked in mistakenly
* [x] Consider impact on console, cli, etc.

### Description
>
This PR adds support for adding set-cookie header on the response from the auth webhook. If the set-cookie header is sent by the webhook, it will be forwarded in the graphQL engine response.

Fixes a bug in test-server.sh: testing of get-webhook tests was done by POST method and vice versa. To fix, the parameters were swapped.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [x] Docs
- [ ] Community Content
- [ ] Build System
- [x] Tests
- [ ] Other (list it)

### Related Issues
->
Closes [#2269](https://github.com/hasura/graphql-engine/issues/2269)

### Solution and Design
>

### Steps to test and verify
>
Please refer to the docs to see how to send the set-cookie header from webhook.

### Limitations, known bugs & workarounds
>
- Support for only set-cookie header forwarding is added
- the value forwarded in the set-cookie header cannot be validated completely, the [Cookie](https://hackage.haskell.org/package/cookie) package has been used to parse the header value and any unnecessary information is stripped off before forwarding the header. The standard given in [RFC6265](https://datatracker.ietf.org/doc/html/rfc6265) has been followed for the Set-Cookie format.

### Server checklist

#### Catalog upgrade

Does this PR change Hasura Catalog version?
- [x] No
- [ ] Yes
  - [ ] Updated docs with SQL for downgrading the catalog

#### Metadata

Does this PR add a new Metadata feature?
- [x] No

#### GraphQL
- [x] No new GraphQL schema is generated
- [ ] New GraphQL schema is being generated:
   - [ ] New types and typenames are correlated

#### Breaking changes

- [x] No Breaking changes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2538
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
GitOrigin-RevId: d9047e997dd221b7ce4fef51911c3694037e7c3f
2021-11-09 12:01:31 +00:00
Robert
44977bdf9d ci: stabilize server-upgrade-downgrade test on buildkite
fixes https://github.com/hasura/graphql-engine-mono/issues/2635

The test is running postgres via docker compose, but wasn't waiting
for postgres to be ready, which is likely what caused intermittent
failures when trying to clean metadata.

Also make indentation consistent.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2670
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 5a4c03c3c05322695ee9ff9a49efc834dea37074
2021-10-25 12:28:50 +00:00
Divi
ed589f442d ci: add ci builder images jobs to buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2573
GitOrigin-RevId: 94038eba9ec77da5ac61551322861a6324682dad
2021-10-14 12:20:08 +00:00
Kali Vara Purushotham Santhati
94a3be3e6e cli: fix lint errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1749
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 4515f7f2c58b7f28645b2c5a5d9842aa7a844eae
2021-10-13 14:39:15 +00:00
Abby Sassel
a9e3a1b4bd server/bigquery: improve test setup and documentation (close #2345)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2495
GitOrigin-RevId: ef250a0796200be6b75363b4275eb8a7ae780154
2021-10-12 17:59:44 +00:00
Karthikeyan Chinnakonda
64e2201179 server: enable inherited roles by default
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2325
Co-authored-by: Nicolas Beaussart <7281023+beaussan@users.noreply.github.com>
GitOrigin-RevId: 8ad6fe25a3788892128c1d56b8fa0e8feed2caca
2021-10-05 12:29:32 +00:00
Vishnu Bharathi
2bc9a3b92e ci: add server test jobs in buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2416
GitOrigin-RevId: 5c4b58255447135f7f1e91ef7b3cb1ef1a8f347f
2021-09-29 04:56:02 +00:00
Antoine Leblanc
9bae641ac4 Always enable inherited roles tests
### Description

The inherited roles integration tests were behind a flag, and its corresponding fixture, presumably to avoid enabling the option globally. However, #2288 introduced a new test using inherited roles that was not gated behind the flag, which fails when run with `dev.sh`. However, that test works on CI... because inherited roles are globally enabled there.

Consequently, this PR:
- globally enables inherited roles in dev.sh
- removes the flag and the associated fixture

https://github.com/hasura/graphql-engine-mono/pull/2358

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: ebfa6754873324bed15b2cc5e37ec2d8008e8f8d
2021-09-16 06:24:54 +00:00
Divi
2d8daf20dd ci: create non-root user hasura in graphql engine docker images
https://github.com/hasura/graphql-engine-mono/pull/2307

GitOrigin-RevId: 30aafbc5645b7528ab23482a07deca7ed3c97f9d
2021-09-14 08:18:20 +00:00
Anon Ray
dc1ac69dac server: add parameterized query hash for websocket logs
https://github.com/hasura/graphql-engine-mono/pull/2061

Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
GitOrigin-RevId: bf26b804d93b19ef7fc15c71fec80fb6d6632e64
2021-09-06 12:27:48 +00:00
Abby Sassel
1e7ab8665d server/bigquery: fix data source references & pytest filter in CI
https://github.com/hasura/graphql-engine-mono/pull/2169

GitOrigin-RevId: a0a7190a404ee558a965e06fe1a022953f6f5a10
2021-08-26 18:12:05 +00:00
hasura-bot
50a9dae13b server/bigquery: run tests in CI
GITHUB_PR_NUMBER: 7398
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7398

https://github.com/hasura/graphql-engine-mono/pull/2106

Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 8a20401040c0ca216f8c3c2416243ff4a92b166d
2021-08-19 09:05:45 +00:00
Divi
20b2814a02 ci: add job to build and push base image
https://github.com/hasura/graphql-engine-mono/pull/1924

GitOrigin-RevId: dd402886e67a535aa90afa13f8d9714d92a5daf7
2021-08-19 09:01:51 +00:00
hasura-bot
5c99cebc28 ci: fix test_oss_server_upgrade job
GITHUB_PR_NUMBER: 7403
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7403

https://github.com/hasura/graphql-engine-mono/pull/2117

Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
GitOrigin-RevId: 6d88563445a5d1dc9f1aff0ea1465f04cac07cdb
2021-08-17 12:25:58 +00:00
Divi
ed90bc50f4 add procps package to server builder image
https://github.com/hasura/graphql-engine-mono/pull/2109

GitOrigin-RevId: a687ab86be3db9882a2b4dc963df63d9be9bc0a0
2021-08-16 19:42:36 +00:00
Abby Sassel
6b3db83737 server/bigquery: run tests in CI
server/bigquery: run tests in CI #1525

[Example of successful BigQuery test job](https://app.circleci.com/pipelines/github/hasura/graphql-engine-mono/15951/workflows/86deb614-ddbc-4df5-9af3-288eeff6504a/jobs/283568)

TODO:
- [ ] I'll make corresponding changes in the OSS repo once this is merged
- [ ] @scriptnull or anyone with permissions: to require in CI

https://github.com/hasura/graphql-engine-mono/pull/1741

GitOrigin-RevId: d4ba446e9b13d213de135c73bb72973478575a29
2021-08-12 16:48:29 +00:00
pranshi06
d179a6f2ec server: support EdDSA keys for JWT
https://github.com/hasura/graphql-engine-mono/pull/1818

Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: aae87d34cd19c97e66721a2bd7602d907aeb90b3
2021-08-12 01:54:06 +00:00
hasura-bot
1633160e36 ci: add mssql config to test_console job
GITHUB_PR_NUMBER: 7382
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7382

https://github.com/hasura/graphql-engine-mono/pull/2065

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 6a9c54afa71712eb37e9d12ae7ab68a4edc64911
2021-08-11 06:32:45 +00:00
awjchen
046da3caca Combine oss and pro server configuration
https://github.com/hasura/graphql-engine-mono/pull/1983

GitOrigin-RevId: 91069bd5d1f9c5a166eae2317cf4435220b472b0
2021-08-11 04:19:27 +00:00
Karthikeyan Chinnakonda
06f5e4fb77 server: inherited roles for mutations, remote schemas, actions and custom functions
https://github.com/hasura/graphql-engine-mono/pull/1715

GitOrigin-RevId: 4818292cff8c3a5b264968e7032887a1e98b6f79
2021-08-09 10:21:05 +00:00
Brandon Simmons
0d4a65f73a ci: don't build non-release with enable_coverage, so perf is comparable
https://github.com/hasura/graphql-engine-mono/pull/1980

GitOrigin-RevId: 76ac1ad91025715d0725d3d586e5ab620e94d77a
2021-08-03 16:13:51 +00:00
Karthikeyan Chinnakonda
cb29607833 server: fix mutations bug when inherited roles is enabled
https://github.com/hasura/graphql-engine-mono/pull/1989

GitOrigin-RevId: d4e41431fdf90426651dd1289eb0f0e099de95b9
2021-08-03 11:12:01 +00:00
Aravind K P
899e4bab60 Revert "ci: push cli-ext binary to cdn on tag release"
https://github.com/hasura/graphql-engine-mono/pull/1939

GitOrigin-RevId: 8d078dd6e457cdcbdb9806b1d9b037ac7705ff35
2021-07-29 14:06:21 +00:00
Divi
00902e322e ci: push cli-ext binary to cdn on tag release
https://github.com/hasura/graphql-engine-mono/pull/1846

GitOrigin-RevId: 1f1d61c88925d412c38d2e790c30de96541b6cc9
2021-07-27 09:13:49 +00:00
Karthikeyan Chinnakonda
6bddaa7564 server: inherited roles improvements for select permissions only
https://github.com/hasura/graphql-engine-mono/pull/1539

GitOrigin-RevId: 7444973e9cc7e0598eeb1bd7951ad45dd37ec550
2021-07-16 21:19:58 +00:00
Solomon Bothwell
d88e2bbcce server: add tests ensuring the correct functioning of all endpoints based on user roles
https://github.com/hasura/graphql-engine-mono/pull/1625

Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: 6b56efc838d2ed1acc44b2847161fde22d6aee17
2021-07-16 16:09:25 +00:00
Vishnu Bharathi
6e89653814 ci: uploads ARM64 CLI binaries during deploy
https://github.com/hasura/graphql-engine-mono/pull/1804

GitOrigin-RevId: 3348d15c8869d375bb7bf22bfc53a5d148d1568f
2021-07-16 04:20:01 +00:00
Abby Sassel
1c09e7c8cf cleanup: format .circleci/config.yml files
First up: please let me know if we're already using a YAML file formatter, which one, and I'll close this.

**Otherwise:**

This PR formats .circleci/config.yml files with https://github.com/redhat-developer/yaml-language-server formatter.

**As someone who** edits yaml files infrequently, but with a few default language servers active in my editor,
**I'd like to** edit the file without having to think about formatting or yaml idiosyncrasies
**So that** I can raise a PR and move on with my life 

### Before: incorrect formatting highlighted for 1/5 of `.circleci.config.yaml` file. Difficult to read/edit, and unable to use any common editor integrations
![Screenshot 2021-07-14 at 10 51 41](https://user-images.githubusercontent.com/3883855/125602289-6c0ce457-8a1f-43ea-96f4-1b29e440181a.png)

### After: writing yaml brings me joy now
![Screenshot 2021-07-14 at 11 21 42](https://user-images.githubusercontent.com/3883855/125606378-e6e4ee2a-c44a-40c4-bebe-3e7ab4cb98ae.png)

https://github.com/hasura/graphql-engine-mono/pull/1788

GitOrigin-RevId: d821f3ab5af758e4af3aa442afb0997d76e53c72
2021-07-14 15:24:13 +00:00
hasura-bot
f9e11f6bde server/bugfix: update server_builder_image tag
GITHUB_PR_NUMBER: 7235
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7235

https://github.com/hasura/graphql-engine-mono/pull/1791

Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 2905c0d80341aaeec328460864d35c3a3bc96ee0
2021-07-14 13:14:17 +00:00
Vishnu Bharathi
8a6f3f7e9d cli: support ARM architecture
https://github.com/hasura/graphql-engine-mono/pull/1534

GitOrigin-RevId: 67723bb64e2505c665b04b5b0d691e5599843f87
2021-07-14 08:54:43 +00:00
Aniket Deshpande
3bdd777ec4 MySQL: Add mysql-client dependencies on CI and in .cabal file
https://github.com/hasura/graphql-engine-mono/pull/1514

Co-authored-by: Sibi Prabakaran <737477+psibi@users.noreply.github.com>
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
GitOrigin-RevId: 81fd23f439e8c3db8149fedae2855db1e84a60a3
2021-07-12 20:07:46 +00:00
Sooraj
effb221d97 console: fix test_oss_console ci errors
https://github.com/hasura/graphql-engine-mono/pull/1726

GitOrigin-RevId: ae87ca45a111fcdb25ba9c53c1bfd8650e1be78c
2021-07-12 10:40:50 +00:00
Aniket Deshpande
66f09eeaab MSSQL nodes aggregates & inherited roles
https://github.com/hasura/graphql-engine-mono/pull/1293

Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 776402dbbaf3d8166a62b1aaaf6abc7e584b3eb2
2021-07-08 20:50:09 +00:00
hasura-bot
35ab147dd9 server/citus: run tests in CI (OSS changes)
GITHUB_PR_NUMBER: 7161
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7161

https://github.com/hasura/graphql-engine-mono/pull/1711

Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 7acbfdad71d9c26fb1bb015f66f844988927bdc8
2021-07-02 05:19:58 +00:00
Abby Sassel
5b7d949ef4 server/citus: run tests in CI
https://github.com/hasura/graphql-engine-mono/pull/1526

GitOrigin-RevId: 4fd4214a799bc0d91cd2d29b1ea444f80714f6bc
2021-07-01 14:41:12 +00:00
Brandon Simmons
f1b1dc109e tests: document server-upgrade-downgrade test
https://github.com/hasura/graphql-engine-mono/pull/1658

GitOrigin-RevId: c097de5758847ee01e5cb4f049a662338f6a4dda
2021-06-29 18:39:30 +00:00
Divi
bcb5baf63b ci: make deploy job dependent on cli, console test jobs
https://github.com/hasura/graphql-engine-mono/pull/1663

GitOrigin-RevId: 6731c33adcbfff9ba972fca226d9f3245496233c
2021-06-25 14:07:14 +00:00
kodiakhq[bot]
a11b4135fc Use exceptions to handle compatibility with pg 9.6 in 2.0 upgrade migration
https://github.com/hasura/graphql-engine-mono/pull/1651

Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: cdb4a33cbb1a136bc30e8f0dd59aaae584d3a636
2021-06-24 02:20:11 +00:00
Rakesh Emmadi
13bedf5821 server/postgres: fix resetting the metadata catalog version to 43 while initializing postgres source with 1.0 catalog (#1645)
* fix resetting the catalog version to 43 on migration from 1.0 to 2.0

* ci: remove applying patch in test_oss_server_upgrade job

* make the 43 to 46th migrations idempotent

* Set missing HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE=8 in upgrade_test

It's not clear why this wasn't caught in CI.

* ci: disable one component of event backpressure test

Co-authored-by: Vishnu Bharathi P <vishnubharathi04@gmail.com>
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GitOrigin-RevId: c74c6425266a99165c6beecc3e4f7c34e6884d4d
2021-06-23 18:01:09 +00:00
Abby Sassel
b6b1354a2b server/mssql: Fix sqlcmd symlink Dockerfile
https://github.com/hasura/graphql-engine-mono/pull/1578

GitOrigin-RevId: 97d793b42b029cd51a8a96699ca4a67f1463d349
2021-06-15 19:45:08 +00:00
hasura-bot
6d8a441e64 ci: renames mssql test job (#1567)
GITHUB_PR_NUMBER: 7059
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7059

https://github.com/hasura/graphql-engine-mono/pull/1567

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 12d4cfdb8aee13644c0b9eed56d152e74335dd24
2021-06-14 14:41:20 +00:00
Abby Sassel
34de64bcdf server/mssql: run tests in CI (#1452)
https://github.com/hasura/graphql-engine-mono/pull/1452

GitOrigin-RevId: 9fd345f7e5c24ebc3f47bdd0b15f84c9b8766f0c
2021-06-14 07:31:42 +00:00
Aravind K P
d8198a8bad cli,ci: testsuite enhancements
- remove `HASURA_TEST_CLI_HGE_DOCKER_TAG` & `HASURA_TEST_CLI_HGE_DOCKER_REPO` env variables
- add `HASURA_TEST_CLI_HGE_DOCKER_IMAGE` environment variable to configure hge image used in tests
- add template test project directories
- add helper functions to manipulate the template projects in individual tests
- add config v2 tests

Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
GitOrigin-RevId: 009a74c042861ff0a8dec2b06002e55de3a8a629
2021-06-03 13:27:24 +00:00
Karthikeyan Chinnakonda
7d630e8147 build: use the debian buster version in the docker image
GitOrigin-RevId: 51077f8b5d0c5bdf06a6560444f89d74a3660336
2021-05-27 07:50:15 +00:00
hasura-bot
07adb7b273 ci: update server builder to correct version
GITHUB_PR_NUMBER: 6945
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6945

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: b0c20d6b249f1659ef076881a3aeb2f84b96eaf7
2021-05-18 12:16:34 +00:00
Vishnu Bharathi
ebc01c2378 cli, ci: enables docker based tests
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: d7a53e512d296bdd4b2119bb1d0b89e30da7d476
2021-05-17 00:30:08 +00:00
Aravind K P
2d126342f8 ci: move "install deps" in server test CI jobs to server image builder
GitOrigin-RevId: 8e4388a856b7bae4abcd3c9db289826e89128f8b
2021-05-12 15:25:30 +00:00
kodiakhq[bot]
a935746e17 Integration test improvements (for speed/clarity), also increase polling interval for scheduled events
This claws back ~7min from integration tests (run serially, as with `dev.sh test --integration`
Further improvements would do well to focus on optimizing metadata operations, as `setup` dominates

GitOrigin-RevId: 76637d6fa953c2404627c4391447a05bf09355fa
2021-04-27 05:35:26 +00:00
Vishnu Bharathi
7821b34a2c ci,console,pro-console: build pro console using local oss console
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: f9a918422a0d22bc1775fabedb603c3311673afb
2021-04-12 18:50:02 +00:00
Aravind K P
6d4e0266c9 ci: refactor build steps of cli
GitOrigin-RevId: 918276b6883fe15b2be93fae2dd260acc959ff69
2021-04-08 12:51:07 +00:00
Sooraj
9130fa8b8f console/ci: add unit tests
GitOrigin-RevId: 01c9328a298dc6e53b910fa05d7587614c324f20
2021-04-07 13:28:13 +00:00
Aravind K P
1cc3a66fef cli-migrations,ci: add config v3 image
GitOrigin-RevId: ee04d046fd70355495fb18976ebfcca00454c0da
2021-04-06 09:59:16 +00:00
Aleksandra Sikora
dc17de8571 console/ci: add missing env var
GitOrigin-RevId: 15621e6174a339c4741970f9ce9d60a1ae93afa5
2021-03-24 20:58:15 +00:00
Ikechukwu Eze
81f527a7ee console/ci: upgrade terser and drop large resource class for console build
GitOrigin-RevId: 1e352fa17b7561cfe618bd3cb9f0f75be3e95c73
2021-03-24 19:22:41 +00:00
hasura-bot
e0ec670b05 ci: fix missing postgres envs in test_server (#949)
Co-authored-by: Vishnu Bharathi P <vishnubharathi04@gmail.com>
GITHUB_PR_NUMBER: 6708
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6708

Co-authored-by: Vishnu Bharathi P <vishnubharathi04@gmail.com>
GitOrigin-RevId: ef035813e9dd4f5e61e62889068222d49bbaa350
2021-03-24 14:38:18 +00:00
Vishnu Bharathi P
d6c4f95e27 ci: use large resource class for build_console job
GitOrigin-RevId: cc9f1d18ad455bf16372bc5ba0e2c705224338b9
2021-03-18 08:44:39 +00:00
Abhijeet Singh Khangarot
1c1198c93b console: remote schema permissions bug fixes
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 78c4e144ea32ab1376f36272fab0204c2bd88ef0
2021-03-17 15:57:36 +00:00
hasura-bot
2099208e4b cli: merges cli-ext with cli
GITHUB_PR_NUMBER: 6640
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6640

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 362d82d8ee18afd7efa63e9c8912f6c5444f82dd
2021-03-17 15:10:03 +00:00
kodiakhq[bot]
c8934d0b57 circleci: Use backport of Matt Pickering's memory reclamation RTS patch in CI
A few cleanups in CI, and use Matt's patch for better idle memory reclamation.

See Swann's report here: https://docs.google.com/document/d/1K1ofxYCIDdO75_UOAqJHn3CeMNE78MrJIJR-GG9iEKg/edit
And patch here: 29d4df0f5e

GitOrigin-RevId: ecdd4cbdd4244a8abf022078525c1843bf2a4aea
2021-03-12 02:09:21 +00:00
Karthikeyan Chinnakonda
92026b769f [Preview] Inherited roles for postgres read queries
fixes #3868

docker image - `hasura/graphql-engine:inherited-roles-preview-48b73a2de`

Note:

To be able to use the inherited roles feature, the graphql-engine should be started with the env variable `HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` set to `inherited_roles`.

Introduction
------------

This PR implements the idea of multiple roles as presented in this [paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/FGALanguageICDE07.pdf). The multiple roles feature in this PR can be used via inherited roles. An inherited role is a role which can be created by combining multiple singular roles. For example, if there are two roles `author` and `editor` configured in the graphql-engine, then we can create a inherited role with the name of `combined_author_editor` role which will combine the select permissions of the `author` and `editor` roles and then make GraphQL queries using the `combined_author_editor`.

How are select permissions of different roles are combined?
------------------------------------------------------------

A select permission includes 5 things:

1. Columns accessible to the role
2. Row selection filter
3. Limit
4. Allow aggregation
5. Scalar computed fields accessible to the role

 Suppose there are two roles, `role1` gives access to the `address` column with row filter `P1` and `role2` gives access to both the `address` and the `phone` column with row filter `P2` and we create a new role `combined_roles` which combines `role1` and `role2`.

Let's say the following GraphQL query is queried with the `combined_roles` role.

```graphql
query {
   employees {
     address
     phone
   }
}
```

This will translate to the following SQL query:

```sql

 select
    (case when (P1 or P2) then address else null end) as address,
    (case when P2 then phone else null end) as phone
 from employee
 where (P1 or P2)
```

The other parameters of the select permission will be combined in the following manner:

1. Limit - Minimum of the limits will be the limit of the inherited role
2. Allow aggregations - If any of the role allows aggregation, then the inherited role will allow aggregation
3. Scalar computed fields - same as table column fields, as in the above example

APIs for inherited roles:
----------------------

1. `add_inherited_role`

`add_inherited_role` is the [metadata API](https://hasura.io/docs/1.0/graphql/core/api-reference/index.html#schema-metadata-api) to create a new inherited role. It accepts two arguments

`role_name`: the name of the inherited role to be added (String)
`role_set`: list of roles that need to be combined (Array of Strings)

Example:

```json
{
  "type": "add_inherited_role",
  "args": {
      "role_name":"combined_user",
      "role_set":[
          "user",
          "user1"
      ]
  }
}
```

After adding the inherited role, the inherited role can be used like single roles like earlier

Note:

An inherited role can only be created with non-inherited/singular roles.

2. `drop_inherited_role`

The `drop_inherited_role` API accepts the name of the inherited role and drops it from the metadata. It accepts a single argument:

`role_name`: name of the inherited role to be dropped

Example:

```json

{
  "type": "drop_inherited_role",
  "args": {
      "role_name":"combined_user"
  }
}
```

Metadata
---------

The derived roles metadata will be included under the `experimental_features` key while exporting the metadata.

```json
{
  "experimental_features": {
    "derived_roles": [
      {
        "role_name": "manager_is_employee_too",
        "role_set": [
          "employee",
          "manager"
        ]
      }
    ]
  }
}
```

Scope
------

Only postgres queries and subscriptions are supported in this PR.

Important points:
-----------------

1. All columns exposed to an inherited role will be marked as `nullable`, this is done so that cell value nullification can be done.

TODOs
-------

- [ ] Tests
   - [ ] Test a GraphQL query running with a inherited role without enabling inherited roles in experimental features
   - [] Tests for aggregate queries, limit, computed fields, functions, subscriptions (?)
   - [ ] Introspection test with a inherited role (nullability changes in a inherited role)
- [ ] Docs
- [ ] Changelog

Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 3b8ee1e11f5ceca80fe294f8c074d42fbccfec63
2021-03-08 11:15:10 +00:00
Karthikeyan Chinnakonda
d2418383bf server: add https remote schema tests
GitOrigin-RevId: 9e9e66248f956174dc8197adeb7a48da12e53dac
2021-03-02 16:52:47 +00:00
Karthikeyan Chinnakonda
4211d27272 server: support reading JWT from Cookie header
GitOrigin-RevId: 1de90242d3c000361f87256c2dddce1677863231
2021-02-25 09:03:46 +00:00
Aravind K P
65ea2f4c1b ci: update cli and console builder images
Co-authored-by: Rishichandra Wawhal <27274869+wawhal@users.noreply.github.com>
GitOrigin-RevId: 1c14fc13a8ce9569a721dba1d9bd67c45292ce06
2021-02-24 07:42:42 +00:00
Vladimir Ciobanu
281cb771ff server: add MSSQL support
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 699c453b9692e1b822f393f23ff5e6db4e010d57
2021-02-23 17:38:36 +00:00
Aravind K P
730ac1aed4 ci: stop building and pushing cli-migrations-v1 image in deploy step (#602)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
GitOrigin-RevId: 2e0b6f39a953116273a6dcaa59c06371844519f2
2021-02-19 11:49:02 +00:00
Karthikeyan Chinnakonda
77b3bb5a20 server: run function permissions tests in CI
GitOrigin-RevId: 750b44d0f30df506eb8f0a8eec42fcd1a7d51599
2021-02-18 08:27:00 +00:00
Aravind K P
a0995d1b30 cli: add client package, statestore implementations, deprecate config v1
GitOrigin-RevId: 5a1d9cb772ac62603f2543bfe6c01a95c0a035c6
2021-02-17 04:21:11 +00:00
Vishnu Bharathi
341837b652 ci,cli-ext: adds pkg as dev dependency and updates build instructions
Fixes https://github.com/hasura/graphql-engine/issues/6426

GitOrigin-RevId: 913a9e1de4bac7c96cbeab139e7593ee2ddc578b
2021-02-08 08:04:00 +00:00
Swann Moreau
c14dcd5792 pass gql requests into auth webhook POST body (#149)
* fix arg order in UserAuthentication instance [force ci]

* change the constructor name to AHGraphQLRequest

Co-authored-by: Stylish Haskell Bot <stylish-haskell@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GitOrigin-RevId: fb3258f4a84efc6c730b0c6222ebd8cea1b91081
2021-02-03 07:11:39 +00:00
Karthikeyan Chinnakonda
10a3f9960d server: new function permissions layer
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 35645121242294cb6bb500ea598e9a1f2ca67fa1
2021-01-29 05:49:09 +00:00
Rakesh Emmadi
ff3c58f230 ci: fix oss test server upgrade ci test when upgrading from 1.3.3
GitOrigin-RevId: a5b663ea5b079212c063f15bc67559f5a234f96f
2021-01-28 11:40:24 +00:00
Swann Moreau
d4b474061f server: split server test suite to run in parallel on circleci (#309)
Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi P <vishnubharathi04@gmail.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Nizar Malangadan <nizar-m@users.noreply.github.com>
Co-authored-by: nizar-m <19857260+nizar-m@users.noreply.github.com>
GitOrigin-RevId: b8a1e9c3ba4797bad8dbb2daa75d23d4ad163546
2021-01-25 08:24:13 +00:00
Aleksandra Sikora
b4fd2e3f9f console and cli: run console in CLI mode for tests, misc CLI fixes (#368)
GitOrigin-RevId: 4563444387a4c9d02b5429729fe30bc87763288f
2021-01-20 20:18:44 +00:00