Commit Graph

3391 Commits

Author SHA1 Message Date
Rikin Kachhia
8af24e9acc docs: update cloud project transfer guide
https://github.com/hasura/graphql-engine-mono/pull/2105

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: cd7cf61c1de0c6ba3e4b0c5fbc9f9943d17e2c0c
2021-08-17 09:10:37 +00:00
Brandon Simmons
c3300534b0 benchmarks: add a utility for viewing performance of a branch over time
https://github.com/hasura/graphql-engine-mono/pull/2111

GitOrigin-RevId: 98df2fb1ff67ce8482925dc068e285bcdf4e2bd4
2021-08-17 07:56:41 +00:00
Karthikeyan Chinnakonda
1294ae59f2 server: fix bug when downgrading from v2 to v1 when there is atleast one cron trigger present in the metadata
https://github.com/hasura/graphql-engine-mono/pull/2101

GitOrigin-RevId: 7011f0c18cb0cef828214ec084adc39cfb3aba1c
2021-08-17 07:02:09 +00:00
Karthikeyan Chinnakonda
ef2278f9c7 server: add an index on event_id in hdb_cron_event_invocation_logs table
https://github.com/hasura/graphql-engine-mono/pull/2083

GitOrigin-RevId: b5748424c7b685a0bad2117adfe0eb189e40197c
2021-08-17 05:45:11 +00:00
Robert
c1bdc99334 Fix comment formatting to allow parsing in haddock-mode
This is just a one-off fix, based on running ormolu across
the code base, which uses GHC's parser in haddock mode.

### Description

Fixes several instances of illegal haddock comments.

### Related Issues

#1679

### Steps to test and verify

Run ormolu over the codebase. Prior to this change, it complains that it
can't parse certain files due to malformed Haddock comments, after it
doesn't (there are still some other errors).

### Limitations, known bugs & workarounds

This doesn't ensure that we don't introduce similar issues in the future;
that'll be dealt with once we implement #1679.

#### Breaking changes

- [x] No Breaking changes, only touches code comments

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

GitOrigin-RevId: 7fbab0325ce13a16a04ff98d351f1af768e25d7c
2021-08-16 22:20:25 +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
Ikechukwu Eze
64a5c52904 console: support computed fields in permission builder
>

### Description
>

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Console

### Related Issues
closes [#7336](https://github.com/hasura/graphql-engine/issues/7336)

### Steps to test and verify

- Add a scalar computed field with only table row as argument, to the table you want to use for testing
- Then head to table's permission tab, and try to use permission builder to set permissions for any role
- confirm that computed fields are listed as options along table columns

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

GitOrigin-RevId: 2cd16ca4a0e6a6288d4b62549ebe1aaaf841952b
2021-08-16 12:28:03 +00:00
Abhijeet Khangarot
5de2ef7d31 console: allow same named queries and unnamed queries on allowlist file upload
https://github.com/hasura/graphql-engine-mono/pull/1906

GitOrigin-RevId: bdd752f49213a2056f39050d40d3dc299dc07819
2021-08-16 09:23:12 +00:00
Swann Moreau
c2261e3bb8 [server] ignore hie.yaml at the root of the repo
with #1983, `hie.yaml` goes at the root of the monorepo, but it's not in the gitignore

not sure if any other fixes will be required to mirror stuff to oss though

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

Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
GitOrigin-RevId: b96c0bfd92113d131ed2265fcf03fe08f068f014
2021-08-16 07:32:33 +00:00
Aravind K P
f2e74da5aa cli: improve cli package error propogation in migrate operations
https://github.com/hasura/graphql-engine-mono/pull/1887

GitOrigin-RevId: 40c7e1a16e8dd25a46e0c58afc7cbc9169af8f0b
2021-08-16 06:44:05 +00:00
Rikin Kachhia
e66bf923cf docs: add guide to transfer cloud project manually
https://github.com/hasura/graphql-engine-mono/pull/2088

GitOrigin-RevId: f5f7fbc8ad12574bf4c7d5fc4dc645a8772e3398
2021-08-13 14:30:22 +00:00
Rikin Kachhia
f0fb324b2c docs: add note to cleanup large event/cron logs before v2 update
https://github.com/hasura/graphql-engine-mono/pull/2089

GitOrigin-RevId: 007ccf652a0f81583e382d6cdcb95a55c29a5feb
2021-08-13 13:54:43 +00:00
Rikin Kachhia
aaa417898c docs: misc fixes
- fix broken refs and formatting errors
- add "deprecated" to v1/query api pages
- github integration -> github deployment
- remove secure cloud project page

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

GitOrigin-RevId: 79e593b21838d87b9e22ca1f1ad629ac53f23b44
2021-08-13 13:46:04 +00:00
Sandeep Raj Kumar
2e4bd38d9d docs: Azure flexible server requirement of disabled JIT for hasura 1.x
https://github.com/hasura/graphql-engine-mono/pull/1215

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: a07354ddb35df29c7f1625e2055a9aa66dec3955
2021-08-13 12:32:51 +00:00
Gil Mizrahi
904029aa7d Add fancier trace debugging functions to Hasura.Prelude
## Suggestion: Add fancier trace debugging functions to `Hasura.Prelude`

This PR adds two trace functions, `ltrace` and `ltraceM`, which use the `pretty-simple` package to `show` the input with nice formatting and colors for ease of reading (and comparing using diff tools such as `meld` or `vim-diff`).

I've also added warning pragmas to the functions, which means:
1. Traces will not be left in code, as CI builds with -Werror
2. Developers will have to change the `ghc-options` to `-Wwarn` in their `cabal.project.local` settings to use these functions

### Example

Usage:

```hs
selectFunctionAggregate ... = ... do
  ltraceM "functionInfo" function
  ...
```

Output to terminal looks like this:

<img width="524" alt="Screen Shot 2021-08-12 at 10 33 24" src="https://user-images.githubusercontent.com/8547573/129158878-4a5e96ba-30a5-452c-8f33-9eb4b2cc5e2a.png">

### Dependencies

Requires adding the following dependencies:
  - prettyprinter-ansi-terminal-1.1.2 (BSD2)
  - pretty-simple-4.0.0.0 (BSD3)

Question: what is the process for adding new dependencies? How does decisions on this matter happen?

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

GitOrigin-RevId: 490b0f0ca595da319b43e92e190ba50c0b132cd5
2021-08-12 19:33:56 +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
Rakesh Emmadi
c2f667a06d server: correctly generate remote relationship field type
>

### Description
>
From HGE version 2.0 onwards, all remote relationship fields are generated as plain types without non-nullable and lists. This PR fixes the same.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [x] Tests

### Related Issues
->
fix https://github.com/hasura/graphql-engine/issues/7284

### Steps to test and verify
>
- Create a remote relationship to a field in remote schema with non-nullable or list type
- The HGE introspection should give the remote relationship field type correctly as like in the remote schema

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

GitOrigin-RevId: e113f5d17b62bfa0a25028c20260ae1782ae224b
2021-08-12 12:17:52 +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
Sameer Kolhar
3f35a9a219 console: support creation of indexes on the console for postgres sources
https://github.com/hasura/graphql-engine-mono/pull/358

Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
GitOrigin-RevId: cd4a5073fb361fe1235f5d49a0dc9b025fc1379f
2021-08-11 18:02:56 +00:00
Gil Mizrahi
39c9e9f7e3 Move symbolically linked cabal files for dev.sh from server directory to root directory
https://github.com/hasura/graphql-engine-mono/pull/2069

GitOrigin-RevId: 8340cd0932fbb7f166be53c392489c998325dca9
2021-08-11 16:50:59 +00:00
Gil Mizrahi
5ca5e105a1 Fix telemetry unit test by sorting before comparing
https://github.com/hasura/graphql-engine-mono/pull/2068

GitOrigin-RevId: 62147b29c1899e43156e5f5d7f0fb67eda00647a
2021-08-11 15:36:30 +00:00
Vijay Prasanna
5d6211d3dc console/inherited-roles: allow resolution of conflicting permissions
https://github.com/hasura/graphql-engine-mono/pull/2027

GitOrigin-RevId: 896759f70aa95bf4b16766cc6e4ca38cf10878e1
2021-08-11 14:21:14 +00:00
Evie Ciobanu
11b3e1573d [server] generate the correct type for single-row returning functions
https://github.com/hasura/graphql-engine-mono/pull/2055

GitOrigin-RevId: 94c1cc32028054c7ec11d6ada2fc57f0820a4d5e
2021-08-11 12:42:30 +00:00
Nicolas Beaussart
e063835b83 console: fix ui for template gallery when there is no image
https://github.com/hasura/graphql-engine-mono/pull/1940

GitOrigin-RevId: 97fca7b6423309c22a1072b9e380ba724d7bad00
2021-08-11 11:24:04 +00:00
Praveen Durairaju
aaff5a5f71 docs: update getting started guide
>

### Description
>
This PR updates the getting started guide to change docker setup into having its own paragraph. Additionally this PR also removes the extra Contact Us link under Additional Resources.

### Changelog

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [ ] Docs

Preview Link - https://deploy-preview-2067--hasura-docs-mono.netlify.app/graphql/core/getting-started/index.html#quickstart-guides

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

GitOrigin-RevId: 135fc75cc1083598b89622828ec825ba8498fb0d
2021-08-11 09:26:46 +00:00
nevermore
05a12912aa console: change HEROKU_DATABASE_URL to PG_DATABASE_URL while creating datasource on cloud
https://github.com/hasura/graphql-engine-mono/pull/2050

GitOrigin-RevId: d40b32feb2015780865ad4d74e442fbdc3da82b8
2021-08-11 09:23:19 +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
Solomon Bothwell
a46cf20505 Adds PG Client Cert Metadata API Documentation
https://github.com/hasura/graphql-engine-mono/pull/1884

Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 3f41300d4621e0402fa95e09eb0369be02515ac1
2021-08-11 04:23:50 +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
Tirumarai Selvan
7b863a1b3b tag release v2.0.6
GitOrigin-RevId: b2b906cf7b05bc444148a334aba42385046be75c
2021-08-11 01:19:22 +00:00
Nicolas Beaussart
a226d514af console: add tailwindcss for styles
https://github.com/hasura/graphql-engine-mono/pull/2032

GitOrigin-RevId: d6552e990823acc3bdac829487e91ae931ac4345
2021-08-10 13:46:52 +00:00
Varun Choudhary
a4b01b2756 console: auto suggest gen_random_uuid() while adding a default value to UUID type column in schema other than public
https://github.com/hasura/graphql-engine-mono/pull/1910

GitOrigin-RevId: c2ee953ca7cd72fc7cc143465be2fe84e4284636
2021-08-10 05:55:41 +00:00
Brandon Simmons
a0118c99db server benchmarks: minor fixup of afbdb8d74
https://github.com/hasura/graphql-engine-mono/pull/2039

GitOrigin-RevId: 263e7eb3d483eed644d3c41aee6c6e733b2f3633
2021-08-09 19:28:47 +00:00
hasura-bot
5e17966ce7 Update 28_to_29.sql
GITHUB_PR_NUMBER: 7335
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7335

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

Co-authored-by: Eduardo <5448062+eduardomazolini@users.noreply.github.com>
GitOrigin-RevId: a7d6d6548f742a3389fa270bfc0446622356f95c
2021-08-09 16:36:44 +00:00
Vijay Prasanna
74704801cb console/tests: add manage db tests for mssql
https://github.com/hasura/graphql-engine-mono/pull/1782

Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 1ed4c6d09d2dbd6f68faacd83e7daae916cff972
2021-08-09 14:04:54 +00:00
Rakesh Emmadi
1f3ea7b5eb server: document metadata versioning
This PR adds source code documentation for metadata versioning.

Note: Adding `force-skip-ci` label to bypass server tests as this PR only has changes in source code comments.

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

GitOrigin-RevId: f24dcc1579f98e59e40677b99890a8af273bb96e
2021-08-09 12:44:41 +00:00
hasura-bot
34a011acbc docs: fix typo in MSSQL docs
GITHUB_PR_NUMBER: 7369
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7369

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

Co-authored-by: Vishwa Mehta <32997409+mehtavishwa30@users.noreply.github.com>
GitOrigin-RevId: 24e862d1fa023d6210cd1716a52ba1135d457ca1
2021-08-09 11:05:17 +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
Kali Vara Purushotham Santhati
4d7aa0e105 cli: fix query endpoint construction
closes https://github.com/hasura/graphql-engine/issues/7196

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

GitOrigin-RevId: ab7c765d4de710dd08f48dc1bfb94eb606ac5d3f
2021-08-09 08:41:16 +00:00
Divi
8aa8929b13 cli-ext: add docs for compiling cli-ext for new targets
https://github.com/hasura/graphql-engine-mono/pull/2041

GitOrigin-RevId: 95d5aeaaf621fe7714ab8045327e80232b811897
2021-08-09 07:15:14 +00:00
Aniket Deshpande
a9fb2710db server/bigquery: implement _in and _nin operators. (close #7343)
https://github.com/hasura/graphql-engine-mono/pull/2033

GitOrigin-RevId: 58d4de268b62c6d7cb6106bec38214e651926816
2021-08-06 19:58:33 +00:00
Brandon Simmons
681113f1d8 Jberryman/1993 skip just report mode
https://github.com/hasura/graphql-engine-mono/pull/2028

Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: afbdb8d74bede1e78b054f5582cbf144bba20762
2021-08-06 18:41:27 +00:00
Lyndon Maydwell
d483109443 Revert "Disable TLS checks for actions services with self-signed certificates"
Reverts hasura/graphql-engine-mono#1595

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

GitOrigin-RevId: b32adde77b189c14eef0090866d58750d1481b50
2021-08-06 17:06:55 +00:00
Brandon Simmons
bdf0954c9d server benchmarks: Link directly to graphs in regression report, other style tweaks (#1720)
Depends on https://github.com/hasura/graphql-bench/pull/46

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

GitOrigin-RevId: ef7c5909e56cb1a945b20d5e072ee103bbd8a5ea
2021-08-06 15:49:56 +00:00
jkachmar
4a83bb1834 Remote schema execution logic
https://github.com/hasura/graphql-engine-mono/pull/1995

Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: 178669089ec5e63b1f3da1d3ba0a9f8debbc108d
2021-08-06 13:40:37 +00:00
Antoine Leblanc
52d91e3e8d Update GraphQL Parser version to fix text encoding issue (fix #1965)
### A long tale about encoding

GraphQL has an [introspection system](http://spec.graphql.org/June2018/#sec-Introspection), which allows its schema to be introspected. This is what we use to introspect [remote schemas](41383e1f88/server/src-rsr/introspection.json). There is one place in the introspection where we might find GraphQL values: the default value of an argument.

```json
{
  "fields": [
    {
      "name": "echo",
      "args": [
        {
          "name": "msg",
          "defaultValue": "\"Hello\\nWorld!\""
        }
      ]
    }
  ]
}
```

Note that GraphQL's introspection is transport agnostic: the default value isn't returned as a JSON value, but as a _string-encoded GraphQL Value_. In this case, the value is the GraphQL String `"Hello\nWorld!"`. Embedded into a string, it is encoded as: `"\"Hello\\nWorld!\""`.

When we [parse that value](41383e1f88/server/src-lib/Hasura/GraphQL/RemoteServer.hs (L351)), we first extract that JSON string, to get its content, `"Hello\nWorld!"`, then use our [GraphQL Parser library](21c1ddfb41/src/Language/GraphQL/Draft/Parser.hs (L200)) to interpret this: we find the double quote, understand that the content is a String, unescape the backslashes, and end up with the desired string value: `['H', 'e', 'l', 'l', 'o', '\n', 'W', 'o', 'r', 'l', 'd', '!']`. This all works fine.

However, there was a bug in the _printer_ part of our parser library: when printing back a String value, we would not re-escape characters properly. In practice, this meant that the GraphQL String `"Hello\nWorld"` would be encoded in JSON as `"\"Hello\nWorld!\""`. Note how the `\n` is not properly double-escaped. This led to a variety of problems, as described in #1965:
- we would successfully parse a remote schema containing such characters in its default values, but then would print those erroneous JSON values in our introspection, which would _crash the console_
- we would inject those default values in queries sent to remote schemas, and print them wrong doing so, sending invalid values to remote schemas and getting errors in result

It turns out that this bug had been lurking in the code for a long time: I combed through the history of [the parser library](https://github.com/hasura/graphql-parser-hs), and as far as I can tell, this bug has always been there. So why was it never caught? After all, we do have [round trip tests](21c1ddfb41/test/Spec.hs (L52)) that print + parse arbitrary values and check that we get the same value as a result. They do use any arbitrary unicode character in their generated strings. So... that should have covered it, right?

Well... it turns out that [the tests were ignoring errors](7678066c49/test/Spec.hs (L45)), and would always return "SUCCESS" in CI, even if they failed... Furthermore, the sample size was small enough that, most of the time, _they would not hit such characters_. Running the tests locally on a loop, I only got errors ~10% of the time...

This was all fixed in hasura/graphql-parser-hs#44. This was probably one of Hasura's longest standing bugs? ^^'

### Description

This PR bumps the version of graphql-parser-hs in the engine, and switches some of our own arbitrary tests to use unicode characters in text rather than alphanumeric values. It turns out those tests were much better at hitting "bad" values, and that they consistently failed when generating arbitrary unicode characters.

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

GitOrigin-RevId: 54fa48270386a67336e5544351691619e0684559
2021-08-06 11:54:45 +00:00
Antoine Leblanc
2c0a8d818c Kill Arbitrary, take 2 (fix #1736)
### Description

A first PR, #1947, removed all the `Arbitrary` stuff from our codebase. But #1740, merged on the same day, added some tests relying on `Arbitrary`. In the merge process, some unneeded `Arbitrary` code got reintroduced.

This PR removes all `Arbitrary` stuff from `src-lib`, and cleans / refactor `Hasura.Generator` in `src-test` to only reduce it to the bare minimum amount of `Arbitrary` instances.

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

GitOrigin-RevId: 7e76009bb022205e3737fca45749411a266cc08c
2021-08-06 10:18:37 +00:00
hasura-bot
e78bc4b0ed console: export metadata before tracking new table (fix #6805) (fix #7221) (fix #7233)
GITHUB_PR_NUMBER: 7330
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7330

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

Co-authored-by: Kenneth J. Miller <6822406+KloudJack@users.noreply.github.com>
GitOrigin-RevId: 9532f7b596801ebcdd15bd40a9b3ace0b9b88326
2021-08-06 09:09:34 +00:00
Kali Vara Purushotham Santhati
0341037aeb cli-ext: fix sdl formatting
closes https://github.com/hasura/graphql-engine/issues/7296

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

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 41383e1f88c709c6cae4059a1b4fb8f2a58259e6
2021-08-06 05:01:07 +00:00
Lyndon Maydwell
f6987ca4ff Disable TLS checks for actions services with self-signed certificates
https://github.com/hasura/graphql-engine-mono/pull/1595

GitOrigin-RevId: 3834e7d005bfaeaa7cc429c9d662d23b3d903f5c
2021-08-06 03:01:24 +00:00