Commit Graph

496 Commits

Author SHA1 Message Date
Vamshi Surabhi
a6dbc7bb1d Do not replace the existing analyzer rules (#870)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

This PR fixes issues in the SQL layer where the following queries would
fail:

1. `select count(*) from "Track"`
2. `select * from "Track" where id = 1`

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

### How

These were failing because the built-in analyzer rules that rewrite
`count(*)` and type-cast expressions weren't firing.
`with_analyzer_rules` replaces the analyzer rules of a session context
with the given list. We want our analyzer rule to be fired in addition
to the built-in analyzer rules.

Tests are being worked on in a separate PR.

V3_GIT_ORIGIN_REV_ID: 42231f97b5b28d9b7eeff0c3e592cb43ff7d952f
2024-07-23 06:04:38 +00:00
dependabot[bot]
3ec5dbf39a Bump tokio from 1.38.0 to 1.38.1 (#863)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.38.0 to 1.38.1.

V3_GIT_ORIGIN_REV_ID: 917209ce6aeb733d92e4232fc7183c153020e276
2024-07-22 08:11:20 +00:00
dependabot[bot]
48428dd4af Bump darling from 0.20.9 to 0.20.10 (#862)
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.9 to 0.20.10.

V3_GIT_ORIGIN_REV_ID: c5ced551c5a019f7416ac70d367197a41bafa7b7
2024-07-22 07:40:57 +00:00
dependabot[bot]
e095ea67dd Bump openssl from 0.10.64 to 0.10.66 (#864)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.64 to 0.10.66.

V3_GIT_ORIGIN_REV_ID: b3d1e21b504122bb1a9e2332a60ee4b3f04781aa
2024-07-22 07:10:56 +00:00
dependabot[bot]
13e39c7231 Bump syn from 2.0.71 to 2.0.72 (#861)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.71 to 2.0.72.

V3_GIT_ORIGIN_REV_ID: fcdab429e082ee272ee4011a27894dc73b14646e
2024-07-22 06:40:10 +00:00
Daniel Harvey
407c5b9ece Rename one of the ArgumentPreset types to DataConnectorArgumentPreset (#860)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

We're having issues with our deduplication of names in JSONSchema. We
would like to fix this, but in the short term, this renames a
conflicting object to avoid this quickly.

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

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

### How

Rename `ArgumentPreset` in `open_dds::data_connectors` to
`DataConnectorArgumentPreset`.

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

V3_GIT_ORIGIN_REV_ID: e3eafeffe8ba4d513f9d0a09a623f101650247ea
2024-07-19 09:10:29 +00:00
paritosh-08
5a598875bb update changelog for v2024.07.18 (#854)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

update changelog for new release

### How

:)

V3_GIT_ORIGIN_REV_ID: 6620f9923f393d190f0f2fab1aced1cff4d6aec0
2024-07-18 13:55:28 +00:00
Daniel Harvey
34d1ac55fe Return AggregateExpressionError from aggregates stage (#843)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

This stage already has it's own error type, but it returns the larger
`Error` type, so let's return the more specific type instead.

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

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

### How

Changing return types mostly. Functional no-op.

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

V3_GIT_ORIGIN_REV_ID: 2aae1f06775db6d88c34b1d3c1779396e0ba410e
2024-07-18 12:01:40 +00:00
Daniel Harvey
b7bf7fe677 Move data connector scalar types error into own type (#839)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

More breaking down the big error type, this time we sort the
`data_connector_scalar_types` stage. Functional no-op.

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

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

### How

Move error cases into a smaller enum.

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

V3_GIT_ORIGIN_REV_ID: 50b699f3a77594deb27a6cc6ab8dd61752404daf
2024-07-18 10:59:42 +00:00
Rakesh Emmadi
561b908342 Implement remote relationship predicates in where filter clause (#761)
Now, users can filter their queries using remote relationships in the
filter predicate. Users need to provide the relationships for comparison
in `comparableRelationships` field of the newer `BooleanExpressionType`
opendd metadata.

Minimal Algorithm:
```
Relationship: ARemoteB => Model_A -> Model_B (remote NDC)
Column Mapping: (A_column_1, B_column_1), (A_column_2, B_column_2).

query:
  Model_A:
    where: ARemoteB: {B_column_3: {_eq: value}}

Step 1: Fetch RHS column values (in mapping) from remote target model
  SELECT B_column_1, B_column_2 from model_b_collection WHERE B_column_3 = value;
yields  the following rows
[
  [(B_column_1, b_value_1), (B_column_2, b_value_2)],
  [(B_column_1, b_value_11), (B_column_2, b_value_22)],
]

Step 2: Using above rows the generate LHS column filter for Model_A query.

SELECT <fields> from model_a_collection WHERE
  ((A_column_1 = b_value_1) AND (A_column_2 = b_value_2))
 OR ((A_column_1 = b_value_11) AND (A_column_2 = b_value_22))

The above comparison is equivalent to
WHERE
  (A_column_1, A_column_2) IN ((b_value_1, b_value_11), (b_value_2, b_value_22))

```

Sample query:
```graphql
query MyQuery {
 Track(
    where: {
      _or: [
        { AlbumRemote: { Artist: { ArtistId: { _eq: 2 } } } }
        { TrackId: { _eq: 3 } }
      ]
    }
  ) {
    TrackId
    AlbumRemote {
      Artist {
        ArtistId
        Name
      }
    }
  }
}
```
In the query above, `AlbumRemote` is a remote relationship which targets
a model backed by a different data connector.

V3_GIT_ORIGIN_REV_ID: 7aa76fcae83e1f22de460f1eef5648fb7a35c047
2024-07-18 07:47:04 +00:00
Daniel Harvey
342ff1fce6 Return BooleanExpressionError from object-boolean-expressions stage (#844)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Much like this change, but for the `object_boolean_expressions` stage:
https://github.com/hasura/v3-engine/pull/843

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

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

### How

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

V3_GIT_ORIGIN_REV_ID: 85da185b45bac429b754b0b92419f378a59fb536
2024-07-17 18:23:14 +00:00
Daniel Chambers
455724dd07 Fixed command targeted relationships not using data connector argument names (#841)
### What
This PR fixes an issue where relationships that target commands do not
correctly use the data connector's argument name when making the ndc
request. Instead, they use the OpenDD argument name, which is incorrect.

For metadata where the OpenDD argument name is the same as the data
connector's argument name, the code works but only coincidentally.

### How
I've updated an existing test to change the name of the command argument
to be different from the data connector's argument name. This test
failed but is now fixed by this PR, which simply looks up the name of
the data connector argument name and uses that instead.

V3_GIT_ORIGIN_REV_ID: 71f1e812174c7bb9922792523129e4bcdce911ed
2024-07-17 08:37:18 +00:00
Rob Dominguez
9f6ac66746 Bug Bash: Fix typo (#838)
### What

This closes hasura/graphql-engine#10433 and closes
hasura/v3-engine-multitenant#917

[DOCS-2225](https://hasurahq.atlassian.net/browse/DOCS-2225)

[DOCS-2225]:
https://hasurahq.atlassian.net/browse/DOCS-2225?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

V3_GIT_ORIGIN_REV_ID: 8c9d161af0737ecfee973d0083198617e21329de
2024-07-16 12:59:22 +00:00
Daniel Harvey
d7ca64b497 Disallow filtering on nested array (#837)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Filtering on nested arrays doesn't work, let's make sure it's not
allowed for now.

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

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

### How

Adding a check in `boolean_expression_types` stage.

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

---------

Co-authored-by: Gil Mizrahi <gil@gilmi.net>
V3_GIT_ORIGIN_REV_ID: cc08e8c24098c1fea9b6e1ee61b82ade989dd29a
2024-07-16 12:00:13 +00:00
Daniel Chambers
01539cd7c1 Upgrade ndc_models to v0.2.0-rc0 (#835)
This PR adds true support for ndc_models v0.2.0 to v3-engine. Note that
v0.2.0 is not finalized yet, so we're pointing at v0.2.0-rc0. The
support still comes via the migration methodology, where v0.2.x ndc
models are downgraded to v0.1.x to support backwards compatibility. In
the future we want to remove this and have the engine generate the
different versioned ndc models separately instead of performing a
migration.

The ndc_models_v01 crate reference has been bumped to the official
v0.1.5 version, which brings the newtypes to the v0.1.x version. The
ndc_models crate reference is now on v0.2.0-rc0.

The custom connector has been updated to support ndc-spec v0.2.0. All
tests that talk to the custom connector have been updated with its
latest v0.2.0 schema/capabilities.

In `metadata_resolve` the v01->v02 schema/capabilities migration code
has been updated to handle the new v0.2.0 types. This includes inferring
v0.2.0 capabilities from what was possible in v0.1.x.

In `execution`, the migration code has been updated to deal with the new
v0.1.5 newtypes and v0.2.0 types. This means there are now cases where a
downgrade is impossible and produces an error (see `NdcDowngradeError`
in `execute::ndc::migration`). A bug has also been fixed where NDC
expressions in arguments were not being serialized to the correct NDC
version.

V3_GIT_ORIGIN_REV_ID: 5b4afcde64c307b2bd7c985c588d6c74d9623a0f
2024-07-16 01:53:42 +00:00
dependabot[bot]
b1be9fd5ca Bump datafusion from 39.0.0 to 40.0.0 (#831)
Bumps [datafusion](https://github.com/apache/datafusion) from 39.0.0 to 40.0.0.

V3_GIT_ORIGIN_REV_ID: 9712564df13c0e6f9bd2f551566385f8a9fe86c8
2024-07-15 11:14:51 +00:00
dependabot[bot]
c9793ee896 Bump syn from 2.0.69 to 2.0.71 (#834)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.69 to 2.0.71.

V3_GIT_ORIGIN_REV_ID: 0023e5f93ccda2488193e794612fcf8794b983ef
2024-07-15 09:15:33 +00:00
dependabot[bot]
4443f13a4c Bump thiserror from 1.0.61 to 1.0.62 (#833)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.61 to 1.0.62.

V3_GIT_ORIGIN_REV_ID: 9eff61a55f560e8a1e336c70417ddd8730338fbb
2024-07-15 08:45:06 +00:00
dependabot[bot]
ffb3c81040 Bump clap from 4.5.8 to 4.5.9 (#832)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.8 to 4.5.9.

V3_GIT_ORIGIN_REV_ID: 338ed8199cb2e1b766e18b01be32990454583577
2024-07-15 08:16:06 +00:00
dependabot[bot]
0e857c40f5 Bump bytes from 1.6.0 to 1.6.1 (#830)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.0 to 1.6.1.

V3_GIT_ORIGIN_REV_ID: dcf11adbb1a9b80b56c520e0c65b0bd82f0bce39
2024-07-15 07:42:01 +00:00
Daniel Harvey
488c29156c Combine all Relay errors (#825)
### What
Much like https://github.com/hasura/v3-engine/pull/824, we combine
relay-related errors into `RelayError`.

### How
Remove them from the big `Error` type.

---------

Co-authored-by: Daniel Chambers <daniel@hasura.io>
V3_GIT_ORIGIN_REV_ID: b26460c6aa4d622c6f5548e5cd294c7480acdca4
2024-07-15 06:12:28 +00:00
Daniel Harvey
aec5a6d0cb Split boolean expression errors (#829)
### What
Part of ongoing tidy up of errors, this splits out errors types for the
boolean expression stages.

### How
Remove things from `Error`, move files around. Functional no-op.

V3_GIT_ORIGIN_REV_ID: ccf1f29600a169a3787d744c7f60e79220aef8d2
2024-07-15 05:31:57 +00:00
Daniel Harvey
db96e42358 Explicitly import thiserror::Error in place (#827)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

To stop us being confused between `Error` type and `Error` trait.

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

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

### How

Import `thiserror::Error` explicitly in place.

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

V3_GIT_ORIGIN_REV_ID: b930480927b2c64537960cfb69f2b2b30921f4fd
2024-07-11 15:18:27 +00:00
Daniel Chambers
7efcb2e4f6 Fix custom connector schema and update all tests to use up-to-date schema (#826)
This PR fixes the custom connector whose schema endpoint doesn't
actually return correct output (it was missing some
functions/procedures, etc). Then it updates all tests that actually talk
to the custom connector with the latest version of its
schema/capabilities in their DataConnectorLink.

This test update is done by a new script added to the justfile that
finds and patches all metadata json files and inserts the new schema and
capabilities after reading them from the custom connector running in
docker.

V3_GIT_ORIGIN_REV_ID: f1825a6f74ddcb6c01198fe4a41de6b4fc0bf533
2024-07-11 14:15:58 +00:00
Daniel Harvey
63279ccb38 Combine all Apollo errors (#824)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

As a treat, combine all Apollo errors into one enum.

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

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

### How

Remove items from `ObjectTypesError` and `Error`.

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

V3_GIT_ORIGIN_REV_ID: 5a16a030b35372283490f3de7343fcfca2fadea5
2024-07-11 10:16:24 +00:00
Samir Talwar
62fa071663 Use the release version as the relevant tracing attribute. (#823)
### What

And don't set it except for the main application; tests and test
infrastructure does not care.

### How

We use the `VERSION` constant, populated from the `RELEASE_VERSION`
environment variable at build time.

It's now also optional so tests don't have to specify it.

V3_GIT_ORIGIN_REV_ID: 1bfc2efb060307cc9446bf07e944e107f0607ae0
2024-07-11 07:32:30 +00:00
Daniel Harvey
44b07f8055 release v2024.07.10 (#818)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Update changelogs for new release.

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

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

### How

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

V3_GIT_ORIGIN_REV_ID: 7adfd3c2c53b912bb7c4604ebed93601a201c15e
2024-07-10 10:00:03 +00:00
Daniel Chambers
cf44277811 Removed ndc_models usage from field arguments IR (#816)
This PR removes the usage of ndc_models in the field arguments IR and
uses the actual arguments IR instead. This change was missed in #810.

V3_GIT_ORIGIN_REV_ID: 414b4eda9724e7702b5a09ea2855b457d7ce88d6
2024-07-10 07:44:35 +00:00
Daniel Harvey
ab1d963de0 Split ValueExpression (#812)
### What
`ValueExpression` contained boolean expressions, and was used in places
where boolean expressions were not allowed.

### How
This creates a new type `ValueExpressionOrPredicate`, and uses it in the
places where boolean expressions are allowed.

---------

Co-authored-by: Daniel Chambers <daniel@hasura.io>
V3_GIT_ORIGIN_REV_ID: c0a07c5e0096aeb4369ca7d6b5147451d1ccd14d
2024-07-10 02:30:09 +00:00
Daniel Harvey
f6f4785e7c Error type for object_types stage (#814)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Break down the big `Error` enum some more. This time, add all errors
from the `object_types` stage into the `ObjectTypesError` enum.

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

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

### How

Moving code around. Functional no-op.

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

V3_GIT_ORIGIN_REV_ID: 154d4b40b21365c783d545a23cf18be623f2a3de
2024-07-09 20:21:46 +00:00
Daniel Harvey
55dcab09b1 Split up apollo and relay stages (#815)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

In the haste of breaking things up, realised we put the `relay` checks
in with the `apollo` ones where they are two separate things.

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

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

### How

Split up `apollo` step into `relay` and `apollo` steps. Functional
no-op.

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

V3_GIT_ORIGIN_REV_ID: 8d02d3cb77b1248239be37ed61d0b87b9b734fdf
2024-07-09 17:19:37 +00:00
Daniel Harvey
788fd9e197 Newtypes around object collections (#807)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

We pass around a lot of `BTreeMap` and `IndexMap` types. This has two
problems:

a) everytime we change the items inside, we have to manually update lots
of call sites
b) we can't attach useful behaviour to it

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

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

### How

This adds some wrappers around `object_types`, and adds a `.get()`
function with a useful default error. This error only contains the
missing `type_name`, so the idea is that it would be wrapped in another
error that would provide more context. The hope is that we can get away
from one giant error enum, and instead have a set of smaller error types
that live along each resolving stage.

In isolation this PR isn't very interesting, as it's a tiny drop in the
ocean, so really it's here to say, "is this a thing we vaguely like?"

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

V3_GIT_ORIGIN_REV_ID: 804a703d7155ce5b929937689d5649c6571357b0
2024-07-09 16:26:58 +00:00
Daniel Harvey
adc1ad5bf9 Break out DataConnectorError (#813)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Put all the errors that happen in the `data_connectors` stage into a new
type `DataConnectorError`.

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

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

### How

Moving enum members to the new type. Functional no-op.

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

V3_GIT_ORIGIN_REV_ID: 2e50eb561ce6b7c7fac4de4b31c9957f7ee4696c
2024-07-09 15:55:22 +00:00
Daniel Harvey
054600d4d3 Move errors to type_permissions stage (#809)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Much like https://github.com/hasura/v3-engine/pull/808, move an error to
the place it is thrown.

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

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

### How

Move files around. Functional no-op.

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

V3_GIT_ORIGIN_REV_ID: a61527b57662efada2c7d2049e12f103deec1e4e
2024-07-09 11:58:57 +00:00
Daniel Harvey
83df9e81bb Move GraphqlConfigError to graphql_config stage (#808)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

We have a giant error file in `metadata-resolve`, and it's really
unclear what can go wrong where. Let's improve it in some small way.

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

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

### How

Move `GraphqlConfigError` to the `graphql_config` stage, and make that
stage only return that kind of error.

Functional no-op.

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

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 9aa58875a24d66e6945c9ead6434fedb124f1dd8
2024-07-09 10:02:40 +00:00
Daniel Chambers
1564fcce17 Remove usage of ndc_models Expression types from the IR (#810)
This PR removes the usage of `ndc_models` `Expression` types from the
IR. It then adds logic to map from the new IR `FilterExpression` types
to `ndc_models` types in the plan part of the code where IR ->
ndc_models mapping is performed. The new IR types and the change to the
IR creation logic is mostly in `crates/execute/src/ir/filter.rs`.

The new IR types have some optimisations applied to them. In particular,
some basic boolean expression simplification logic is applied when
`FilterExpression::mk_and` `mk_or` and `mk_not` are used. This strips
out redundant and/ors/nots resulting in simpler boolexps for connectors
to process. (This logic is similar to what GDC did in Hasura v2).

Unfortunately it turned out that arguments had JSON-serialized
`ndc_models` types embedded in them, in particular, where argument
presets had been used to set a BooleanExpression as an argument value.
The old code was simply creating an ndc_models::Expression and
serializing it directly to JSON. This has now been refactored to retain
the new IR `FilterExpression` until `plan` time, at which point it will
be mapped into the ndc type and serialized to JSON and embedded in the
argument value. The types change for this can be seen in
`crates/execute/src/ir/arguments.rs`, but the real logic is actually in
`crates/execute/src/ir/permissions.rs`, with the
`make_value_from_value_expression` and
`make_argument_from_value_expression` functions.

The mapping of expression and argument IR into `ndc_models` can be found
in `crates/execute/src/plan/common.rs`.

In `metadata_resolve`, some ndc_models types were removed and
non-ndc_model types were used instead. In particular
`ndc_models::ComparisonOperatorName` (swapped with
`DataConnectorOperatorName`) and `ndc_models::UnaryComparisonOperator`
(swapped with a new `UnaryComparisonOperator` enum type).

This PR is a functional no-op, other than the boolean expression
simplification.

V3_GIT_ORIGIN_REV_ID: 13805430fb2e2ca5653406a094d719138f0d5b51
2024-07-09 08:23:24 +00:00
dependabot[bot]
f8a2abc0df Bump serde from 1.0.203 to 1.0.204 (#801)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.

V3_GIT_ORIGIN_REV_ID: cbe13bf30a6aa7cc5480d174d7d435f18a5cc7f2
2024-07-09 06:54:43 +00:00
Daniel Harvey
8579570459 Add deprecation notice to old boolean expression types (#806)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Since these code comments end up in the docs, let's make sure we point
out these old types are no longer in favour.

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

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

### How

Updating doc comments.

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

V3_GIT_ORIGIN_REV_ID: a21190fbf2327e1ae265c76d1f467af063f1dd64
2024-07-08 14:19:28 +00:00
Daniel Harvey
29ccf96784 Skip capability check for local relationships (#805)
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

If the target data connector for a relationship does not have the
`foreach` capability, we threw an error, however we should allow this.

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

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

### How

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

Check data connector names for relationship target before throwing
capability error.

V3_GIT_ORIGIN_REV_ID: 157908f0077b7c3af67a77600e5f8c9fc65df7f2
2024-07-08 13:03:13 +00:00
dependabot[bot]
7a0eb6847a Bump async-trait from 0.1.80 to 0.1.81 (#804)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.80 to 0.1.81.

V3_GIT_ORIGIN_REV_ID: 1e9a6a6a40b6b0f732774df1e7a52b8a182f70c1
2024-07-08 08:32:04 +00:00
dependabot[bot]
0d9bb020f1 Bump serde_json from 1.0.119 to 1.0.120 (#803)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.119 to 1.0.120.

V3_GIT_ORIGIN_REV_ID: 0c432282a8ae7daaca22a608881ed0f69da8dd4a
2024-07-08 08:02:06 +00:00
dependabot[bot]
5feabdfd08 Bump syn from 2.0.68 to 2.0.69 (#802)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.68 to 2.0.69.

V3_GIT_ORIGIN_REV_ID: 6e8a895e4b928418e87c820effcdfbbecdfbfba7
2024-07-08 07:32:24 +00:00
dependabot[bot]
0be3e9f6c0 Bump serde_with from 3.8.2 to 3.8.3 (#800)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.8.2 to 3.8.3

V3_GIT_ORIGIN_REV_ID: d2b0fbecea1997959f644b90c2a57075635a0293
2024-07-08 07:03:01 +00:00
Daniel Chambers
90dbbccce5 Remove ndc_models types from arguments and order by IR (#798)
Note: This PR is stacked on #797 and should be merged after it.

This PR removes the use of ndc_models types from the arguments and order
by IR. It then shifts the logic that maps the IR to the ndc_models into
the plan part of the code where IR -> ndc_model mapping is performed.

This will help isolate the IR from ndc_models and move us towards being
able to have multiple IR -> ndc_models mapping codes, one per supported
ndc version.

This is a functional no-op PR.

V3_GIT_ORIGIN_REV_ID: 66be868ff4c8185c6190537d570d88813cb7f410
2024-07-05 10:44:41 +00:00
Daniel Chambers
e44589931c Reimplement most OpenDD newtypes using SmolStr and a macro (#797)
This PR replaces most of the string newtypes in the open-dds crate with
new implementations based on `SmolStr`, using a macro adapted from the
macro used in ndc-models. `SmolStr` usage should result in less heap
allocations and the macro ensures all the newtypes get all the same
trait implementations (such as various `From` and `Borrow` instances)
and helper impl functions (such as `as_str`).

The new macro, `str_newtype`, creates a newtype wrapper around `SmolStr`
or another type (typically `Identifier`), and writes out all the various
trait implementations. It also takes a documentation string which
ensures that every newtype has a description in JSON Schema.

The changes in the downstream crates are just adjusting to use the new
newtypes.

Also:
* `QueryGraphqlConfig` used a lot of String typed-properties; these have
been changed for the appropriate `GraphQlTypeName` and
`GraphQlFieldName` types.
* metadata-resolve had a duplicate newtype called
`ConnectorArgumentName`, which duplicated open-dds's
`DataConnectorArgumentName`. This has been removed and replaced.
* A new newtype called `CollectionName` has been added in open-dds to
represent the name of the ndc collection that a model points to. This
was previously just a string.
V3_GIT_ORIGIN_REV_ID: d5a33756ef0e110b2255478358a38e42e6ff89a2
2024-07-05 10:16:33 +00:00
Philip Lykke Carlsen
9910df8154 Add ServerOptions to initial server startup logs (#794)
### What

Add ServerOptions to initial server startup logs.

![image](https://github.com/hasura/v3-engine/assets/358550/33e49344-a7d8-44be-8bce-b6c8b11a06ec)

### Update

Use json, as well as a span field rather than an event:

![image](https://github.com/hasura/v3-engine/assets/358550/724bcdf4-8125-4a5e-83aa-db7de1229e3a)

V3_GIT_ORIGIN_REV_ID: 28d0c8edd70357b3460a4fbea389f5fa801fd4bf
2024-07-05 08:10:17 +00:00
Daniel Chambers
62e76aac67 Sort open-dds JSON schema for better diffing (#796)
This PR just sorts the definitions in the Open DD JSON schema file, so
that when it changes, we can get better diffs because the types won't
move around inside the file.

V3_GIT_ORIGIN_REV_ID: 80221fae1b4d6e4b98b658f9ba2f19413abf7389
2024-07-05 06:45:45 +00:00
Tom Harding
fa5673cd1f Allow non-nullable variables to fulfil nullable values (#795)
### What

This PR fixes a bug with variable nullability coercion. Specifically,
providing a non-null variable for a nullable field should work, as all
non-nullable variables can be used as nullable variables via "coercion".

Related issues:
* https://hasurahq.atlassian.net/browse/V3ENGINE-243
* https://github.com/hasura/v3-e2e-testing/pull/224 (the test for this
change)

### How

I think someone did something clever with macros, so I tried to unpack
the macro to make sense of it, and in the process, spotted the bug: it's
not that both the location must be nullable AND the variable not, it's
that _if_ the variable is nullable, the location must not be nullable.

V3_GIT_ORIGIN_REV_ID: 4f4ba3fe6898220bbba9ae2867233cd762bef1cb
2024-07-04 16:07:35 +00:00
paritosh-08
4b62f7decf release v2024.07.04 (#792)
Update the changelog for new version

---------

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: b87f16ebaa1471f010ec461be097bcfd6648c99a
2024-07-04 10:25:48 +00:00
Daniel Chambers
862ad8e0dc Update ndc-models to latest version which includes new name newtypes (#791)
This PR updated ndc-models to the latest version on main. This version
is still a 0.1.x version, but it now includes all the [new
newtypes](https://github.com/hasura/ndc-spec/pull/156) that wrap
previously stringly-typed things. For example, `ArgumentName`,
`FieldName`, etc.

This pervades across the entire engine, but thankfully the changes are
mostly mechanical repetitive changes. Usually you will see conversions
from `String`-typed variables into the newtypes using this sort of form:
`FieldName::from(string.as_str())`, which is the most efficient way
copying the value (the str slice is copied). Or you will see usages of
the newtype as a raw string by `.as_str()`-ing it. Converting the
newtypes into a String can be done with `.into()` if owned, but if
referenced `.as_str().to_owned()` performs the clone and type
conversion.

Other changes:
* A few minor instances of `ok_or()` usages (or similar) have been
converted into lazy error construction variants (eg `ok_or_else()`)

V3_GIT_ORIGIN_REV_ID: 64a371ae6197ef3be98a6f7cdc4052d654a43da0
2024-07-04 08:58:12 +00:00