Commit Graph

4371 Commits

Author SHA1 Message Date
Antoine Leblanc
cdf5e3b5f0 Specialize RQL.DML to postgres.
### Description

When generalizing the code, back in late 2020, we over-eagerly generalized parts of the code that are specific to RQL's DML. This was in part due to the fact that, at the time, the DML types were all mixed alongside other types in `RQL.Types`. As a result, a lot of `RQL.DML.Internal` was generic over the backend type, instead of being specialized to `'Postgres 'Vanilla`.

A consequence of this is that, before this PR, `DML.Internal` ended up having a dependency on non-Postgres backends, due to the use of `annBoolExp`, which requires a `BackendMetadata` instance. Since the code was written in a generic manner, `DML.Internal` in turn depended on having the metadata instances in scope... This PR changes that to, instead, explicitly import the Postgres instance.

(Note that this module didn't import `RQL.Types.Metadata.Instances`, but depends on a module that imports it, and **orphan instances are transitively imported**, as evidenced by the need for that explicit import in #4568.)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4573
GitOrigin-RevId: 7b82b5d7c23c03654518a1816802d400f37c3c64
2022-05-27 18:23:19 +00:00
Antoine Leblanc
498442b1d3 Remove circular dependency in schema building code
### Description

The main goal of this PR is, as stated, to remove the circular dependency in the schema building code. This cycle arises from the existence of remote relationships: when we build the schema for a source A, a remote relationship might force us to jump to the schema of a source B, or some remote schema. As a result, we end up having to do a dispatch from a "leaf" of the schema, similar to the one done at the root. In turn, this forces us to carry along in the schema a lot of information required for that dispatch, AND it forces us to import the instances in scope, creating an import loop.

As discussed in #4489, this PR implements the "dependency injection" solution: we pass to the schema a function to call to do the dispatch, and to get a generated field for a remote relationship. That way, this function can be chosen at the root level, and the leaves need not be aware of the overall context.

This PR grew a bit bigger than that, however; in an attempt to try and remove the `SourceCache` from the schema altogether, it changed a lot of functions across the schema building code, to thread along the `SourceInfo b` of the source being built. This avoids having to do cache lookups within a given source. A few cases remain, such as relay, that we might try to tackle in a subsequent PR.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4557
GitOrigin-RevId: 9388e48372877520a72a9fd1677005df9f7b2d72
2022-05-27 17:22:38 +00:00
Antoine Leblanc
cbe0479406 Remove unrelated functions from GraphQL.Schema.Common
### Description

There were several functions in `GraphQL.Schema.Common` that were unrelated to the schema building process, and were about metadata manipulation or dependency computation. Having those functions in the schema part of the code forces several places in the code to depend on the schema code, despite being completely unrelated.

This PR moves those functions where they make sense: alongside similar functions in `RQL.Types.*`, and rewrites `getRemoteDependencies` for clarity (it was using the term "indirect dependency" in a way that was inconsistent with the rest of the code).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4568
GitOrigin-RevId: 948a18cebbb337a8bb6367c1f2d2ef5628209d96
2022-05-27 15:41:06 +00:00
Auke Booij
cda117a4a9 Add unless/when related hints
Example:

```
server/src-lib/Hasura/RQL/DDL/Schema/Table.hs:(200,15)-(205,28): Warning: Use when
Found:
  if tnGQL `elem` ns then
      throw400 RemoteSchemaConflicts
        $ "node " <> tnGQL <> " already exists in current graphql schema"
  else
      pure ()
Perhaps:
  when
    (tnGQL `elem` ns)
    (throw400 RemoteSchemaConflicts
       $ "node " <> tnGQL <> " already exists in current graphql schema")
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4570
GitOrigin-RevId: 1b04e5e39d20c99643220154c03dae82a025f0f1
2022-05-27 13:34:42 +00:00
Antoine Leblanc
9308c92e8d Fix a /= [] and add hint.
### Description

Several places in the code used `a /= []`, which is inelegant. To my surprise, hlint did not warn about this, despite the fact that it forces an `Eq` instance on the elements. This PR replaces all occurrences of that pattern with `not (null a)` and adds a lint warning for it.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4569
GitOrigin-RevId: 6471e75ade9e71e5d583a0dac7815c01870c696b
2022-05-27 12:28:24 +00:00
Varun Choudhary
37ee2bfe53 console: remote schema relationships improvements
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4542
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 1def55bb692d8bb075525231c153d1aa1463a5bb
2022-05-27 09:57:05 +00:00
paritosh-08
42da1dbc2e server/docs: follow up on the naming convention
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4563
GitOrigin-RevId: 0ae1f226a63dae34e6cb0d001b4915c05b0974cf
2022-05-27 05:56:52 +00:00
Gil Mizrahi
2b3d7c407b server/mssql: drop the temp table after delete
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4562
GitOrigin-RevId: f5f5815d9e2f58912a294cf564cfdc38995263d3
2022-05-26 15:21:54 +00:00
Evie Ciobanu
a8c0137f21 server: add infrastructure to write runit tests for update parsers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4533
GitOrigin-RevId: d094149d6cbdeebe152c58032715bad725480d9b
2022-05-26 14:06:24 +00:00
paritosh-08
fd30fb343b server: naming conventions for auto generated fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3982
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: f90b2e8f394e7bd69780f003d2d980475f104f42
2022-05-26 11:55:29 +00:00
Erik Magnusson
3f479481c8 console: migrate action tab to tailwind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4531
GitOrigin-RevId: 98b8ae2433207c8983b057a53028621130ff296e
2022-05-25 14:20:34 +00:00
Stefano Magni
e42c3985d4 docs: Fix the references to the API tab
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4496
GitOrigin-RevId: 7d5a9d5043391a4957fb7ee290d9f263a8b5a3d8
2022-05-25 13:13:56 +00:00
hasura-bot
ec24857bc3 docs: correct Hasura ASCII logo
GITHUB_PR_NUMBER: 8500
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8500

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4529
Co-authored-by: Johan Eliasson <331818+elitan@users.noreply.github.com>
GitOrigin-RevId: 95e2e13bf37fcd2433d55af3f7637504df383e00
2022-05-25 13:10:51 +00:00
Marion Schleifer
7f13d4380f docs: fix pg requirements page
Based on these two conversations:
- https://hasurahq.slack.com/archives/C015EA71MU0/p1652417463650649
- https://hasurahq.slack.com/archives/C015EA71MU0/p1652417516799779

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4500
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 63c3d17ad2be409e52a50df61a6e17a333e50cf0
2022-05-25 13:07:35 +00:00
Varun Choudhary
41955bf86f CON-185-Remove any icons left in the CE codebase
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4527
GitOrigin-RevId: 6cb3bda20811b05415f1a35b8bb767be88b44a46
2022-05-25 12:11:43 +00:00
Vishnu Bharathi
0d1f1aad9a ci: tag release v2.7.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4553
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 6b822051ab9b72b2de93a0367a8fedaef544fab3
2022-05-25 10:55:59 +00:00
Rakesh Emmadi
acde210fdc server/bigquery: generate graphql schema for table computed fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4460
GitOrigin-RevId: 7b772cd9fba6b612ad05eb1aca1fa13e6ae8556d
2022-05-25 10:25:38 +00:00
hasura-bot
8a05ff207b docs: fix allowed_skew is described as a string, but needs to be a number
GITHUB_PR_NUMBER: 8516
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8516

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4539
Co-authored-by: Romian Tairovski <13468715+ItsMeRomian@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 2b8d245d8432a0fb22d61bc560879700ef7e0e17
2022-05-25 08:21:19 +00:00
Abby Sassel
45843b94d9 server/tests: fix Bigquery HTTP request failed with status code 400 and status message "Bad Request"
Fixes https://github.com/hasura/graphql-engine-mono/issues/4546

Error: `Bigquery HTTP request failed with status code 400 and status message "Bad Request" `

Likely fix: untrack `author` table before dropping it in `SerializationSpec`. [This is the main change](fadbbfe8f2), the rest is cleanup.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4548
GitOrigin-RevId: 36be213d8ccfeb2dbb6b797225dc07e6e3dc83ba
2022-05-24 17:08:52 +00:00
Auke Booij
cb67ad5e95 server: Clean up some deriving statements
By generalizing the instances, they can be written as attached instance derivations, rather than standalone ones.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4518
GitOrigin-RevId: 7a387911cf6ad46fe6acd36648275d6c2c68ffe3
2022-05-24 07:22:55 +00:00
Daniel Chambers
9e5f860a29 server: Default SourceMetadata's kind to Postgres Vanilla
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4514
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: 37572758c3722a85ac005f5bd13a9bf6a407bad4
2022-05-24 04:16:44 +00:00
Vishnu Bharathi
78b94ce765 ci: avoid build failure when short commit SHA contains only numbers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4538
GitOrigin-RevId: 63700682a1b3b6fd68c6be22cde210f5e1e8f559
2022-05-23 20:10:51 +00:00
Auke Booij
82ceafaf44 Remove unused schema.graphql resource
This file was no longer needed after the PDV refactor (hasura/graphql-engine#4111). It was replaced by `Hasura.GraphQL.Schema.Introspect`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4532
GitOrigin-RevId: 61a5f44a9e68238d61095a3f176b2d5847c63307
2022-05-23 16:44:20 +00:00
Puru Gupta
d5e46b6041 server: do not serialize env vars in logs or errors: PR II - Actions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4486
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 35bb05f9a3c98689c05f2865e0923c00b46e5419
2022-05-23 11:13:49 +00:00
hasura-bot
ffe97bd0bb docs: better indentation in example
GITHUB_PR_NUMBER: 8509
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8509

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4526
Co-authored-by: Johan Eliasson <331818+elitan@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 2be1aea0e55b3267a63bda71dd22debe4b98a969
2022-05-23 09:52:24 +00:00
Puru Gupta
5501f686df server: do not serialize env vars in logs or errors: PR I - Remote Schemas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4463
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 71c6824130d71312f5bd5ae94fc268c0544c6ca3
2022-05-21 09:05:59 +00:00
Alberto Francesco Motta
4929d3135a [CON-209] Fix regression with ExpandButton icon on Browse rows
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4515
GitOrigin-RevId: 8b298c819fb8c8071edb8f61605c8413b145247b
2022-05-20 08:07:08 +00:00
Vamshi Surabhi
73b161b2bc move action IR types to IR.Actions module
A very minor cleanup (came out of documenting the architecture of actions). Does what's mentioned in the title.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4451
GitOrigin-RevId: d480ff438256df468df65b43d15f92a30b14b997
2022-05-14 11:10:42 +00:00
Vishnu Bharathi
b6eb71ae07 ci: tag release for v2.6.2 and v2.7.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4499
GitOrigin-RevId: 8c4c6256ea953c55f8db03460e32d0a775d0d2ea
2022-05-12 17:45:42 +00:00
Lyndon Maydwell
5d5552f185 Fix for too much information in Pro PSQL exceptions wrt. Certificates
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4475
GitOrigin-RevId: 8a64b4387c559ca447252dcadf6c5e231b079c65
2022-05-12 14:30:35 +00:00
Vijay Prasanna
cca5c548a7 console: clean up useMetadataMigration hook
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4479
GitOrigin-RevId: 35e583b879be7eb65a1495ee8b7c9d3335889ca8
2022-05-12 13:25:30 +00:00
Abhijeet Khangarot
936ee990c2 console: fix console crash on adding pg sources with connection params
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4485
GitOrigin-RevId: 00230fd2563fae9dcbdc03af5927dfeb1a82b965
2022-05-12 12:15:53 +00:00
Varun Choudhary
43622f3011 CON-161-Swap to react icons in the events + actions tab
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4461
GitOrigin-RevId: 6668cfc6cf97d9e8c4c78705f5d26893e006085e
2022-05-12 11:08:20 +00:00
Varun Choudhary
aadf87aec6 CON-160-Swap to react icons in the data tab
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4456
GitOrigin-RevId: 1d68c9f18cd330d640dfc33f0f7e4b6a98e410b1
2022-05-12 10:11:19 +00:00
Matt Hardman
ff32795894 CON-125-update-the-relationships-table-component-to-use-the-metadata-selector
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4312
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: c195a292e85e2904e0f3d6506dfce08f740c3ac6
2022-05-12 07:30:51 +00:00
Gil Mizrahi
cd38a9a1fc server/postgres + server/mssql: Insert empty objects with default values
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4487
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 3413f0b5dbe6ec42fff360d83b5202e4aa4aa86e
2022-05-11 16:01:57 +00:00
Solomon
b4f89569c8 GDC: Integration Tests and Servant Agent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4467
GitOrigin-RevId: 5e81d8581197c90ad2de9106e724c63d7592ae72
2022-05-11 06:15:27 +00:00
Tom Harding
3db241155d Make ForeignKey mappings non-empty
Previously, these were represented with a HashMap, but supposedly that map can never be empty. Now, it uses NEHashMap, which carries the non-empty invariant behind a smart constructor.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4481
GitOrigin-RevId: 93ad9aaa9354f25a1ba10e8207ae19614e1e439e
2022-05-10 15:44:46 +00:00
Karthikeyan Chinnakonda
ce9912ff8c server: run_sql to not drop the SQL triggers created by the graphql-engine
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4397
GitOrigin-RevId: dcd43fc31f64af8c6c9c92c66d46a593d5b12fbd
2022-05-10 13:47:16 +00:00
Varun Choudhary
8a03abaf0b CON-159-Swap to react icons in the main layout (/main + /login)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4455
GitOrigin-RevId: bfbef97761174182bbab13d2390d0646b848ac17
2022-05-10 12:49:11 +00:00
Vijay Prasanna
db07dcf60d console: new "add remote schema" page (with GQL customization)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4428
GitOrigin-RevId: d8f82ffe86fd59abb43afa195b40c2fdafabb847
2022-05-10 11:32:32 +00:00
Varun Choudhary
f7b4d32941 CON-162-Swap to react icons in the remote schemas + settings + feature flag
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4462
GitOrigin-RevId: 57c43f73603a63641363e578e3a8440eb1d3b586
2022-05-10 07:38:04 +00:00
Antoine Leblanc
697137dd77 Fix Postgres not padding timestamps correctly (fix hasura/graphql-engine#8096)
## Description

As identified in hasura/graphql-engine#8096, the format string we used for timestamps was incorrect; we were using `%F`, which expands to `%Y-%m-%d`; but that meant that the year was not padded to four digits: `0001` would be represented simply as `1`. However, Postgres inteprets that `1` as `2001`, probably due to interpretation rules about two-digit years (in `25/12/01`, `01` is indeed `2001`).

```
# create table timestamp_test ( test timestamptz );
CREATE TABLE
# insert into timestamp_test values ('1-01-01T00:00:57Z');
INSERT 0 1
# select * from timestamp_test;
          test
------------------------
 2001-01-01 00:00:57+00
(1 row)
```

To fix this, this PR changes the format string to use `%0Y`, which always pads the year number with zeroes.

## Remaining work

- [x] write Changelog entry
- [ ] copy timestamp tests from the python suite into the hspec tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3536
GitOrigin-RevId: fa144111358339fd4a35b32d888c1d2c5b418ea6
2022-05-09 12:18:18 +00:00
Evie Ciobanu
d1f8b9a87d server: further improve anybackend module docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4465
GitOrigin-RevId: fda2b45468a94d5b25f9d5aed8199502ee9370ad
2022-05-09 10:12:59 +00:00
hasura-bot
8bf2dd0c65 Improve COMPILING-ON-MACOS.md
GITHUB_PR_NUMBER: 8472
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8472

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4466
Co-authored-by: Nico Burns <1007307+nicoburns@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: dae49cafaba8492224d70df4624ad36888e0e3ab
2022-05-09 08:32:56 +00:00
Anon Ray
c33fb6c436 server: update pg-client-hs version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4446
GitOrigin-RevId: adb823916f1f3c0451a1dbfaf7669f3a625eac81
2022-05-09 08:28:54 +00:00
Miguel Fernández
7ea4c79f02 docs: add another FAQ to project hibernation
>

## Description ✍️
->

Tracked in https://github.com/hasura/lux/pull/3904
Part of https://github.com/hasura/lux/issues/4136

## 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]  Docs

### Metadata ✍

Does this PR add a new Metadata feature?
-  No

### GraphQL ✍
-  No new GraphQL schema is generated

### Breaking changes ✍

-  No Breaking changes

### Kodiak commit message

#### Commit title

[docs] Add another FAQ to the project hibernation page

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4447
GitOrigin-RevId: 9e2681c12bdac69f992419a181503ef44672d55b
2022-05-07 16:09:55 +00:00
hasura-bot
4c1280e3af docs: add SSL setup to cloud GCP Postgres guide
GITHUB_PR_NUMBER: 8458
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8458

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4425
Co-authored-by: adas98012 <101733366+adas98012@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: c958ae880118e717f76f982c3c15ea7b90ff56e7
2022-05-07 16:07:30 +00:00
hasura-bot
b56b3f9581 docs: add Clerk auth integration guide
GITHUB_PR_NUMBER: 8456
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8456

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4422
Co-authored-by: Ian McPhail <97047001+devchampian@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 60436cb04abd92ea22816b3960c0f34675fabfa6
2022-05-07 15:42:29 +00:00
Brandon Simmons
f8fd61539e ci: finer-grained dependencies on build-servers artifacts
…p CI (#3975)

Trying out a new convention here for jobs that generate multiple
artifacts at different points in time, and where downstream jobs depend
on just a particular subset of artifacts and don't need to wait for the
entire job. We accomplish this with separate `Input` steps, which we
unblock manually via calls to the buildkite API once particular sets of
artifacts are complete.

We could accomplish the same thing by having multiple build server jobs
focused on particular targets ( this is in fact how it used to work)
but that is quite wasteful of CI resources;  in order to build any of
the binaries quickly, we need significant number of cores;  but if we
only build particular targets, we don't take advantage I've all those
cores relative to the parallelism a full cabal build gives us. That
would likely be more difficult to maintain as well.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4256
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 5f5603da8a85f9a491877d51a7c08764c7199602
2022-05-06 12:59:53 +00:00