Commit Graph

4508 Commits

Author SHA1 Message Date
Samir Talwar
f72d8f09d9 Makefile: Run ormolu --check and shellcheck as part of linting.
In the interest of having a single command to run before committing in order to check for basic errors, I propose `make lint-changed`.

This enhances `make lint` and `make lint-changed` to run `ormolu` and `shellcheck`, in line with CI.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4727
GitOrigin-RevId: 05c860a86ce40b0f52c6aa2d333c0af23aea070e
2022-06-15 10:27:10 +00:00
Samir Talwar
1f2f9a8f94 server: Fix up the instructions on testing against BigQuery.
This improves the experience of testing against BigQuery in a few ways:

1.  There is an explicit instruction to create a dataset, which was not
    documented.
2.  The verification script uses the environment variables, just like the
    tests.
3.  The verification script passes the correct content type headers.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4706
GitOrigin-RevId: 15b5bd28b1762c130c0ec09d6babe8c08e05ab15
2022-06-15 09:45:19 +00:00
Tom Harding
0f553cf1a3 Remove Data.Set.Extended
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4698
GitOrigin-RevId: 06104ea4c67301f058bb24fd395707bb69721954
2022-06-15 09:02:23 +00:00
Gil Mizrahi
5dd3f71539 server/telemetry: support multiple sources
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4493
GitOrigin-RevId: 3b34ea0aa6f78fa43c8d372d8b61d49191632eff
2022-06-15 08:03:31 +00:00
Daniel Harvey
9ee4d248cb Update MacOS setup instructions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4715
GitOrigin-RevId: 9b2634084cfffecef5bde3645fd1dceaced8960e
2022-06-15 07:08:23 +00:00
paritosh-08
0dd6e69131 server: fix incorrectly ignoring the experimental feature naming_convention
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4728
GitOrigin-RevId: 5ed2406ec15d3fbbd3d8a31f28da5c217810804a
2022-06-15 05:21:15 +00:00
Daniel Harvey
66ac7ea1aa tooling: use nvm to manage NodeJS version in monorepo
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4714
GitOrigin-RevId: 2392cea36e4c5c34beab09bbffc8bdb57e35193a
2022-06-14 17:52:05 +00:00
Jesse Hallett
f14891c64b docs: add info to server error message when env var missing in webhook preview
When a user changes request options in a custom action through the
console that triggers a request to the server to test webhook transform
options, and to show a preview of the result. If the action uses an
environment variable in its webhook URL, and there is no mock value for
that variable in the action's sample context then the user will see an
error. This change expands the error message to explain what caused the
error, and how to fix it.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4556
GitOrigin-RevId: 75b19bae17aac982c2bdfbd4417bd55923889f2f
2022-06-14 16:25:41 +00:00
Samir Talwar
ed1dc00bb8 Add Makefile targets to run hlint on all and changed files.
* `make lint-hs` will lint all files.
* `make lint-hs-changed` will lint all modified files on this branch.
* `make lint` will delegate to `make lint-hs`.
* `make lint-changed` will delegate to `make lint-hs-changed`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4720
GitOrigin-RevId: d872f5b672b1d06100cd9fdaa5e60dc8bb5cae86
2022-06-14 15:21:36 +00:00
Sean Park-Ross
8e69fde547 docs: restructure cron trigger create section
## Description ✍️
Tiny fix for Cron Trigger casing @rikinsk identified earlier.

edit: restructured the create cronn section

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4666
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 356426d76d64a907d0ca6c2b8c762ac3f2f3fc4b
2022-06-14 14:21:37 +00:00
Vijay Prasanna
888126ecb4 fix (console): breaking modify tab for mssql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4718
GitOrigin-RevId: 1a350c756fbac73c334546f4a3adbcc27ed1b73c
2022-06-14 14:15:33 +00:00
Naveen Naidu
134544135d docs: update mssql read replica docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4664
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 90d23b6094e7fdaa24fddd0690830ba5019cb2c3
2022-06-14 13:28:52 +00:00
Aravind K P
cde3ab7612 cli: add support for multiple admin secrets in pro cli migrations image
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4604
GitOrigin-RevId: 70ff26a72f55007aa04a083c3506b4f4a957b240
2022-06-14 11:14:56 +00:00
paritosh-08
620de6ee42 server: add default naming convention to TenantConfig
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4710
GitOrigin-RevId: c989bed76fb22eef13304b0d8ef02b53dd70fd59
2022-06-14 09:18:20 +00:00
Daniel Chambers
0723925ffc Expose the entire official Chinook dataset through the DC Reference agent and use it in the tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4688
GitOrigin-RevId: f87b2e23be69aed3cc7f95e814f9426db174dc9b
2022-06-13 20:59:48 +00:00
Philip Lykke Carlsen
8510cbfe87 Remove redundant strict data declartions
We already enable `-XStrictData` in `graphql-engine.cabal`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4699
GitOrigin-RevId: c5c17ed75319da794d5a1655ac9b069f0fa68dea
2022-06-13 13:18:17 +00:00
Tom Harding
2c3b483a08 Remove partial NonEmpty.fromList calls (closes #3865)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4665
GitOrigin-RevId: 637c61a1612c4e31aabc247b07a836d16454c470
2022-06-13 11:20:53 +00:00
Erik Magnusson
40ba20f7f7 console: migrate events to tailwind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4552
GitOrigin-RevId: 7b4d54ec00c3ed7e8c48a3a6f0c4569ee38966e5
2022-06-13 09:25:07 +00:00
Rikin Kachhia
7d8fa3a5ee console: add support for computed fields with session arg in permission builder
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4417
GitOrigin-RevId: 5fc528c9a3ab87a885ad2b85c3b2bde557ab6a22
2022-06-13 06:53:14 +00:00
Solomon
97ae14a43a [GDW-93] Fix "conflicting definitions" when using both DC backend and PG backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4686
GitOrigin-RevId: 254e2ad5d951f73a799e55b1dbcfaa0097054122
2022-06-10 04:00:07 +00:00
Brandon Simmons
bf3657d0a2 Fix up for scripts/cabal-freeze-update.sh
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4685
GitOrigin-RevId: abae6aed0ae56a67d4c6bbb59598920bfcdc5e8e
2022-06-09 19:52:38 +00:00
Tom Harding
e22eb1afea Weeding (2/?)
## Description

Following on from #4572, this removes more dead code as identified by Weeder. Comments and thoughts similarly welcome!

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4587
GitOrigin-RevId: 73aa6a5a2833ee41d29b71fcd0a72ed19822ca73
2022-06-09 16:40:49 +00:00
Rakesh Emmadi
fbc98bcc25 server/bigquery: add a reference to github ticket for computed field limit issue
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4658
GitOrigin-RevId: cc4e1165682d484408ef22fcedd16bc793f4d918
2022-06-09 15:36:34 +00:00
paritosh-08
4a611febaf docs: naming convention docs rectification
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4681
GitOrigin-RevId: 49c6a2f3e8c5afc10ab0c62b1bca4079a3867978
2022-06-09 13:51:31 +00:00
Miguel Fernández
ac42db645a docs: replace images for project suspension to reflect new copy
Tracked in https://github.com/hasura/lux/issues/3904
Together with https://github.com/hasura/lux/pull/4568

This is to replace deactivated -> hibernated in the copy of the project card, to make project hibernation more palatable to users

cc @vaishnavigvs

>

## Description ✍️
->

### Related Issues ✍

Tracked in https://github.com/hasura/lux/issues/3904
Together with https://github.com/hasura/lux/pull/4568

### Kodiak commit message
Change copy of docs page for project hibernation

#### Commit title

Replace images to reflect new copy on project hibernation documentation page

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4660
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 5cdcd7b7ac847cb537faf9f62863d621e51c4348
2022-06-09 12:27:53 +00:00
Aravind K P
df0d55e508 docs: update hasura config reference for multiple admin secrets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4678
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: de94e26749c034cd63ceebfcb0c2cde983a3a0d5
2022-06-09 11:08:51 +00:00
hasura-bot
e19573b43a Format Connection string so it is more visible
GITHUB_PR_NUMBER: 8555
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8555

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4633
Co-authored-by: Jonathan Marbutt <1386587+jmarbutt@users.noreply.github.com>
GitOrigin-RevId: ddfaf76096b4f17db0d71f113c9ea4e3a7cdebdc
2022-06-09 10:54:38 +00:00
Rikin Kachhia
d328d673ca docs: restructure naming conventions page
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4670
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 848295d1dae95c618aac37da8df520412b08a677
2022-06-09 09:47:38 +00:00
Vijay Prasanna
e4fc6a868e feat (console): setup a simple data abstraction layer
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4640
GitOrigin-RevId: 003cbce502f196deed03960af139617876f5e76f
2022-06-09 09:01:00 +00:00
Brandon Simmons
45af456fb3 dev: add new freeze file helper script: scripts/cabal-freeze-update.sh
This was reworked from an earlier version based on feedback from @solomon-b : https://github.com/hasura/graphql-engine-mono/pull/4618

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4646
GitOrigin-RevId: c54469a2d8466471e6d5c25a0cc80e26d94ce7c7
2022-06-08 21:14:10 +00:00
Brandon Simmons
623b856101 fix hspec tests broken during merge of #4611
tests-hspec don't fail the merge so this got through

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4668
GitOrigin-RevId: 1205c2da0340500d63f4c83601416bb234d2b60e
2022-06-08 19:38:12 +00:00
Benoit Ranque
525361d3d2 escape sql underscores in LIKE expressions (close #8435)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4596
GitOrigin-RevId: 48f143b8e6bbc60371656cc4bfbae1a5864f9921
2022-06-08 18:54:19 +00:00
Philip Lykke Carlsen
12c3eddef7 Amendments to the hspec testsuite
This PR proposes some changes to the hspec testsuite:

* It amends the framework to make it easier to test from the ghci REPL
* It introduces a new module `Fixture`, distinguished from `Context` by:
   * using a new concept of `SetupAction`s which bundle setup and teardown actions into one abstraction, making test system state setup more concise, modularized and safe (because the fixture know knows about the ordering of setup actions and can do partial rollbacks)
   * somewhat opinionated, elides the `Options` of `Context`, preferring instead that tests that care about stringification of json numbers manage that themselves.

(Note that this PR builds on #4390, so contains some spurious commits which will become irrelevant once that PR is merged)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4630
GitOrigin-RevId: 619c8d985aed0aa42de31d6f16891d0782f4b4b5
2022-06-08 16:36:50 +00:00
Brandon Simmons
6e8da71ece server: migrate to aeson-2 in preparation for ghc 9.2 upgrade
(Work here originally done by awjchen, rebased and fixed up for merge by
jberryman)

This is part of a merge train towards GHC 9.2 compatibility. The main
issue is the use of the new abstract `KeyMap` in 2.0. See:
https://hackage.haskell.org/package/aeson-2.0.3.0/changelog

Alex's original work is here:
#4305

BEHAVIOR CHANGE NOTE: This change causes a different arbitrary ordering
of serialized Json, for example during metadata export. CLI users care
about this in particular, and so we need to call it out as a _behavior
change_ as we did in v2.5.0. The good news though is that after this
change ordering should be more stable (alphabetical key order).

See: https://hasurahq.slack.com/archives/C01M20G1YRW/p1654012632634389

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4611
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
GitOrigin-RevId: 700265162c782739b2bb88300ee3cda3819b2e87
2022-06-08 15:32:27 +00:00
Rob Dominguez
0a6671a4bf docs: fix graphiql editor copying issue
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4632
GitOrigin-RevId: 4ed4e9318effb139c270a7bb81e12bd4a94e5700
2022-06-08 13:22:28 +00:00
Sooraj
1840e527b7 feat (console): show local DB relationships in the relationships table
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4626
GitOrigin-RevId: b54e9b546ae29c42b17b4957ffcd29a3ddabd48b
2022-06-08 12:54:17 +00:00
Erik Magnusson
a170ac26e2 refactor (console): migrate data tab modify section to tailwind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4638
GitOrigin-RevId: bbcbf3bc4e86e3bfc0294ee486e4a6fd91224664
2022-06-08 12:07:54 +00:00
SidharthBihary
2cbc24cf3f docs: update datadog docs for new regions support and UI change
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4603
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 3d82fbb2c581ff4683b8585d235476bcc0cac49f
2022-06-08 09:39:36 +00:00
paritosh-08
8f09253514 docs: naming convention
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4589
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 6bf4d13d683ed17b112b79a1a57b92984fe39b0a
2022-06-08 08:44:18 +00:00
Vishnu Bharathi
af20404ac0 ci: tag release v2.8.0-beta.1 and v2.8.0-beta.1-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4659
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 85914a11c339d9d77f265da702e38d3f9f46ff59
2022-06-08 08:31:09 +00:00
Erik Magnusson
cb638e7168 refactor (console): migrate insert rows tab to tailwind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4599
GitOrigin-RevId: c78bcf061fd935b0c566466135f673175cd11cf7
2022-06-08 08:00:15 +00:00
Vishnu Bharathi
952a3f6481 ci: updates base image for ubuntu and centos flavours
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4502
GitOrigin-RevId: 0897d097b5698f5751b7bfc72801dbfdb19e90c2
2022-06-08 07:07:28 +00:00
Philip Lykke Carlsen
3e33fd6ff7 Make on_conflict schema available abstract of update permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4390
GitOrigin-RevId: 5f3f9da173cad37f9330c5a27fd1edfc2559a4d6
2022-06-07 23:25:48 +00:00
Divi
b7c414a875 ci: add action to release cli-ext binaries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4342
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 2b7686bda333d977aa20a1ff10f7b3179509eac3
2022-06-07 22:25:41 +00:00
Rakesh Emmadi
270fe74f67 server/bigquery: define select permissions for computed fields returning custom table schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4628
GitOrigin-RevId: 604b4d592dc438c88790add6319ee4f246cc25b9
2022-06-07 16:50:17 +00:00
Antoine Leblanc
e3c2bf53a5 Move, document, and prune action types and custom types types.
### Description

This PR is a first step in a series of cleanups of action relationships. This first step does not contain any behavioral change, and it simply reorganizes / prunes / rearranges / documents the code. Mainly:
- it divides some files in RQL.Types between metadata types, schema cache types, execution types;
- it renames some types for consistency;
- it minimizes exports and prunes unnecessary types;
- it moves some types in places where they make more sense;
- it replaces uses of `DMap BackendTag` with `BackendMap`.

Most of the "movement" within files re-organizes declarations in a "top-down" fashion, by moving all TH splices to the end of the file, which avoids order or declarations mattering.

### Optional list types

One main type change this PR makes is a replacement of variant list types in `CustomTypes.hs`; we had `Maybe [a]`, or sometimes `Maybe (NonEmpty a)`. This PR harmonizes all of them to `[a]`, as most of the code would use them as such, by doing `fromMaybe []` or `maybe [] toList`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4613
GitOrigin-RevId: bc624e10df587eba862ff27a5e8021b32d0d78a2
2022-06-07 15:45:00 +00:00
Rakesh Emmadi
854a76c5b1 docs: add BigQuery computed fields feature page
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4591
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: b06af8ce4812790bcdfd3348af544ba7d99e5b17
2022-06-07 14:38:14 +00:00
Antoine Leblanc
eaba2e08d3 Clean Relay's code, break schema cycles, introduce Node ID V2
## Motivation

This PR rewrites most of Relay to achieve the following:
- ~~fix a bug in which the same node id could refer to two different tables in the schema~~
- remove one of the few remaining uses of the source cache in the schema building code

In doing so, it also:
- simplifies the `BackendSchema` class by removing `node` from it,
- makes it much easier for other backends to support Relay,
- documents, re-organizes, and clarifies the code.

## Description

This PR introduces a new `NodeId` version ~~, and adapts the Postgres code to always generate this V2 version~~. This new id contains the source name, in addition to the table name, in order to disambiguate similar table names across different sources (which is now possible with source customization). In doing so, it now explicitly handles that case for V1 node ids, and returns an explicit error message instead of running the risk of _silently returning the wrong information_.

Furthermore, it adapts `nodeField` to support multiple backends; most of the code was trivial to generalize, and as a result it lowers the cost of entry for other backends, that now only need to support `AFNodeId` in their translation layer.

Finally, it removes one more cycle in the schema building code, by using the same trick we used for remote relationships instead of using the memoization trick of #4576.

## Remaining work

- ~~[ ]write a Changelog entry~~
- ~~[x] adapt all tests that were asserting on an old node id~~

## Future work

This PR was adapted from its original form to avoid a breaking change: while it introduces a Node ID V2, we keep generating V1 IDs and the parser rejects V2 IDs. It will be easy to make the switch at a later data in a subsequent PR.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4593
GitOrigin-RevId: 88e5cb91e8b0646900547fa8c7c0e1463de267a1
2022-06-07 13:36:29 +00:00
Naveen Naidu
0817d46f1a server: log details of healthcheck failure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4634
GitOrigin-RevId: 9a0c2ecd3db3fba15e352c9318127a82a36ac52b
2022-06-07 11:24:20 +00:00
Erik Magnusson
f3278de0a7 refactor (console): migrate old browse rows' css to tailwind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4609
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
GitOrigin-RevId: 4e89125550c24ff058eadd53c0769893c8087936
2022-06-07 10:42:56 +00:00