Commit Graph

8837 Commits

Author SHA1 Message Date
Daniel Harvey
e2205b221c Keep reference to http_context instead of owned copy (#1159)
<!-- The PR description should answer 2 important questions: -->

### What

When we merged the PR that added `ResolveFilterExpressionContext`
(amongst other changes, sadly), the `Generate Query Plan` got slower.
Changing this to a reference to try and improve it. Locally run
benchmarks show this as mostly an improvement.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

Use reference to `http_context` inside `ResolveFilterExpressionContext`,
remove resulting `.clone()` calls.

V3_GIT_ORIGIN_REV_ID: b7e728cf4f376f7c69b83eab0d79a43c90ee265b
2024-09-26 13:02:52 +00:00
Daniel Harvey
a3efbc98d7 Start of GraphQL -> OpenDD IR pipeline (#1156)
<!-- The PR description should answer 2 important questions: -->

### What

We are going to need tests for our OpenDD IR pipeline, and we are going
to need to convert GraphQL requests into OpenDD IR at some point, so
this makes the most basic `normalized_ast -> OpenDD IR QueryRequest`
pipeline and implements / tests it for the simplest possible query.

This only affects tests at this point, so is a functional no-op.

### How

This PR adds the most basic `normalized_ast -> OpenDD IR QueryRequest`
pipeline and implements / tests it for the simplest possible query.

```rust
enum TestOpenDDPipeline {
    Skip,
    GenerateOpenDDQuery,
    GenerateExecutionPlan,
}
```

It adds a flag for each engine test to opt-in for testing with the new
pipeline. Currently one passes `GenerateOpenDDQuery`, and tests the
result against a snapshot, and the rest pass `Skip`.

The unblocks two following steps:
- we can improve the GraphQL -> OpenDD IR generation, enabling more
tests by passing `GenerateOpenDDQuery`
- once the main new `plan` pipeline generates the same types as the
existing `execute` crate, we can compare the old `execute::plan` with
the new one, and enable that per test by passing
`GenerateExecutionPlan`.

Once all the tests are passing `GenerateExecutionPlan` we can remove the
flag and we know we'll have parity in plan creation.

V3_GIT_ORIGIN_REV_ID: 607dfce77b68849c7fc66fc652e38182fa0c83ea
2024-09-25 20:07:45 +00:00
Rakesh Emmadi
531dc88622 graphql-ws: Use polling interval from opendd config (#1157)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->
Use polling interval from OpenDD metadata instead of hard-coded 2
seconds.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

The interval value (in milliseconds) is already available in
subscription plan. Use it.

V3_GIT_ORIGIN_REV_ID: be99c3367b8d29b085fe536c26cd44ed601c7d91
2024-09-25 17:25:40 +00:00
Daniel Harvey
0e93e22d6c Provide default empty object for empty model 'args' field (#1154)
<!-- The PR description should answer 2 important questions: -->

### What

If a model has arguments, but they are all provided by presets, then
previously we would require users to pass an empty `args: {}` argument
like this:

```graphql
query MyQuery
  ActorsByMovieMany(args: {}) {
    actor_id
    movie_id
    name
  }
}
```

There is no need for this, so this PR loosens this restriction, by
providing a default empty value. This means users can also do the above
query with:

```graphql
query MyQuery
  ActorsByMovieMany {
    actor_id
    movie_id
    name
  }
}
```

Because both versions now work, this is a non-breaking change.

### How

Instead of just looking at number of arguments in schema generation,
consider which have been prefilled and provide a default empty value if
there is nothing a user could pass anyway.

V3_GIT_ORIGIN_REV_ID: cf184e42a114df782e1480a8f19548dda31e5992
2024-09-25 17:16:51 +00:00
Rakesh Emmadi
601771c4fc Test execute_request from graphql_ws crate (#1155)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->
This PR enables "unit" testing for `execute_request` function from
`graphql-ws` crate which is responsible for executing
graphql operations. It is tested in conjunction with the
`graphql_frontend`'s `execute_query` by comparing responses from the
both.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
Briefly
```
http_response = graphql_frontend::execute_query
ws_response = graphql_ws::execute_request
compare(http_response, ws_response)
```
V3_GIT_ORIGIN_REV_ID: 371ac3de1136732d7dc2e88dbd093264a96a7d2e
2024-09-25 16:35:57 +00:00
Tom Harding
e7c0a2777e Scaffolding for error paths in metadata-resolve (#1153)
<!-- The PR description should answer 2 important questions: -->

### What

We would like to show error paths for `metadata-resolve` so that
debugging these errors is a little less painful, both for us and end
users. To this end, #1147 introduced a type wrapper that would be
deserialised to contain its own JSON path, so we could then pass this
path to errors. This PR does precisely this for the
`UnknownModelDataConnector` error.

I chose this error because... it was the first one on the list, not for
any reason beyond that. Right now, this is an extremely simple case
whereby only one path is required, however other errors may need two
("name at path X conflicts with name at path Y", for example). This PR
also changes the default engine error stdout to show the `Debug`
instance rather than the `Display` instance, as the error path is
discarded by the `Display` instance. Unfortunately, we use `Display` for
both stdout and user responses, which is maybe something we'd want to
change eventually, but for now this means we can't just add the error
path to the `Display` instance.

### How

I started by making `Model` a `Spanned` element within the metadata
structure. I then added the `path` key to the resolved `Model` type. I
then found the first error type that included a model name, and added
the `path` key to that error variant. Then, I just did the wiring.
You'll note that this error doesn't _alway_ return a path because it
isn't always raised by a model-first code path, but this is probably the
first PR of many.

### Next steps

* Next step is to make the output a little neater, probably by creating
an actual structured error type (most likely a lot like `Spanned`, with
a `path` and a `value`). Then, we can use a `Display` instance again to
print this nicely in the stdout, but ignore the path in the MBS API
response.

* After that, the plan is to stop ignoring it in the MBS API response,
with a new key to hold an error path.

* Step three is to allow for errors to produce multiple error paths in a
list, hopefully such that they tell a story ("I found this... but then I
found this... and those two things conflict")

* Step four will be a wave of PRs that look quite similar to this one,
wiring up paths to as many errors as possible.
<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

V3_GIT_ORIGIN_REV_ID: 2d8dda018055f65711e66b08aa15188b516e2ddc
2024-09-25 15:12:04 +00:00
Rakesh Emmadi
29eacdf3c3 Introduce graphql-ws crate that implements GraphQL over websockets (#1134)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->
- Introduce a brand new `graphql-ws` crate that implements
  - WebSocket request handling by `WebSocketServer` struct
-
[graphql-ws](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md)
protocol and handles subscriptions in async tokio tasks.
- OSS engine now handles GraphQL websockets through `GET /graphql`
handshakes.

### How

Refer to added
[architecture.md](https://github.com/hasura/v3-engine/blob/rakeshkky/graphql-ws-crate/crates/graphql-ws/architecture.md)
file.

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

V3_GIT_ORIGIN_REV_ID: 3032cbe50267d3f0102c450be2749c09fb3992bf
2024-09-25 14:09:12 +00:00
Rob Dominguez
7266ffc2b0 Docs: Add admonition about load balancers for AWS ECS
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11044
GitOrigin-RevId: dc8f6a5f2da3e02daaf7ab33381a3decffadae36
2024-09-25 11:37:52 +00:00
Varun Choudhary
0f0c96d309 Console: fix role and client name for inspect operation modal
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11047
GitOrigin-RevId: ff34341a0e4d20989606041f96d9b06f880fda54
2024-09-25 11:10:53 +00:00
ashwiniag
daad9da2bb Catalogue update v2.44.0 stable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11045
GitOrigin-RevId: d909ac81cd96b137c3c853b5f346fdc58a028272
2024-09-25 05:26:39 +00:00
Tom Harding
4630ade31e Introduce Spanned type (#1147)
<!-- The PR description should answer 2 important questions: -->

### What

This PR adds the `Spanned` type: an OpenDD wrapper that can be placed
inside the Metadata. It's basically a pair of the value and the path to
the value in the original metadata. This allows us to do things like
source maps.

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->

### How

It's almost exactly what @danieljharvey proposed originally.

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
V3_GIT_ORIGIN_REV_ID: 4f037686b6981fffc4b0a8ac8f95c2f9c623af67
2024-09-24 15:02:27 +00:00
Daniel Harvey
0e4a3afbca Clone type_container instead of maintaining reference (#1150)
<!-- The PR description should answer 2 important questions: -->

### What

We need less lifetimes in our plan, particular those that are connected
to graphql-specific IR. This makes this reference a copy and fixes call
sites. Functional no-op.

V3_GIT_ORIGIN_REV_ID: beb05a09a30cd33240e916255265c41db17c0c78
2024-09-24 14:55:26 +00:00
Daniel Harvey
2839170ddf Create plan crate (#1149)
<!-- The PR description should answer 2 important questions: -->

### What

We are creating a new build pipeline. This makes a new crate for it
called `plan` and puts the existing work from JSONAPI into it. JSONAPI
uses the new plan so we have a quick way of testing it works.

### How

Mostly moving code around. All behind feature flags, so functional
no-op.

V3_GIT_ORIGIN_REV_ID: af4901c93415c7ced2b0f537e600512d28fc5766
2024-09-24 14:40:11 +00:00
Daniel Harvey
7eba4f503a Remove legacy test runner (#1152)
<!-- The PR description should answer 2 important questions: -->

### What

Need to make a change to the execution tests runner, and it turns out we
had two, so retiring the old one.

### How

New tests expect an array of session variables and results, so wrap them
all in `[` and `]`.

V3_GIT_ORIGIN_REV_ID: 81d046a8a69e62f74423b3296fc8bbf04a82fed8
2024-09-24 11:45:06 +00:00
Daniel Harvey
017d6a0215 Use ddn-engine as Otel name (#1144)
<!-- The PR description should answer 2 important questions: -->

### What

We've been using `graphql-engine` as our OpenTelemetry application name,
which makes differentiating from V2 difficult, this changes it to use
`ddn-engine` instead.

V3_GIT_ORIGIN_REV_ID: 95870dd6799f1e43b88ba593308aa4bacb62ca2c
2024-09-24 10:25:29 +00:00
Tom Harding
c3be5cbc8e Carry the parsing path through the OpenDD parsers (#1146)
### What

We want to be able to reference the path within parsers even if the
parser succeeds. This allows us to do things like generate source spans
to help users make updates.

### How

We add `path` as a currently ignored argument to `deserialize`, and then
every time we want to decorate the error path, we replace that call with
a bidirectional decorator.

V3_GIT_ORIGIN_REV_ID: 18ddede2db84801f995b64f17bfb29893acb4657
2024-09-23 22:40:55 +00:00
Sean Park-Ross
c7c9dd008d Docs: Adds enterprise information about a hard restart required for some environments
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11006
GitOrigin-RevId: 8645c3bc3d7eb3eedba3a0dde5c24e75fbaf941a
2024-09-23 18:53:45 +00:00
hasura-bot
383196ed51 Update index.mdx
GITHUB_PR_NUMBER: 10533
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/10533

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11023
Co-authored-by: Konstantinos Gallis <43298282+kongallis@users.noreply.github.com>
GitOrigin-RevId: 01c611f60d72dd2f451c7a582fbb66b4e2877cde
2024-09-23 13:07:58 +00:00
Varun Choudhary
169722782f Console: fix rest endpoint edit and details route
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11040
GitOrigin-RevId: 076d36d24418a9d43f2f862977905b5958af98fa
2024-09-23 12:23:49 +00:00
Anon Ray
23e10ae4a6 remote joins: monomorphize Location type (#1143)
### What

`Location`/`JoinLocations` types were polymorphic, so as to contain
`RemoteJoin` or `(RemoteJoin, JoinId)`. Since we've removed `JoinId` we
can make the types simpler and make them monomorphic.

Functional no-op.

### How

V3_GIT_ORIGIN_REV_ID: 69243ab6cbf350ca787a0a236d0b2676f503fd89
2024-09-23 11:38:25 +00:00
Anon Ray
c9209d45bb remote joins: remove unused join ids (#1142)
<!-- The PR description should answer 2 important questions: -->

### What

Join ids were constructed and assigned, but never used during execution.
Let's remove them to make the code simpler.

Functional no-op.

### How

Remove the commented out `_join_id` in `collect_next_join_nodes`, and
then follow the compiler to fix all errors.

V3_GIT_ORIGIN_REV_ID: 05e0c2435beefef3f7006c4a953962f762f2f262
2024-09-23 11:02:19 +00:00
Daniel Harvey
5fa3043c08 Update changelog for v2024.09.23 release (#1141)
<!-- The PR description should answer 2 important questions: -->

### What

Update changelog

V3_GIT_ORIGIN_REV_ID: 4ecc924484ef6412016413f7470c9ab4cb69d4dc
2024-09-23 10:37:20 +00:00
dependabot[bot]
59c5b39447 Bump bson from 2.12.0 to 2.13.0 (#1139)
Bumps [bson](https://github.com/mongodb/bson-rust) from 2.12.0 to
2.13.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/mongodb/bson-rust/releases">bson's
releases</a>.</em></p>
<blockquote>
<h2>v2.13.0</h2>
<p>The MongoDB Rust driver team is pleased to announce the v2.13.0
release of the <code>bson</code> crate.</p>
<h2>Highlighted Changes</h2>
<p>This release introduces a utility type for deserializing from UTF-8
lossy BSON bytes.</p>
<h2>Full Release Notes</h2>
<h3>New Features</h3>
<ul>
<li>RUST-2023 Add wrapper type for utf-8 lossy deserialization (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/497">#497</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="401f638ba7"><code>401f638</code></a>
release v2.13.0 (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/499">#499</a>)</li>
<li><a
href="0fbdeeffd3"><code>0fbdeef</code></a>
RUST-2023 Add wrapper type for utf-8 lossy deserialization (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/497">#497</a>)</li>
<li>See full diff in <a
href="https://github.com/mongodb/bson-rust/compare/v2.12.0...v2.13.0">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bson&package-manager=cargo&previous-version=2.12.0&new-version=2.13.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 7ff16f9bddfad7ad938ee4db42554e2b79aeaed9
2024-09-23 06:47:48 +00:00
dependabot[bot]
dc18ff6202 Bump bytes from 1.7.1 to 1.7.2 (#1138)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.7.1 to 1.7.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/bytes/releases">bytes's
releases</a>.</em></p>
<blockquote>
<h2>Bytes 1.7.2</h2>
<h1>1.7.2 (September 17, 2024)</h1>
<h3>Fixed</h3>
<ul>
<li>Fix default impl of <code>Buf::{get_int, get_int_le}</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/732">#732</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>Fix double spaces in comments and doc comments (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/731">#731</a>)</li>
</ul>
<h3>Internal changes</h3>
<ul>
<li>Ensure BytesMut::advance reduces capacity (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/728">#728</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md">bytes's
changelog</a>.</em></p>
<blockquote>
<h1>1.7.2 (September 17, 2024)</h1>
<h3>Fixed</h3>
<ul>
<li>Fix default impl of <code>Buf::{get_int, get_int_le}</code> (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/732">#732</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>Fix double spaces in comments and doc comments (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/731">#731</a>)</li>
</ul>
<h3>Internal changes</h3>
<ul>
<li>Ensure BytesMut::advance reduces capacity (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/728">#728</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d7c1d658d9"><code>d7c1d65</code></a>
chore: prepare bytes v1.7.2 (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/736">#736</a>)</li>
<li><a
href="ac46ebdd46"><code>ac46ebd</code></a>
ci: update nightly to nightly-2024-09-15 (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/734">#734</a>)</li>
<li><a
href="79fb85323c"><code>79fb853</code></a>
fix: apply sign extension when decoding int (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/732">#732</a>)</li>
<li><a
href="291df5acc9"><code>291df5a</code></a>
Fix double spaces in comments and doc comments (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/731">#731</a>)</li>
<li><a
href="ed7d5ff39e"><code>ed7d5ff</code></a>
test: ensure BytesMut::advance reduces capacity (<a
href="https://redirect.github.com/tokio-rs/bytes/issues/728">#728</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/bytes/compare/v1.7.1...v1.7.2">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytes&package-manager=cargo&previous-version=1.7.1&new-version=1.7.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 2bdd2454a01f57d80180d21f0a764c4f12646eb9
2024-09-23 06:47:44 +00:00
dependabot[bot]
fc786a264c Bump thiserror from 1.0.63 to 1.0.64 (#1137)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.63 to
1.0.64.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/thiserror/releases">thiserror's
releases</a>.</em></p>
<blockquote>
<h2>1.0.64</h2>
<ul>
<li>Exclude derived impls from coverage instrumentation (<a
href="https://redirect.github.com/dtolnay/thiserror/issues/322">#322</a>,
thanks <a
href="https://github.com/oxalica"><code>@​oxalica</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="84484bc75c"><code>84484bc</code></a>
Release 1.0.64</li>
<li><a
href="023f036de4"><code>023f036</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/thiserror/issues/322">#322</a>
from oxalica/feat/mark-auto-derived</li>
<li><a
href="ae1f47e3e5"><code>ae1f47e</code></a>
Mark #[automatically_derived] for generated impls</li>
<li><a
href="ab5b5e375b"><code>ab5b5e3</code></a>
Upload CI Cargo.lock for reproducing failures</li>
<li><a
href="00b3c1405e"><code>00b3c14</code></a>
Work around new dead code warning in test</li>
<li>See full diff in <a
href="https://github.com/dtolnay/thiserror/compare/1.0.63...1.0.64">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thiserror&package-manager=cargo&previous-version=1.0.63&new-version=1.0.64)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 3bfd4d00745ceed8e6d50f3d65f481ac3c675517
2024-09-23 06:47:39 +00:00
dependabot[bot]
4ed35177f9 Bump clap from 4.5.17 to 4.5.18 (#1136)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.17 to 4.5.18.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.18</h2>
<h2>[4.5.18] - 2024-09-20</h2>
<h3>Features</h3>
<ul>
<li><em>(builder)</em> Expose <code>Arg::get_display_order</code> and
<code>Command::get_display_order</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.18] - 2024-09-20</h2>
<h3>Features</h3>
<ul>
<li><em>(builder)</em> Expose <code>Arg::get_display_order</code> and
<code>Command::get_display_order</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d81158599f"><code>d811585</code></a>
chore: Release</li>
<li><a
href="ab948b3556"><code>ab948b3</code></a>
docs: Update changelog</li>
<li><a
href="82e599e91d"><code>82e599e</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5602">#5602</a>
from shannmu/delimiter_values</li>
<li><a
href="59bf26dd56"><code>59bf26d</code></a>
feat(clap_complete): Support delimiter values in native completions</li>
<li><a
href="ccecab394b"><code>ccecab3</code></a>
test(clap_complete): Add test cases for delimiter_values support</li>
<li><a
href="a3a476407b"><code>a3a4764</code></a>
docs(derive): Specify Parser::update_from semantics</li>
<li><a
href="df165a2da4"><code>df165a2</code></a>
docs(derive): Flatten isn't just for update</li>
<li><a
href="5488bcfa30"><code>5488bcf</code></a>
docs(derive): Connect more dots for Args/Subcommand</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.17...clap_complete-v4.5.18">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.17&new-version=4.5.18)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 0b973cc61eb05b4c00052a1f5aeb6c34dd20e60a
2024-09-23 06:27:26 +00:00
Rakesh Emmadi
10b6aecb95 no-op: Pull out auth related code from engine crate (#1133)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->

Authentication related code lies in `engine` crate. It is needed by
upcoming graphql websockets crate, which will be dep for `engine` crate
(for oss engine bin). To avoid cyclic dependency, moving out the
authentication code from `engine` crate now.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
Move `crates/engine/src/authentication.rs` to new
`crates/auth/hasura-authn` crate. This also needs to move the
`auth_config.jsonschema` file from `engine` crate.

V3_GIT_ORIGIN_REV_ID: d2c320c3a26512ad8ab8e5c3312a64bc69d8a200
2024-09-20 13:40:10 +00:00
Rakesh Emmadi
7e9e487586 Add polling interval config for subscription GraphQL OpenDD metadata (#1129)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->
- Extend the `default` attribute in `opendd` to accept a custom default
value. It is used for polling interval field to specify `1000` as
default (in ms).
- Introduce `polling_interval_ms` (defaults to `1000`) field in
`SubscriptionGraphQlDefinition` OpenDD type.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
- Update the opendd-derive macro to enhance the `#[opendd(derive)]`
attribute.
- Plumb the `polling_interval_ms` value till subscription plan type.

V3_GIT_ORIGIN_REV_ID: 2300c781cf2777e5089820bf7d3448b2942c59d0
2024-09-20 12:16:29 +00:00
Daniel Harvey
f0dd6fb5d4 Add deprecation status to relationship input fields in boolean expressions (#1078)
<!-- The PR description should answer 2 important questions: -->

### What

If a relationship is set to deprecated, then we mark this on the input
field in question.

On boolean expressions, this makes the field disappear from the GraphQL
schema.

I believe this is intentional:
ffb76cd691/crates/lang-graphql/src/introspection.rs (L437)
and can be overwritten by passing `includeDeprecated` in the
introspection schema itself.

The deprecated relationship field:

<img width="585" alt="Screenshot 2024-09-09 at 14 00 16"
src="https://github.com/user-attachments/assets/5932d4ab-dd9b-46b2-b2ae-8401b8699cac">

The missing input field in the boolean expression.

<img width="726" alt="Screenshot 2024-09-09 at 14 00 20"
src="https://github.com/user-attachments/assets/d29caddf-9f97-4635-82bc-7f31fee4ad24">

### How

Use `mk_deprecation_status` when constructing `InputField`.

V3_GIT_ORIGIN_REV_ID: b39fc573e8c1cc18b99b30cd9c4a1187b4bd489d
2024-09-20 11:17:31 +00:00
Daniel Chambers
d651c75cfc Fix comparable relationships in BooleanExpressionType that span subgraphs (#1126)
<!-- The PR description should answer 2 important questions: -->

### What

Previously, comparable relationships did not take into account the
subgraph of the target model / command, meaning they'd look in the wrong
place for a target boolean expression type. Now we look up the
relationship to find the correct location.

### How

To make jumping into unresolved relationships easier, we:
- rename `relationships` stage to `object_relationships`
- create a new `relationships` stage that grabs all the relationships in
metadata and sorts them by `relationshipName` and then object name. This
is necessary because a relationship name can be used multiple times in
one subgraph.

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
V3_GIT_ORIGIN_REV_ID: 2835aac1341b3044f68c7e92b74f1ba08f83e6c6
2024-09-20 10:28:51 +00:00
Daniel Harvey
5cea6dd392 Wrap ModelSource in Arc within graphql_ir::Expression (#1132)
<!-- The PR description should answer 2 important questions: -->

### What

Use `Arc<ModelSource>` in `graphql_ir::Expression` rather than a
reference.

### How

Change the code, fix the types. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 973857eafbff6db7a698d31cf9792ce87378d491
2024-09-19 17:26:37 +00:00
Rakesh Emmadi
b6d2c482eb Necessary authz and authn refactors for subscriptions implementation (#1128)
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->
- Pull out business logic of authn and authz from middlewares. It'll be
re-used in graphql-websockets implementation.
- Introduce a function in `plan.rs` for resolving subscription query
plan.

This is strictly no-op change.

V3_GIT_ORIGIN_REV_ID: 46bad489095f49026b9c1a46d64e3a5fac9d123e
2024-09-19 16:49:06 +00:00
Daniel Harvey
995002537c Move GraphQL selection set out of shared IR (#1131)
<!-- The PR description should answer 2 important questions: -->

### What

`SelectionSet` is a GraphQL concept, let's move it upwards from the
shared IR into the GraphQL related types above.

### How

Move types around. No functional changes.

V3_GIT_ORIGIN_REV_ID: 3075c31eea1c8bab102db21df9f3aa5267656d27
2024-09-19 15:46:22 +00:00
Daniel Chambers
5f0e9906d6 Fix being able to define a ScalarType with a name that matches in InbuiltType (#1120)
<!-- The PR description should answer 2 important questions: -->

### What

Previously it was possible to define a custom type `String` which
conflicted with the built-in `String` type. This would cause undefined
behaviour, and is generally confusing. This is now disallowed.

### How

Check custom scalar type name against a static list of inbuilt type
names that aren't allowed, and throw an error if one is used.

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
V3_GIT_ORIGIN_REV_ID: 93b74476522591a9789e0039e81a6f96ee9c6203
2024-09-19 15:01:53 +00:00
Daniel Harvey
65460a3c4a Update architecture doc (#1130)
<!-- The PR description should answer 2 important questions: -->

### What

Include `ir` and `schema` moves and basic info on `sql` and `jsonapi`.

No functional changes.

V3_GIT_ORIGIN_REV_ID: 254fc62c8c97e8b8719fa552c34bbdf3c231a839
2024-09-19 14:28:56 +00:00
Rob Dominguez
dd98edbc9c Docs: Fix event fetch interval value
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11036
GitOrigin-RevId: 3b1920ccbc0ea11c99736b3355aedee6f7d54387
2024-09-19 12:20:30 +00:00
Daniel Harvey
42fd54b5b9 Add object operand to OrderByExpression (#1122)
<!-- The PR description should answer 2 important questions: -->

### What

In future we want multiple types of `OrderByExpression` (object, scalar,
objectAggregate, scalarAggregate). To stop this being a breaking change
in future, we make the current implementation (objects only) a sum type
so that we can more easily extend it in future.

### How

Add `OrderByExpressionObjectOperand`, fix resulting type chaos.

This feature is currently hidden, so strictly this is a functional
no-op.

V3_GIT_ORIGIN_REV_ID: ef727b7c8895764b70ffb27c647f34383bddd512
2024-09-19 08:47:54 +00:00
Daniel Chambers
9d4206f260 Reformat test metadata to order kind, version, definition properties first (#1127)
### What
Our test metadata has a lot of objects formatted like this:

```jsonc
{
  "definition": {
    // a lot of stuff here
  },
  "version": "v1",
  "kind": "ObjectType"
}
```

This is very unhelpful when trying to read the metadata because I want
to know what kind the object is before I see the definition.

This PR adds a small JQ script that reorders the properties in existing
test json metadata so that the properties are ordered as kind, version,
definition first (like in HML files).

This is literally just a formatting change, nothing has _actually_
changed.

### How

There's a JQ script in the justfile that does this.

V3_GIT_ORIGIN_REV_ID: a56f4afee33c3074e564d9cbb50368932ee5275e
2024-09-19 07:49:06 +00:00
Daniel Harvey
779279589a Wrap ModelSource and CommandSource in Arc (#1124)
<!-- The PR description should answer 2 important questions: -->

### What

To avoid lifetime issues we are wrapping types we reuse throughout
`graphql_ir` and `execute::plan` in `Arc`. This PR does not remove the
later lifetimes, just does the first mechanical step in
`metadata_resolve`

### How

Wrap `ModelSource` and `CommandSource` in `Arc`, fix type errors.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: af91ec7eedf9fe5c3c2fe9737f9c827c1f826d63
2024-09-19 07:28:48 +00:00
ashwiniag
2a39140ec2 ci: tag release v2.36.8
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11034
GitOrigin-RevId: a60c66540650e592af8003681b9783e741fb8c68
2024-09-19 07:07:20 +00:00
Rakesh Emmadi
a29101a3e9 server: Include operationName in http-log when HASURA_GRAPHQL_HTTP_LOG_QUERY_ONLY_ON_ERROR env var set to true
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11031
GitOrigin-RevId: 73091f5826fde006a190bc295b36829906181c2f
2024-09-18 11:38:36 +00:00
Rakesh Emmadi
f4aafb234d server: Introduce option to add query field in http-log only on errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11029
GitOrigin-RevId: f5c8aa1b81d67b84030215cb68b3bb9ee6021087
2024-09-18 09:21:02 +00:00
Daniel Harvey
0c52ca1d2e Upgrade to Rust 1.81.0 (#1119)
<!-- The PR description should answer 2 important questions: -->

### What

Update Rust to
[1.81.0](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html).

### How

Update `rust-toolchain.yaml` and Dockerfiles

V3_GIT_ORIGIN_REV_ID: 8a1fe694caaded7a12220d2460e66009f969227a
2024-09-18 07:29:12 +00:00
ashwiniag
7602629741 ci: tag release v2.44.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11027
GitOrigin-RevId: 935bd1ad87729507d82033118b1319fb8452b215
2024-09-18 06:13:13 +00:00
Daniel Harvey
ccd6cf793b Rename schema crate to graphql-schema (#1117)
<!-- The PR description should answer 2 important questions: -->

### What

Much like https://github.com/hasura/v3-engine/pull/1116, make clearer
what is and is not graphql-centric in engine by renaming `schema` to
`graphql-schema`.

### How

Moving file around, no functional changes.

V3_GIT_ORIGIN_REV_ID: ec06c33a964c16a53c1a4ed306de3fdccd2e8efc
2024-09-17 20:07:06 +00:00
Daniel Harvey
434d56ca20 JSONAPI build plan (#1114)
<!-- The PR description should answer 2 important questions: -->

### What

Let's get to a very basic end-to-end pipeline. This introduces
(extremely-happy-path) planning, execution and response processing so
that we have a rough end to end API.

V3_GIT_ORIGIN_REV_ID: 57ce28eb5ad20f061e0ede37b0bf43fbaddaaf2a
2024-09-17 16:01:52 +00:00
Daniel Harvey
6574ed7da0 Rename ir crate to graphql-ir crate (#1116)
<!-- The PR description should answer 2 important questions: -->

### What

Make what is and is not graphql-centric a little clearer by renaming
this crate and moving it into a `crates/graphql` folder.

### How

No functional changes

V3_GIT_ORIGIN_REV_ID: 3644ce32059e16db9b467b010430ba23fc436ed9
2024-09-17 13:51:26 +00:00
Rakesh Emmadi
e5d7822086 Define subscription request plan (#1097)
<!-- The PR description should answer 2 important questions: -->
Closes:
https://linear.app/hasura/issue/APIPG-876/live-queries-or-ir-and-requestplan-for-subscriptions
### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->

- Define and generate request plan for subscriptions.
- Define filter expression resolving context to allow/reject remote
relationships.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
- Modifying existing enums, defining new types and functions.

V3_GIT_ORIGIN_REV_ID: 1e1a248c74d210cf45288002e1fe13ce6a868fe6
2024-09-17 07:11:46 +00:00
Daniel Harvey
ab165a15ef Update changelog for release v2024.09.16 (#1112)
<!-- The PR description should answer 2 important questions: -->

### What
Update changelog

V3_GIT_ORIGIN_REV_ID: f2da518548c31e0d8d7a6ac55008987dc9fcf8ff
2024-09-16 13:28:27 +00:00
Daniel Harvey
9a265c0b13 Checks for nested array capability (#1100)
<!-- The PR description should answer 2 important questions: -->

### What

Forgot to add these checks when implementing the feature, so now they're
added as an issue / warning, which will be promoted to an error for new
projects.

### How

Check the data connector capabilities at the point a boolean expression
is used for either model filtering or as a command argument. Raise a
warning if missing.

V3_GIT_ORIGIN_REV_ID: 68ecca998f61aee9340de634223c1933613c36d4
2024-09-16 09:50:46 +00:00