Commit Graph

8183 Commits

Author SHA1 Message Date
Daniel Harvey
847f81ad96 Separate relationships resolve stage (#522)
<!-- Thank you for submitting this PR! :) -->

## Description

This separates out the stage that resolves relationships. The most
important thing here is that we no longer have a `relationships` field
in `ObjectTypeRepresentation` that may or may not be populated, and
instead add a new wrapper type `ObjectTypeWithRelationships`, which is
used downstream of this stage.

Stacked on top of https://github.com/hasura/v3-engine/pull/521

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 1e6ca41e55b8cc470385c35bbd7999fa7a2bce6e
2024-04-29 14:57:27 +00:00
Daniel Harvey
b1149c26de A few more loose metadata stages (#521)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/520, there are a
couple of loose things that occur in the big metadata resolve, given
them their own stages too. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2b7454ce997411da7dd9551ac05a4180b137e0a0
2024-04-29 14:41:54 +00:00
Daniel Harvey
569fec0e4c Separate commands metadata resolve stage (#520)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/519 here is the
equivalent change for `commands` which are fortunately, much simpler.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 24ec7107018ed29e251452c9ca19c5b0538cd0c6
2024-04-29 13:22:38 +00:00
Daniel Harvey
8a9bfaaa6b Separate models metadata resolve step (#519)
<!-- Thank you for submitting this PR! :) -->

## Description

As per https://github.com/hasura/v3-engine/pull/483 and all PRs
proceeding it, this moves the resolving of Models into a discreet
metadata stage. The `resolve::model` module was a bit of a dumping
ground, so I have tried to find more sensible homes for a lot of things,
but some things remain (model permissions) and will be homed when
sorting later stages.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: b41bcc9f413a867f21dd72b5d7affee8d55e02df
2024-04-29 12:54:22 +00:00
dependabot[bot]
0eb062d168 Bump strum_macros from 0.25.3 to 0.26.2 (#514)
V3_GIT_ORIGIN_REV_ID: 11e583559b0143e8fa7056a39c98c20fff6bb83e
2024-04-29 10:11:26 +00:00
dependabot[bot]
2649b443f4 Bump apollo-parser from 0.4.1 to 0.7.7 (#517)
V3_GIT_ORIGIN_REV_ID: 13f05ec1a9a909c3b713b99df08a6d169a1b3a3a
2024-04-29 08:47:57 +00:00
dependabot[bot]
31a1d7127d Bump proc-macro2 from 1.0.79 to 1.0.81 (#516)
V3_GIT_ORIGIN_REV_ID: 67c49e71d071d272da37e0a8e1c34ac36423f64d
2024-04-29 08:31:10 +00:00
dependabot[bot]
8dc66fa758 Bump cookie from 0.17.0 to 0.18.1 (#515)
V3_GIT_ORIGIN_REV_ID: 40af3675b9c3a230d7e70148797ce28e5b1e85cc
2024-04-29 08:14:57 +00:00
Daniel Harvey
6b826ef41d Move boolean expressions into own metadata resolve stage (#512)
<!-- Thank you for submitting this PR! :) -->

## Description

More metadata resolving into stages, this time the resolving of boolean
expressions. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 5b74f7cd17f919dc54b82c003b7dd937eb69b65e
2024-04-26 15:00:37 +00:00
Daniel Harvey
6a791bc913 resolve predicates in the context of types (#444)
<!-- Thank you for submitting this PR! :) -->

## Description

This implements the first part of passing boolean expressions as command
arguments. It adds a `BooleanExpression` arm to `ValueExpression`, and
allows them to be resolved in the context of an ObjectType rather than
an entire model.

This means that if a boolean expression is passed to a command argument
that uses a field that doesn't exist, this happens:

<img width="960" alt="Screenshot 2024-04-05 at 15 54 20"
src="https://github.com/hasura/v3-engine/assets/4729125/cd795bc1-9fda-4cfb-bad3-1e70dd6227a0">

The output of this PR is that we can resolve metadata for boolean
expressions in command arguments, and generate a GraphQL schema for
them, but will throw an error if one is actually used. This will be
resolved in the follow-up PR.

V3_GIT_ORIGIN_REV_ID: 20b8840c313d7ee1f56ebd5becdb28bbe7743350
2024-04-26 14:06:12 +00:00
Daniel Harvey
c8e6efdc4e Remove data_connector from metadata step (#509)
<!-- Thank you for submitting this PR! :) -->

## Description

As part of moving types and functions into resolve stages, this gets rid
of the root-level `data_connector` module and moves it's types into
`data_connectors` and `data_connector_scalar_types` as appropriate.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3109cc17931f0db42c7a4448c6d6194033f700e4
2024-04-26 09:11:31 +00:00
Daniel Harvey
4ea88180d7 create Docker images with Nix (#507)
<!-- Thank you for submitting this PR! :) -->

## Description

In order to test things quicker, we'd like to be able to build custom
connector and friends in Nix, and then use the containers when running
tests. First step here is to be able to build Docker containers in Nix,
and add a CI job to ensure it still works.

Then we'll move onto publishing and using these images.

No-op build times:

<img width="336" alt="Screenshot 2024-04-25 at 15 53 56"
src="https://github.com/hasura/v3-engine/assets/4729125/47cbc0c5-6e54-4583-aa01-0528d4a21080">

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 8f9d609e26cdd3b0801e61fd361c241ad504dcdf
2024-04-26 08:44:04 +00:00
Daniel Harvey
d8846328c4 Move TypeMapping and FieldMapping to data_connector_type_mappings stage (#510)
<!-- Thank you for submitting this PR! :) -->

## Description

As everything is taking shape we're finding more loose bits and pieces
around, this moves `TypeMappings` and `FieldMappings` into the
`data_connector_type_mappings` stage. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2357e47b68d361b373f9fa886683ceb1fcff7cc3
2024-04-26 08:04:40 +00:00
Daniel Harvey
9d25ee2075 Add time limits on generate_ir benchmarks too (#508)
<!-- Thank you for submitting this PR! :) -->

## Description

I wondered why some benchmarks were very quick seconds and others very
slow (hours). Turns out I only told half of them that I would prefer
them to be fast. Rectified.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 40bbcc6829e9a4ea85058f2983136024a9971e3b
2024-04-25 15:43:52 +00:00
ashwiniag
8d596f639e ci: tag release v2.39.0-beta.1 and updates base image
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10779
GitOrigin-RevId: 97e0de3147e9b79c1048c0449181d697c6ea3f5a
2024-04-25 15:14:48 +00:00
Rob Dominguez
c42aeb15e3 Docs: improve backend-only permissions
[DOCS-1983]: https://hasurahq.atlassian.net/browse/DOCS-1983?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10776
GitOrigin-RevId: 7252aad199edfabe0d207edfa3f437f2ccaeab94
2024-04-25 13:40:32 +00:00
Rob Dominguez
8b0ae5fcb0 Docs: Turn OTEL into a directory
[DOCS-1987]: https://hasurahq.atlassian.net/browse/DOCS-1987?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10775
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
GitOrigin-RevId: 8f17e6d8b0097965835708d32e217035ff872afd
2024-04-25 13:35:39 +00:00
hasura-bot
c10336bade Fix jeager typo in kubernetes-helm.mdx
GITHUB_PR_NUMBER: 10216
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/10216

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10778
Co-authored-by: Josh <5693033+joshpaulchan@users.noreply.github.com>
GitOrigin-RevId: 6243517fde237ab7aadac1a88b8829e852c8b169
2024-04-25 13:35:28 +00:00
Daniel Harvey
746b18c9c4 Rename get_underlying_object_type (#506)
<!-- Thank you for submitting this PR! :) -->

## Description

The function changed, the name did not, now it makes no sense. Also it's
friend wasn't even used anymore. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 626316acd06f15d89e504365d21131177a41dada
2024-04-25 08:37:59 +00:00
Daniel Harvey
89812dd1ee Bump Criterion lib (#504)
<!-- Thank you for submitting this PR! :) -->

## Description

Benchmarks are running pretty slowly in Github, let's check it's not an
old library version problem.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: db1a70c5465cf475fa66d2afc981fd496eccacaa
2024-04-24 15:53:42 +00:00
Philip Lykke Carlsen
f54b5cd3ef A collection of scripts to setup read replicas wtih ssl
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10777
GitOrigin-RevId: 0243fa6f2b20c2482be904702055d0470e855284
2024-04-24 15:48:14 +00:00
Daniel Harvey
e292cc6e94 Typechecking helper (#505)
<!-- Thank you for submitting this PR! :) -->

## Description

Listen, I love copy paste, but even I have my limits. Functional no-op.

V3_GIT_ORIGIN_REV_ID: b917cffdfa9289f3fabc105a0d4581fb64998e44
2024-04-24 15:33:57 +00:00
Daniel Harvey
9761fb47bc Separate type_permissions metadata resolve stage (#481)
<!-- Thank you for submitting this PR! :) -->

## Description

This splits calculating permissions for types into it's own discreet
stage, and adds a separate `ObjectTypeWithPermissions` type that is
different from the `ObjectTypeRepresentation` type.

90% of this is changing the types that later stages in metadata resolve
use.

Functional no-op.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 304a0b7f047dde65b23a7dbcb7775720cebd928e
2024-04-24 13:15:19 +00:00
Tom Harding
03856be0e0 Add kind and version to examples (#451)
<!-- Thank you for submitting this PR! :) -->

## Description

The docs.hasura.io site pulls through these examples for documentation.
We'd like to make them more copy/paste-friendly, so we add these fields
even though they're technically discriminators from parent types.

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [ ] community-edition
- [ ] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [ ] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

_Replace with changelog entry_

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: 9c121367fba187b11801f023208733b1c9ce0337
2024-04-24 12:35:09 +00:00
Samir Talwar
d1a8514a2b Add a host argument and environment variable. (#502)
## Description

This allows the engine to be configured to listen on a specific host.

Mostly useful in testing on macOS, as it can be told to listen on
localhost (`::1`) to avoid firewall notifications.

I have also added doc comments to arguments, which will show up in the
help text when running the engine with `--help`.

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [x] community-edition
- [ ] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [x] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

The v3 engine can now be configured to listen on a specific host IP
(e.g. `::1` for localhost). This can be useful when securing the service
or in testing.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: ac988ce3c6fcdf4545dcb38d29e1aaf5d2fd7d2e
2024-04-24 10:45:28 +00:00
Daniel Harvey
93dfa95dac Move ObjectTypeRepresentation to stage that owns it (#503)
<!-- Thank you for submitting this PR! :) -->

## Description

Resolving stages should own their types, this moves
`ObjectTypeRepresentation` and friends. Functional no-op.

V3_GIT_ORIGIN_REV_ID: ad1933ed547e72e35e853cae22beadf1de5f0459
2024-04-24 10:21:10 +00:00
Samir Talwar
b98e8ce3c2 Include the dev-auth-webhook crate in the workspace. (#500)
Now that the Dockerfile is in the root, there's no reason not to.

V3_GIT_ORIGIN_REV_ID: 62199715c2a5aaaf1ac45e22c9d8bdac6838fd72
2024-04-24 08:12:37 +00:00
Daniel Harvey
ee4e4eaabe untangle input boolean expressions from models (#460)
<!-- Thank you for submitting this PR! :) -->

## Description

Previously boolean expressions were only used on where clauses for
models. We'd also like to use them for arguments for commands to make
permissions work. This PR splits a boolean expression from it's model.
This has the nice side effect of allowing the same boolean expression
type to used across multiple models, which is a sensible thing to want
to be able to do.

Before this change, using the same boolean expression type on two models
would give you this error:

<img width="783" alt="Screenshot 2024-04-19 at 11 53 23"
src="https://github.com/hasura/v3-engine/assets/4729125/bcc7a4b9-8b6f-4d82-9860-190621c0f5fd">

<!--
  Questions to consider answering:
  1. What user-facing changes are being made?
2. What are issues related to this PR? (Consider adding `(close
#<issue-no>)` to the PR title)
  3. What is the conceptual design behind this PR?
  4. How can this PR be tested/verified?
  5. Does the PR have limitations?
  6. Does the PR introduce breaking changes?
-->

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [X] community-edition
- [X] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [X] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

Allow the same `ObjectBooleanExpressionType` to be shared between
multiple models.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: 6c9979ddaad50d476c0996d1ece48f0cf1c8e99d
2024-04-23 15:51:45 +00:00
Anon Ray
bee983c902 support field presets for input types (#454)
Support field presets in input permissions of object types.

V3_GIT_ORIGIN_REV_ID: 55c024af40361d2f77e61dbf4114b57038b20ba5
2024-04-23 15:02:04 +00:00
Samir Talwar
2c2ffa05bf All benchmarks must be Criterion benchmarks. (#498)
This ensures only Criterion benchmarks get called by `cargo bench`.
Previously, some tests were being loaded too. This is an issue because
if we want to provide command-line arguments to Criterion, it will fail
if we run a non-Criterion benchmark.

We need to specify `harness = false` for each benchmark so that they
don't get wrapped by Cargo, and `bench = false` for everything that
doesn't contain benchmarks but _could_ (i.e. unit and integration
tests). I find Cargo very strange in this regard.

In addition, I fixed the validation benchmark by providing a valid SDL
schema.

V3_GIT_ORIGIN_REV_ID: 338ac5b1411eec7af32923863c5b6f3933c0454b
2024-04-23 13:00:24 +00:00
Samir Talwar
09282cb304 Join slices directly, rather than mapping to &str. (#489)
This means we can remove the `itertools` dependency entirely.

V3_GIT_ORIGIN_REV_ID: 88101b5b7bb3def081756414acd77f0a9e72f5ae
2024-04-23 10:16:34 +00:00
Samir Talwar
117c11d18f Do not include debug symbols in release builds. (#493)
This shrinks the Docker image size by half.

I have also normalized the two Dockerfiles so they share a cache for
longer.

V3_GIT_ORIGIN_REV_ID: f976725b09ad2c8022a912b15cdcde55ce5a9486
2024-04-23 09:42:45 +00:00
Samir Talwar
29408c7854 Fix the benchmarks. (#494)
The benchmarks were not working because they couldn't access Git
information. While this is fair, they didn't actually fail, they kept
going, so I have improved the script to fail hard, and fixed the bug by
setting `RELEASE_VERSION` so the build script doesn't bother trying to
read Git.

V3_GIT_ORIGIN_REV_ID: 9573ea32371d7a4d7b99c87017a8d5d77815832c
2024-04-23 09:20:18 +00:00
Anon Ray
a37c2e13ce support GraphQL variables in tests (#495)
## Description

This PR adds support for GraphQL variables in test cases. This can be
done by adding variables in `variables.json` file in the same directory
as the `request.gql`, `session_variables.json` files. This file is
optional.

Note that it expects a list of variable sets. Each item in the list
corresponds to a variable for each session in `session_variables.json`.
This is useful to run the same query, but with different variables for
different sessions.

Example `session_variables.json` -

```json
[
    {
        "x-hasura-role": "admin"
    },
    {
        "x-hasura-role": "user_1"
    },
    {
        "x-hasura-role": "user_2"
    }
]
```

Example `variables.json`

```json
[
    {
        "upper_bound": 4
    },
    {
        "upper_bound": 3
    },
    {
        "upper_bound": 2
    }
]
```

PS: this PR only modifies the `test_execution_expectation` function, and
not the `test_execution_expectation_legacy` function.

This PR is required to add some tests for #454

V3_GIT_ORIGIN_REV_ID: 31a6f8adc3521367960986d2bc070271ba3e2d73
2024-04-23 08:48:15 +00:00
Daniel Harvey
ccea4ed181 Move ScalarTypeRepresentation type to stage that owns it (#483)
<!-- Thank you for submitting this PR! :) -->

## Description

Resolving stages should contain the types they produce, so this moves
`ScalarTypeRepresentation` to the `scalar_types` stage and updates
imports. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 24681009ddbf216d3a57b7cb729d644f687cb0c6
2024-04-23 08:30:05 +00:00
paritosh-08
640457b09a allow null for nullable field (#490)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR fixes the bug where passing a null value to a nullable input
field resulted in an error. It also uncomments the test for that.

JIRA: https://hasurahq.atlassian.net/browse/V3ENGINE-97

According to [the graphql
spec](https://spec.graphql.org/October2021/#sec-Null-Value):

>
>
> ```graphql
> {
>   field(arg: null)
>   field
> }
> ```
> The first has explicitly provided null to the argument “arg”, while
the second has implicitly not provided a value to the argument “arg”.
These two forms may be interpreted differently.

We are also considering the two cases separately, i.e., if something is
absent and nullable vs if something is set to null and is nullable. We
are not manually adding the nullable fields and setting them to null if
not specified explicitly.

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [x] community-edition
- [x] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [ ] enhancement
- [x] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

allow null for nullable field

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

---------

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 4aa181899379905aaca1a71f498b85515180ae1d
2024-04-23 08:07:28 +00:00
Tom Harding
6b09fcdc06 Require that subgraph names be valid identifiers (#492)
As per
[V3ENGINE-112](https://hasurahq.atlassian.net/browse/V3ENGINE-112), we
now require that subgraph names be valid graphql identifiers. This PR
updates the type of an `OpenDdSubgraph` to reflect this.

<!-- Thank you for submitting this PR! :) -->

## Description

<!--
  Questions to consider answering:
  1. What user-facing changes are being made?
2. What are issues related to this PR? (Consider adding `(close
#<issue-no>)` to the PR title)
  3. What is the conceptual design behind this PR?
  4. How can this PR be tested/verified?
  5. Does the PR have limitations?
  6. Does the PR introduce breaking changes?
-->

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [ ] community-edition
- [ ] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [ ] enhancement
- [ ] bugfix
- [x] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

Subgraph names are now required to be valid GraphQL identifiers (that
is, to match `"^[_a-zA-Z][_a-zA-Z0-9]*$"`).

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

[V3ENGINE-112]:
https://hasurahq.atlassian.net/browse/V3ENGINE-112?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: Tom Harding <tom.harding@hasura.io>
V3_GIT_ORIGIN_REV_ID: 616c77a41490e079f6fb03a919f83d3e61270cc5
2024-04-22 15:52:02 +00:00
Samir Talwar
572fc54a54 Speed up debug builds in Docker. (#484)
This splits out a `debug.Dockerfile` which makes use of out-of-band
caching to speed up builds drastically, at the expense of
reproducibility.

It is used to run tests and auxiliary test services (i.e. the custom
connector).

The new `debug.Dockerfile` marks the Cargo dependency and build caches
as Docker caches, which means they are shared between builds. This is
probably fine for local work and testing. The `Dockerfile` continues to
not use a cache like this, to guarantee that it is not polluted by extra
information, at the expense of build speed.

In addition, we build a `nextest` archive ahead of time to avoid
building tests when attempting to run them.

On my machine, a re-run of `just test` now takes seconds.

I have also sped up the `postgres` container start time by creating a
database called "finished" last, and then waiting for that to show up.

V3_GIT_ORIGIN_REV_ID: 7ef0548361987175b68a0cad44c8f2295110a1fb
2024-04-22 13:43:29 +00:00
Daniel Harvey
019a7ae874 Ask benchmarks to be quicker please (#485)
<!-- Thank you for submitting this PR! :) -->

## Description

Making the graphs is taking too long, re-adding this advisory
measurement time to them.

V3_GIT_ORIGIN_REV_ID: e45ef4b8b8c8fd0cf45aacb989dd2e382b6b958a
2024-04-22 10:59:53 +00:00
dependabot[bot]
c779b3511c Bump anyhow from 1.0.81 to 1.0.82 (#486)
V3_GIT_ORIGIN_REV_ID: 6a1383092ff83a2d6bdfebc008124f1b710e13f4
2024-04-22 10:03:53 +00:00
dependabot[bot]
58c3cf75b7 Bump bson from 2.9.0 to 2.10.0 (#487)
V3_GIT_ORIGIN_REV_ID: 7be9ec538e221a7d2203aab3e356d249dad5d540
2024-04-22 09:42:13 +00:00
dependabot[bot]
4762f167ea Bump base64 from 0.21.7 to 0.22.0 (#488)
V3_GIT_ORIGIN_REV_ID: b5706296b08d72e4dceeb475c48d94399746f49d
2024-04-22 09:19:07 +00:00
Daniel Harvey
838b6016f4 Extract DataConnectorCoreInfo from types (#482)
<!-- Thank you for submitting this PR! :) -->

## Description

Had two types that were identical except for their `scalars` field. Have
extracted the commonality to make this easier to change in future.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 4ab5582e8ca62fc85345c6273cab3b0c4741b38b
2024-04-19 15:57:30 +00:00
Samir Talwar
b0af7bf3ca Convert more values to references. (#479)
I was on a roll.

I also replaced `futures` with `futures-util`, which is theoretically
smaller.

V3_GIT_ORIGIN_REV_ID: 27228a506f1edb6d0e33a4c61499e500cc5d0df7
2024-04-19 15:24:04 +00:00
Samir Talwar
723938a441 Bundle custom connector data with the binary. (#480)
This changes the way we build the custom connector so that the data is
baked in at compile time, not loaded from the file system at runtime.
This simplifies packaging.

I also took the liberty to switch out `.unwrap()` for `anyhow`, and to
avoid parsing a string to construct the socket address.

V3_GIT_ORIGIN_REV_ID: d562e0a9852b4e3ecde45bd6938d8eb1b066211b
2024-04-19 15:06:11 +00:00
Daniel Harvey
b9b7d1f9b5 Run benchmarks in Github Actions (#476)
<!-- Thank you for submitting this PR! :) -->

## Description

This adds graphing of benchmarks for `v3-engine` like we do in
`ndc-postgres`: https://hasura.github.io/ndc-postgres/dev/bench/

Voila! https://psychic-doodle-372212k.pages.github.io/dev/bench/

V3_GIT_ORIGIN_REV_ID: f164a0a5dc8ab58f5a224f90e48e49208c87094f
2024-04-19 09:12:24 +00:00
Samir Talwar
5317384d78 Set trace headers when making HTTP requests during JWT auth. (#477)
## Description

We set W3C and B3 trace headers when making JWT authentication HTTP
requests to obtain JWKs. This will allow us to figure out what's going
on if we spend a lot of time here.

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [ ] community-edition
- [x] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [x] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

- JWT authentication requests over HTTP now propagate trace headers when
making request for JWKs. These can be used to identify latency in
authentication.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: 70fa68c85eb4ffcc76e445771263ce08496dc4b4
2024-04-18 18:12:53 +00:00
Samir Talwar
c7d9baaf66 Use references where possible instead of cloning. (#478)
When trying to reduce the number of dependencies we use in the engine, I
was blocked by a few `.clone()` calls that, on inspection, turned out to
be completely unnecessary.

I have replaced those with passing by reference, and then gone on a
pedant spree. I enabled the `needless_pass_by_value` Clippy warning and
fixed it everywhere that it highlighted. In most places, this meant
adding `&`, but I also marked some types as `Copy`, which makes
pass-by-value the right move.

In one place, I replaced calls to `async_map` with `if` and `else`, to
avoid constructing closures that capture across async boundaries. This
means I could just delete `async_map`.

V3_GIT_ORIGIN_REV_ID: 6ff71f0c553b707889d89552eff3e8c001e898cc
2024-04-18 17:35:48 +00:00
Daniel Harvey
7b510d1373 Separate data_connector_scalar_types into discreet metadata resolve stage (#472)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/470 , split data
connector scalar type representations resolve step into a separate stage
and files etc. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3bcef6b58c0a4f4f7fa529456cb4261667a7e0ce
2024-04-18 16:12:21 +00:00
Rikin Kachhia
de2cdc70d8 fix permission builder dropdowns with single value
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10771
GitOrigin-RevId: b5a8b382c1ab5857906bd46bc073e89c0a52a4c0
2024-04-18 12:50:39 +00:00