Commit Graph

2513 Commits

Author SHA1 Message Date
Antoine Leblanc
3f87d9e886 ci: hlint suggestions do not mark the check as failed
Instead of using hlint's return value to determine whether the check was successful, we parse the output to see if there was any error. In practice, that means that hlint suggestions, which are translated as warnings on a pr, will no longer mark the check as failed.

GitOrigin-RevId: dff2a50180de0c5f0702a9799b1f6359499da6a5
2021-01-20 17:50:50 +00:00
Aleksandra Sikora
e2c274570f cli: add Hasura-Internal-Request-Source to allowed headers
GitOrigin-RevId: 19e96852b02066ab6119e2cded21ce9518d4c1a0
2021-01-20 13:55:34 +00:00
Rakesh Emmadi
21fb33d709 fix oss server upgrade ci test from 1.3.3 stable release (#378)
GitOrigin-RevId: 1bcd4bb1e1f741ff44219dc1b559af5514c6df91
2021-01-20 12:00:00 +00:00
Antoine Leblanc
4815fcd500 server: progress on generic metadata
This PR generalizes a bunch of metadata structures.

Most importantly, it changes `SourceCache` to hold existentially quantified values:
```
data BackendSourceInfo =
  forall b. Backend b => BackendSourceInfo (SourceInfo b)

type SourceCache = HashMap SourceName BackendSourceInfo
```

This changes a *lot* of things throughout the code. For now, all code using the schema cache explicitly casts sources to Postgres, meaning that if any non-Postgres `SourceInfo` makes it to the cache, it'll be ignored.

That means that after this PR is submitted, we can split work between two different aspects:
  - creating `SourceInfo` for other backends
  - handling those other sources down the line

GitOrigin-RevId: fb9ea00f32e840fc33c5467896fb1dfa5283ab42
2021-01-20 00:32:45 +00:00
hasura-bot
98ccd81704 Server: Remote relationships permissions
GITHUB_PR_NUMBER: 6125
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6125

Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
GitOrigin-RevId: 53d0671e6335dad1af7cb00e3e05e7021a910673
2021-01-19 20:57:58 +00:00
hasura-bot
2c56254e5a server: simplify JSON instances
GITHUB_PR_NUMBER: 6152
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6152

Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
GitOrigin-RevId: 6c94aef8c57e852b3d41b8355c09e64fce756a7c
2021-01-19 19:15:42 +00:00
hasura-bot
38fc4cb677 server: consistently log request_id at the same level
GITHUB_PR_NUMBER: 6244
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6244

Co-authored-by: José Lorenzo Rodríguez <37621+lorenzo@users.noreply.github.com>
GitOrigin-RevId: fef22d98ac7be23ca21a63dc1c696fa7169253a4
2021-01-19 17:26:45 +00:00
Sameer Kolhar
bd2e6a0567 console: tag console requests
resolves #134

The PR adds a new header(`Hasura-Internal-Request-Source`) to every request sent to the server.

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 9d1538fcf92fd5a00c649884b910da3f3993cd47
2021-01-19 15:36:46 +00:00
Antoine Leblanc
e754190301 server: clean MaybeT usage, and introduce new hlint rules
### Description

Our Prelude provides the very convenient `hoistMaybe :: Maybe b -> MaybeT m b`. This PR adds hlint rules to replace uses of `MaybeT $ pure $ x` with the cleaner `hoistMaybe x`, and rules to specifically replace `MaybeT $ pure Nothing` with `empty`.

GitOrigin-RevId: 7254f4954e34e4d7ca972dc7c12073d3ab8cb0b8
2021-01-19 13:38:42 +00:00
Swann Moreau
c995cffbb5 server: misc ci improvements (#372)
* split ~/.cabal/{packages,store} caches

* use xlarge for {oss_,}build_server

GitOrigin-RevId: e37619e85459b3d05ebcbf93447b02d10b8b4841
2021-01-19 11:43:36 +00:00
Rikin Kachhia
0f26a24557 docs: remove posthog tracking script
as tracking scripts are managed via google tag manager they can be removed from code

GitOrigin-RevId: ed864944e3062f33c08bfce7f2aca9f79ded6b8c
2021-01-19 10:15:55 +00:00
Aleksandra Sikora
b829520f49 console: fix imports and raw sql regression
* Fixed imports ('../../../Common/utils/v1QueryUtils' -> '../../../../metadata/queryUtils') which will fix adding and dropping action permissions and table enum toggle.
* Fixed regression from 0dd1e4d58a (diff-2016a81d31343f475f94d13fe21aad0f56664f386c0455210021dc197b3d1dadL173) regarding setting `track this` for functions.

GitOrigin-RevId: 458b84ba06f002c89b5615dbef8c76920a978824
2021-01-18 19:03:37 +00:00
hasura-bot
a398d3b190 cli: support datasources
GITHUB_PR_NUMBER: 6111
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6111

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 1f6517acfacb58c566bb5e48f74ea0dfa5c6f063
2021-01-18 17:12:09 +00:00
Vladimir Ciobanu
6e752a7876 server: add type information to aggregates and stringify them (closes #5704)
Fixes https://github.com/hasura/graphql-engine/issues/5704 by checking, for aggregate fields whether we are handling a numeric aggregation.

This PR also adds type information to `ColFld` such that we know the type of the field.

This is the second attempt. See #319 for a less invasive approach. @nicuveo suggested type information might be useful, and since it wasn't hard to add, I think this version is better as well.

GitOrigin-RevId: aa6a259fd5debe9466df6302839ddbbd0ea659b5
2021-01-18 13:52:51 +00:00
Karthikeyan Chinnakonda
6c22132061 server: move remote schema permissions APIs to /v1/metadata
Earlier (pre catalog separation), the remote schema permissions were in `/v1/query`. This PR moves it to `/v1/metadata`.

GitOrigin-RevId: cb39d9df4cc2288f67231504e3a7909f2f8df4da
2021-01-18 10:39:29 +00:00
hasura-bot
513a3d0c19 Fix action relationship type and input arguments (closes #6402) (#284)
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GITHUB_PR_NUMBER: 6417
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6417
GitOrigin-RevId: 37b67a4d04e0ed3b16fc5fc9bf025b24b1f1bf6e
2021-01-18 06:57:24 +00:00
hasura-bot
647504ef99 docs: fix UserLogin action mutation definition
This PR was migrated from https://github.com/hasura/graphql-engine/pull/6300

---
Accept password instead of email in UserInfo Mutation type example

Co-authored-by: Tobias Törnros <17402497+tobiastornros@users.noreply.github.com>
GitOrigin-RevId: 9fbc0fc1ad4e6725b5411c271dd8e2d1ee7840be
2021-01-15 12:36:32 +00:00
Praveen Durairaju
4bc904f230 update hasura logo brand assets
This PR updates the svg logo assets inside the `assets/brand` directory with the new Hasura logo.

GitOrigin-RevId: 14c895be65dc3c149f4a78b07d83fa2c3ce3455e
2021-01-15 12:32:43 +00:00
hasura-bot
b9d31203c9 docs: add full page on pg permissions to cloud docs
GITHUB_PR_NUMBER: 6128
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6128

Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 0ebd5fcbdfa6deaccd63d164c5ed8a07b63abca3
2021-01-14 08:17:38 +00:00
Rakesh Emmadi
648488ce7a server: fix computed field comment is not being saved in metadata (#337)
GitOrigin-RevId: 7eb1c5b86740d884a2718cead6dab962a45283d1
2021-01-14 07:03:42 +00:00
Karthikeyan Chinnakonda
c14bcb6967 server: accept new config allowed_skew in JWT config to provide leeway in JWT expiry
fixes https://github.com/hasura/graphql-engine/issues/2109

This PR accepts a new config `allowed_skew` in the JWT config to provide for some leeway while comparing the JWT expiry time.

GitOrigin-RevId: ef50cf77d8e2780478685096ed13794b5c4c9de4
2021-01-13 08:39:18 +00:00
Lyndon Maydwell
ece4fb4bce Merge pull request #342 from hasura/naveen/move-serverCtx-to-Config
server: Move 'serverMetrics' to Config.hs for better visibility
GitOrigin-RevId: 4f2b40ec81d4d4bb662cc16693b993fb3606b64a
2021-01-13 06:28:12 +00:00
Aleksandra Sikora
5aedaace28 console: support volatile functions (close #6228)
Close https://github.com/hasura/graphql-engine/issues/6228

GitOrigin-RevId: 814c38846f49abd8c5ee48129e61d1a00b81a41e
2021-01-13 04:22:40 +00:00
surendran82
3373bbc748 docs: update marketo form
GitOrigin-RevId: 474aa477bda27eaa262815c069a58c61d6cbf3f5
2021-01-12 15:37:34 +00:00
Karthikeyan Chinnakonda
f967a4b22e Server: fix query actions issue used with relationship and configured with permissions
Fixes https://github.com/hasura/graphql-engine/issues/6385

In the v1.3.4-beta.2 version, the SQL generated for a query action containing relationship and configured with permissions parsed the `x-hasura-user-id` session variable value through the `hasura.user` postgres setting instead of passing the session variables as an JSON object to the query as it was in v1.3.3.

This PR fixes the SQL generation to that of v1.3.3

Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 838ba812f89b51df7fcead81b9d3c2885dfa39b4
2021-01-12 12:04:21 +00:00
Aleksandra Sikora
efb5fd70f2 console: update connection_info to be optional
GitOrigin-RevId: 1bf93da749252057c41ef896cfa84f1e6189864e
2021-01-12 10:04:08 +00:00
Karthikeyan Chinnakonda
7b83018c39 Server: fix issue of not being able to track tables with non-compliant GraphQL names (#313)
* server: use only the valid tables in the node parser

* add test

GitOrigin-RevId: 90edf001220c7d78eaab86ff565ee4311844b5d3
2021-01-12 08:13:58 +00:00
Marion Schleifer
b4e72efeb7 docs: fix warning on build
Fix warning on docs build on main

GitOrigin-RevId: 3a5937539f4a1cebfe8770e75605240ab54a8c02
2021-01-12 06:31:27 +00:00
Sameer Kolhar
ffd5e57666 console: update set_table_custom_fields to use set_table_customization API
#### Changelog - (have added an entry)

#### PR Description

This PR resolves https://github.com/hasura/graphql-engine/issues/6284.

 - Updates the API being used as the issue requires.
 - Places a check to raise an error whenever the user tries to save the custom_fields without _any_ input (it was possible in the previous versions of the console)

 - Updated form (picture)

<img width="745" alt="image" src="https://user-images.githubusercontent.com/6604943/103933740-d866a480-5149-11eb-90b2-e1c1c4559902.png">

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: df3127c3c58b5ecf2d6ab79cb95610a96592ca12
2021-01-11 21:59:10 +00:00
hasura-bot
4cbebed2df docs: add <> around placeholders
GITHUB_PR_NUMBER: 5803
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5803

Co-authored-by: Funmilayo E. Olaiya <35759534+codeliezel@users.noreply.github.com>
GitOrigin-RevId: 98c44e8497069ecaab8b74d81279a117cac4b57d
2021-01-11 19:21:40 +00:00
Aleksandra Sikora
0401ce82dc console: replace Hasura logo and favicon in oss and pro consoles
<img width="338" alt="Screenshot 2021-01-07 at 14 02 10" src="https://user-images.githubusercontent.com/9019397/103895599-f0f6a080-50f0-11eb-8bd9-d8b96a43c300.png">

GitOrigin-RevId: 1700238a5d18923120616e7f4944acb05ccd689c
2021-01-11 17:29:58 +00:00
hasura-bot
66a3ad4d36 docs: fix typo
This PR was migrated from https://github.com/hasura/graphql-engine/pull/6254

---
>

### Description
>

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

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

### Related Issues
->

### Solution and Design
>

### Steps to test and verify
>

### Limitations, known bugs & workarounds
>

### Server checklist

#### Catalog upgrade

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

#### Metadata

Does this PR add a new Metadata feature?
- [ ] No
- [ ] Yes
  - Does `run_sql` auto manages the new metadata through schema diffing?
    - [ ] Yes
    - [ ] Not required
  - Does `run_sql` auto manages the definitions of metadata on renaming?
    - [ ] Yes
    - [ ] Not required
  - Does `export_metadata`/`replace_metadata` supports the new metadata added?
    - [ ] Yes
    - [ ] Not required

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

#### Breaking changes

- [ ] No Breaking changes
- [ ] There are breaking changes:

  1. Metadata API

     Existing `query` types:
     - [ ] Modify `args` payload which is not backward compatible
     - [ ] Behavioural change of the API
     - [ ] Change in response `JSON` schema
     - [ ] Change in error code

  2. GraphQL API

     Schema Generation:

     - [ ] Change in any `NamedType`
     - [ ] Change in table field names

     Schema Resolve:-

     - [ ] Change in treatment of `null` value for any input fields

  3. Logging

     - [ ] Log `JSON` schema has changed
     - [ ] Log `type` names have changed

Co-authored-by: Thomas Güttler <414336+guettli@users.noreply.github.com>
GitOrigin-RevId: 8381a182e9f380b98e0ebe918727e0ccae103e14
2021-01-11 14:40:48 +00:00
Shraddha Agrawal
583405bf96 docs: update datadog integration snaps
### Description
This PR updates the datadog integration screenshots.

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

### Affected pages
https://deploy-preview-289--hasura-docs-mono.netlify.app/graphql/cloud/metrics/integrations/datadog.html

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 206234de7e461a04ea75715480fa714b35d185a1
2021-01-11 12:58:57 +00:00
surendran82
79095cf66d docs: update logos
GitOrigin-RevId: 0ea3ff19efe2ff93dac17ca903197ab155bad38f
2021-01-11 10:49:18 +00:00
Aleksandra Sikora
07bde9f577 console: tests improvements and misc fixes to multiple data sources (#315)
GitOrigin-RevId: db7dfce97ac5303cc09974ad7db97beb31e1ae18
2021-01-11 08:04:12 +00:00
Antoine Leblanc
3948ca84da server: RQL code health
This PR is a combination of the following other PRs:
- #169: move HasHttpManager out of RQL.Types
- #170: move UserInfoM to Hasura.Session
- #179: delete dead code from RQL.Types
- #180: move event related code to EventTrigger

GitOrigin-RevId: d97608d7945f2c7a0a37e307369983653eb62eb1
2021-01-08 23:10:36 +00:00
hasura-bot
e44b47f498 ci: activate -Werror in dev.sh config
This PR was migrated from https://github.com/hasura/graphql-engine/pull/6171

---
### Description
A trivial change to make `dev.sh` use -Werror. This is what our CI uses, and it's annoying to have a PR rejected because of a warning that was missed at dev time. Since this is only for `dev.sh`, it won't impact most people's normal workflow.

Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
GitOrigin-RevId: 37c2f088c37326c244533a003bf9b8169448abc8
2021-01-08 21:32:34 +00:00
Antoine Leblanc
0d194724ee server: generalize update schema
### Description

This PR updates the graphql schema to be backend-agnostic. To do so, it also moves the definition of operators to `BackendSchema`, to be specified differently per backend.

GitOrigin-RevId: 35b9d2d1bff93fb68b872d6ab0d3d12ec12c1b93
2021-01-08 19:46:34 +00:00
Rakesh Emmadi
84b5153dc1 replace 'pg_set_table_custom_fields' with 'pg_set_table_customization' in /v1/metadata API (#321)
GitOrigin-RevId: ac770273630321eec224c436c09bd61134bf28c3
2021-01-08 07:42:46 +00:00
hasura-bot
35143b7939 docs: fix wording in delete mutation
GITHUB_PR_NUMBER: 6427
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6427

Co-authored-by: Vlad Minaev <3295727+web-devel@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 522096265fcae4dbef41bf8c586a62b6f3e7a89a
2021-01-07 13:59:48 +00:00
Rakesh Emmadi
be62641f68 server: multi source metadata APIs (#217)
Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io>
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <vishnubharathi04@gmail.com>
Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io>
Co-authored-by: Sameer Kolhar <kolhar730@gmail.com>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
GitOrigin-RevId: 0dd1e4d58ab81f1b4ce24de2d3eab709c2755e6d
2021-01-07 09:05:19 +00:00
Karthikeyan Chinnakonda
44347d2d74 server: template the schema and table names in the event trigger PG functions
Earlier, while creating the event trigger's internal postgres trigger, we used to get the name of the table from the `TG_TABLE_NAME` special trigger variable. Using this with normal tables works fine, but it breaks when the parent table is partitioned because we associate the ET configuration in the schema only with the original table (as it should be).

In this PR, we supply the table name and schema name through template variables instead of using `TG_TABLE_NAME` and `TG_TABLE_SCHEMA`, so that event triggers work with a partitioned table as well.

TODO:

- [x] Changelog
- [x] unit test (ET on partition table)

GitOrigin-RevId: 556376881a85525300dcf64da0611ee9ad387eb0
2021-01-06 20:22:34 +00:00
Swann Moreau
5bc0355bdd [server] coalesce multiple run_sql calls in tests (#270)
GitOrigin-RevId: abd7303aaf8e7a8739fd10574249aec450082ef8
2021-01-06 16:07:22 +00:00
hasura-bot
6f86d3892a docs: remove blank
GITHUB_PR_NUMBER: 6399
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6399

Co-authored-by: Giovane de Loredo <20311005+gloredo@users.noreply.github.com>
GitOrigin-RevId: 9489a0d086510f6a37f84757d304ecf0f04b7068
2021-01-06 12:02:33 +00:00
Vladimir Ciobanu
f4c2bb6370 server: remove unused Catalog.hs module (#296)
GitOrigin-RevId: 473c32c2232573815776f657dc1daa67a314103b
2021-01-06 08:01:53 +00:00
Karthikeyan Chinnakonda
8a7e749a69 server: fix issue when a non-nullable remote schema field was added as nullable (#279)
GitOrigin-RevId: cf6df889d93bc2e4da47e4fbc6c112be99de977a
2021-01-05 14:47:52 +00:00
Funmilayo E. Olaiya
ff598db965 docs: add same field example for _and syntactic sugar (#274)
GitOrigin-RevId: 202ad631b0ed975a20da13c6262602847da8dc71
2021-01-05 07:18:05 +00:00
Marion Schleifer
bdceb08b50 docs: fix syntax warning (#278)
GitOrigin-RevId: 45c3870547ba7f93684e0fa3374d32b31d8130d7
2021-01-04 09:48:47 +00:00
Rakesh Emmadi
29f2ddc289 server: support separate metadata database and server code setup for multi sources (#197)
This is an incremental PR towards https://github.com/hasura/graphql-engine/pull/5797

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
GitOrigin-RevId: a6cb8c239b2ff840a0095e78845f682af0e588a9
2020-12-28 12:56:55 +00:00
Kali Vara Purushotham Santhati
7cefefabd1 support for set table customization
squash support for set table customization

closes #153

GitOrigin-RevId: c4720e526c6415191c790615144f5de377c635f3
2020-12-28 05:37:36 +00:00