Commit Graph

2224 Commits

Author SHA1 Message Date
Philip Lykke Carlsen
2d2fe93adf fix: MSSQL remote relationships handles large results
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10327
GitOrigin-RevId: c7e478f52f7aa7b44a3597886588b0c0f1e7341c
2023-09-25 08:49:43 +00:00
kodiakhq[bot]
07bad7c498 INFRA-832: logs OTLP export
https://hasurahq.atlassian.net/browse/INFRA-832

Foundational work already merged:
- #10171
- 0184ba8bfcae9b
- 699317ffd061d3

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10238
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
GitOrigin-RevId: d88c6a1aafe74e7393873aacc61e6fce3bc7c068
2023-09-13 16:49:55 +00:00
Toan Nguyen
f915c7d1a2 server: support w3c traceparent context
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10218
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: d3dbea6220fd2127ab76c0a240fc4725ca5d6aac
2023-09-13 13:42:30 +00:00
Brandon Martin
db59d5ccf4 Add schema post and deprecate get
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10281
GitOrigin-RevId: 9fae2d61bd5120302ae199016b71e2b0ecac422a
2023-09-07 13:35:29 +00:00
pranshi06
1fbda0f430 server: fix event trigger fetch interval regression
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10276
GitOrigin-RevId: 336bad184a089239bda05a2cb105f2aa8c937d38
2023-09-07 07:23:10 +00:00
Samir Talwar
5e96f9a5a8 server: BigQuery: Add support for _like within permissions.
We missed a few operators in BigQuery permissions, specifically `_like` and `_nlike`. This adds them.

[NDAT-866]: https://hasurahq.atlassian.net/browse/NDAT-866?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10274
GitOrigin-RevId: 4d1ebbdd15b80d09c65c5b792c33dffd618458fe
2023-09-06 14:55:21 +00:00
Brandon Simmons
4d90170437 fix memory leaks in EE related to schema registry
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10250
GitOrigin-RevId: 36f6ff0496852cf4f9c094b71c4315a9e3b27bb1
2023-09-06 02:31:55 +00:00
Philip Lykke Carlsen
76936f0972 feat: Make naming-convention feature generally available
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10214
GitOrigin-RevId: ad99b6e4ad6dbab2b0c6fa7a09b48dcd4d06ee1f
2023-08-31 09:24:00 +00:00
Philip Lykke Carlsen
b522a0f650 fix: Introduce naming-convention-sep-2023 feature flag
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10200
GitOrigin-RevId: 02654837c3b98a7cbfb89cf98a1d7b5287fed1b4
2023-08-28 08:43:08 +00:00
Philip Lykke Carlsen
a3655b0f76 refac: Add sampled feature flags to dynamic schema config
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10199
GitOrigin-RevId: c9cc446daf4ac8d754faa6875199a4f625642646
2023-08-25 09:56:59 +00:00
Toan Nguyen
d40f9057e4 server: support environment variable template for open telemetry URLs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10165
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: ef145deb469007c4a04237ec2219e0f81be8d6c9
2023-08-24 02:24:46 +00:00
Philip Lykke Carlsen
3f9abc4477 chore: Linting
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10182
GitOrigin-RevId: f6680570cea8f0202e705559a048e4a654fe50bb
2023-08-23 15:39:37 +00:00
Philip Lykke Carlsen
9bce420005 refac: Reduce duplication in server init functions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10181
GitOrigin-RevId: e833ae6896adaa90d02c32bd49ad2f1d683248d7
2023-08-23 14:24:56 +00:00
Philip Lykke Carlsen
ef33c3459f refac: Include CE feature flags in PRO and Cloud
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10180
GitOrigin-RevId: db185aa0edb717efe36d6572012078b4eb3aaf7e
2023-08-23 13:32:23 +00:00
Brandon Simmons
5d96d9836b server: more refactoring for INFRA-832
No functional changes.  DRY the otlp http client code, in preparation for reuse in logs exporter code.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10171
GitOrigin-RevId: c13c587d6d4775e992642a79c798193762efa527
2023-08-23 10:24:29 +00:00
paritosh-08
e1cfc56fc3 server: add remote source relationship in permission
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9575
GitOrigin-RevId: 4566d51d48f9ace583b04fbe04c534d6aeb771ea
2023-08-22 14:35:14 +00:00
Daniel Harvey
f4c9c16f0e chore(server): add Table -> NQ array relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10150
GitOrigin-RevId: fc4ea33b1951cb960187bb53d4c3ef8471566dc9
2023-08-22 12:39:49 +00:00
kodiakhq[bot]
7258c0ccdc INFRA-832: incremental refactoring PR 2
Some refactorings required for https://hasurahq.atlassian.net/browse/INFRA-832 . No functional changes.

Also included is a small but important un-related bug fix

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10136
GitOrigin-RevId: 5468c5b5b1693c0c3b8781c9fa47191ad66fefca
2023-08-18 10:57:58 +00:00
Daniel Chambers
c726b528c4 Add table/function filtering and detail level to schema introspection for Data Connectors to improve performance
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10074
GitOrigin-RevId: 12de7387746f456cbefd9f76e446f56e9e643dc9
2023-08-18 04:29:17 +00:00
Daniel Harvey
f8d60a74a0 chore(server): Table -> Native Query object relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10114
GitOrigin-RevId: 0181184d1bc0e851151f86a98c96c97888a10e3e
2023-08-17 15:35:31 +00:00
Samir Talwar
15ac52ded4 server: Fix the Analyze feature for SQL Server.
The "Analyze" feature for SQL Server only partially worked. It would show the SQL generated, but not the execution plan. This is because SQL Server doesn't support generating a plan for prepared statements with parameters.

To work around this, we restructure the query as one without parameters. Instead, we replace each parameter with a variable. We declare the variables but don't set values. We then plan _that_, which works.

We run all this in a single query because local variables only last for a single transaction/batch.

This feature does not work for stored procedures.

[NDAT-582]: https://hasurahq.atlassian.net/browse/NDAT-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10125
GitOrigin-RevId: a4b45b9b207456ff4fbd1b69b008e93f87346342
2023-08-17 12:51:57 +00:00
Lyndon Maydwell
41054de113 Data Connectors Native Queries Support
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9499
Co-authored-by: gneeri <10553562+gneeri@users.noreply.github.com>
GitOrigin-RevId: 1e351556c43e643aa973f87adc0306f076cd227e
2023-08-17 02:05:14 +00:00
Daniel Chambers
131fe3d9e6 Block the use of column redaction where the data connector agent does not support it
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10108
GitOrigin-RevId: 830102b8cf1e6ad53b9971460dee147b678f008d
2023-08-15 05:13:15 +00:00
Daniel Harvey
c04c4bc0d9 chore(server): Native Query -> Table array relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10100
GitOrigin-RevId: 55f38a904767e1b25916fb31b3c5ece898c10349
2023-08-14 12:35:53 +00:00
David Overton
7a9e1f6ea6 Order by nested fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10082
GitOrigin-RevId: 9c53d7ce3635f442451e04f70f0975ed79a3f4f7
2023-08-14 06:41:50 +00:00
Daniel Harvey
cd324f747b chore(server): Native Query -> Table object relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10098
GitOrigin-RevId: 9b98bb0e285560cd03b04f867d1fa16dadd00df9
2023-08-10 14:23:47 +00:00
Krushan Bauva
d9283e1cac server: add dynamic labels to Prometheus metric hasura_websocket_messages_sent_bytes_total
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9920
GitOrigin-RevId: 7fb49f07d7914d08576dd0062fbea406b897e45e
2023-08-10 11:53:34 +00:00
Brandon Simmons
f6bbda77eb pro/server: add monitoring metrics for OTLP traces export
re. https://hasurahq.atlassian.net/browse/INFRA-832

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10080
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
GitOrigin-RevId: 8de1c0a1703037cc9955da01f2593c2db15dc189
2023-08-10 10:35:14 +00:00
pranshi06
75f0629c5d server: change log level to error for triggers in Cloud
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9873
GitOrigin-RevId: 703a16da479d35908a9a8c2862884d11a3135731
2023-08-10 10:04:05 +00:00
Auke Booij
465940abc1 server: fix issue with remote schema customisation & null values
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9929
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 60f9c4f99d9229cd0f29763d8055e791837cddf1
2023-08-10 06:42:36 +00:00
Samir Talwar
2d7bb085d5 server: Support _contains and _contained_in in permissions.
We recently added support for the `_contains` and `_contained_in` operators for PostgreSQL arrays. However, they weren't available in permissions.

This adds support for these operators for arrays too.

As these operators are overloaded to work with either JSONB or arrays, no validation is done on the value. If the value is not an array, it will fail when making a query.

[NDAT-806]: https://hasurahq.atlassian.net/browse/NDAT-806?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10075
GitOrigin-RevId: 02e4a57d39ac3303205c37add4186a587f65e409
2023-08-09 15:45:54 +00:00
paritosh-08
ed43fe9863 server/console: fix Apollo Federation UI to extend table types in other subgraphs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10071
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 5acbc792fd8b3fd9ae6a02ea740b3e13040b9c72
2023-08-09 12:55:14 +00:00
Tom Harding
29bb76d6d3 Fix inherited roles leaking supposedly-hidden data via aggregation predicates for BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10049
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: d0af2d29e29111097e17033e10c41d668eb5a351
2023-08-09 11:52:58 +00:00
Brandon Simmons
ff954543ac server: fix for #9552: respect enabled data_types list
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10037
GitOrigin-RevId: a6465d61c2687ea8acf314532ba723664b849694
2023-08-07 15:13:01 +00:00
David Overton
5b70da8138 Nested permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10069
GitOrigin-RevId: 6bdde406a57e394f7bf4cc1bae2b6411cbb4ffe0
2023-08-07 04:58:22 +00:00
pranshi06
7647456718 server: configuration to specify which Header to pick for JWT Authentication
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9942
GitOrigin-RevId: 4f18d29f07c213a001d43b88e3ce2991230e28e6
2023-08-04 10:37:40 +00:00
Daniel Chambers
68f7d6e9a4 Add inherited roles data redaction support to the Data Connector API
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10023
GitOrigin-RevId: d6947dd89dc59fce3f68b786192c59e731826c60
2023-08-03 06:10:53 +00:00
Philip Lykke Carlsen
2cb66592c3 fix: Apply naming conventions in more places
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9988
GitOrigin-RevId: e74797306a6a131b9b038a20cc6e40befb33ab77
2023-08-02 13:47:21 +00:00
Daniel Harvey
6aae78c8e1 chore(server): add track/untrack stored procedure metadata commands to bulk_atomic
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10013
GitOrigin-RevId: 3843e379e08bcb65e65110fc8217acc05cf7640a
2023-08-01 08:15:28 +00:00
David Overton
23d40fc500 Nested where
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9940
GitOrigin-RevId: c2115f1de4f647c4b559c98183c6260a1f5674dd
2023-08-01 05:41:36 +00:00
Daniel Chambers
374bbd1937 Fix inherited roles leaking supposedly-hidden data via native queries in Postgres
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9980
GitOrigin-RevId: 48174a559453d802991b475caf337808d2462356
2023-08-01 02:29:19 +00:00
Daniel Chambers
7b2647e4e9 Fix inherited roles leaking supposedly-hidden data via streaming subscriptions for Postgres
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9977
GitOrigin-RevId: 56da6f97477095a1930cd29ff87ba5c3832d59f4
2023-08-01 01:47:44 +00:00
Krushan Bauva
94a2b6348a server: add Prometheus metric hasura_websocket_message_write_time and fix hasura_websocket_message_queue_time
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9879
GitOrigin-RevId: 9dd82d01faa367fa67950a7f5f55a61fc396b27f
2023-07-28 11:38:57 +00:00
Samir Talwar
1a052dd44b server: Avoid partial fields wherever possible.
This turns on the `partial-fields` warning, which yells at you if you try and create fields on sum types that end up being partial functions. These are dangerous; we had a bug because we introduced a new case to a data type, making the field accessors partial, and leading to a crash in certain cases.

This means that we have introduced a few wrappers in various places where the field names are useful, but we want to avoid partial matches.

Unfortunately this can be turned off by prefixing the field name with an underscore. Ideally we would try and avoid exporting any field names with underscores, but lenses make this hard. I have removed some underscores for the areas in which we've seen this break in the past.

We will have to be vigilant.

[NDAT-794]: https://hasurahq.atlassian.net/browse/NDAT-794?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9991
GitOrigin-RevId: fd69b1ef999682969f3507f0e97513f983da4da6
2023-07-28 10:54:24 +00:00
Philip Lykke Carlsen
cf2d205937 Fix(Sqlserver): Apply Column Redaction to order_by and _where
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9971
GitOrigin-RevId: 04cae8163af2d002a2d5aea73fb45088fc0eaea4
2023-07-26 16:05:00 +00:00
Puru Gupta
b3a128065f server: add tenant policy to enable/disable otel exporter
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9928
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
GitOrigin-RevId: 56c6903691353875f87bf417c332ac89cdda1279
2023-07-26 12:50:10 +00:00
Daniel Chambers
bae14c70d4 Fix inherited roles leaking supposedly-hidden data via aggregation predicates for Postgres
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9961
GitOrigin-RevId: cffe2fda2f4dbc7929fc1aaac3887b7d12c4b467
2023-07-26 12:07:34 +00:00
Philip Lykke Carlsen
483409c26b Fix(Sqlserver): Apply Column Redaction to aggregations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9956
GitOrigin-RevId: ed7a734fabcaaead85999a25223a61f0cba7807c
2023-07-26 08:53:56 +00:00
Brandon Simmons
f0441a3d61 INFRA-833: OpenTelemetry exporter for metrics
I scratched out some changes to support this in the front end, mostly to test it easily,   maybe this can be used without much rework (validation seems to work correctly, but the tests need to be extended and probably fixed):

<img width="648" alt="fd" src="https://github.com/hasura/graphql-engine-mono/assets/68095256/e5873a90-ef83-43c3-9d54-cfc0a693baca">

-------

## Fake OTel collector for testing

ChatGPT spit this out, and it's what I used to test, if it's useful to others:

``` python
from flask import Flask, request
from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import ExportTraceServiceRequest
from opentelemetry.proto.collector.metrics.v1.metrics_service_pb2 import ExportMetricsServiceRequest
import google.protobuf.json_format as json_format

app = Flask(__name__)

@app.route("/v1/traces", methods=["POST"])
def handle_traces():
    if request.method == 'POST':
        binary_trace = request.get_data()
        trace_request = ExportTraceServiceRequest()
        trace_request.ParseFromString(binary_trace)
        print("Received trace data:\n")
        print(json_format.MessageToJson(trace_request, indent=2, preserving_proto_field_name=True))
        return "Trace data received", 200

@app.route("/v1/metrics", methods=["POST"])
def handle_metrics():
    if request.method == 'POST':
        binary_metric = request.get_data()
        metric_request = ExportMetricsServiceRequest()
        metric_request.ParseFromString(binary_metric)
        print("Received metrics data:\n")
        print(json_format.MessageToJson(metric_request, indent=2, preserving_proto_field_name=True))
        return "Metrics data received", 200

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9552
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: f340bfc5c135a7bb24735b524d015e05db422fd2
2023-07-26 05:22:17 +00:00
Daniel Chambers
fa1441ac3b Enable inherited role redaction tests for Citus and Cockroach and fix DISTINCT ON for Cockroach
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9951
GitOrigin-RevId: b078006a14ebdc007576314405734734ad1944c4
2023-07-26 04:50:25 +00:00