Commit Graph

367 Commits

Author SHA1 Message Date
Daniel Harvey
ba5d0e3e8f Fix dev-auth-webhook Docker image, build all in CI (#535)
<!-- Thank you for submitting this PR! :) -->

## Description

I think this broke when moving folders around, realised we weren't even
building it other than in `main`, this rectifies that.

V3_GIT_ORIGIN_REV_ID: f822290f9a00159d4b1b55553f31175b697a16c1
2024-05-01 09:54:14 +00:00
Daniel Harvey
b9a29c3e1d Include data_connector_type_mappings along with object_types. (#532)
<!-- Thank you for submitting this PR! :) -->

## Description

`data_connector_type_mappings` is a map of data connector information
keyed by `CustomTypeName`. We create it when we resolve object types,
which are also keyed by `CustomTypeName`, however we pass them around
separately and it's not immediately obvious that they are related.

This PR stops passing `data_connector_type_mappings` around and instead
includes them with the object information.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3ac1341907ea88c11fbc3639adf63140aa702262
2024-05-01 09:25:44 +00:00
Gil Mizrahi
0323da8144 create auth and utils subdirectories in crates, and move architecture information to a separate doc. (#534)
## Description

1. I've moved the architecture information we had in `CONTRIBUTING.md`
to a separate document `docs/architecture.md` so we can evolve both
separately in the future.
2. I've introduced a couple of sub directories: `utils` and `auth`, for
supporting crates that are not the core functionality of the engine so
it is easier to find the most relevant crates.

New structure:

```
crates
├── auth
│   ├── dev-auth-webhook
│   ├── hasura-authn-core
│   ├── hasura-authn-jwt
│   └── hasura-authn-webhook
├── custom-connector
├── engine
├── lang-graphql
├── metadata-schema-generator
├── open-dds
└── utils
    ├── opendds-derive
    ├── recursion_limit_macro
    └── tracing-util
```

V3_GIT_ORIGIN_REV_ID: e0e9394da2fcd911f329c48107a76f8492fa304c
2024-05-01 09:05:15 +00:00
Samir Talwar
c4b659e12c Rename "source" to "sourceType" for "kind": "Relationship". (#531)
## Description

To clarify the purpose of the `"source"` field, we've decided to rename
it to `"sourceType"`. This hopefully makes it clearer that the value
should be a type name.

`"source"` is still accepted as an alias in order to stop this from
being a breaking change.

I have added the aliasing capability for struct fields in
`opendds_derive`.

All test metadata has been updated to use `"sourceType"`, but I've added
one test case that uses `"source"` instead just to make sure that it
still works.

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

- OpenDDS: The `"source"` field for relationships has been renamed to
`"sourceType"`. Metadata using `"source"` will continue to work as
usual, but new metadata should be authored with `"sourceType"` instead.

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

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

V3_GIT_ORIGIN_REV_ID: 305cbf7a62ee49a715e95ad892b8d00647f05cef
2024-04-30 17:21:07 +00:00
Samir Talwar
ca61619c06 Format everything with Prettier. (#530)
I found myself wanting to rewrite JSON files with `sed`. The problem is,
then I want to run a formatter over them afterwards, and this will
change the whole file, not just the area I touched.

I would like to propose the nuclear option in remedying this: format
everything now. This is a very large change that should make it easier
to keep files to a consistent format in the future.

I have chosen to use Prettier for this because (a) it has a useful
`--write` command and (b) it also does GraphQL, Markdown, YAML, etc.

I've elected to exclude two sets of files:

1. `crates/custom-connector/data/*.json`, because they are actually
multiple JSON objects, one per line, which Prettier cannot parse.
2. `crates/lang-graphql/tests/**/*.graphql`, because it contains invalid
GraphQL, and the parser is intended to work with strangely-formatted
GraphQL.

The main changes are standardizing whitespace, adding a newline at the
end of files, and putting JSON arrays on one line when they fit.

V3_GIT_ORIGIN_REV_ID: 92d4a535c34a3cc00721e8ddc6f17c5717e8ff76
2024-04-30 14:58:57 +00:00
Samir Talwar
a1d6aa49c0 opendds-derive: Avoid panicking when unknown properties are encountered. (#528)
By wrapping the errors we can work with both `syn` and `darling` errors,
allowing us to avoid `.unwrap` and `.expect`. This makes failures way
more useful.

V3_GIT_ORIGIN_REV_ID: bd7c4a4e7de4a2360b4533d9238199f098a09a8d
2024-04-30 13:59:40 +00:00
Daniel Harvey
774bf78786 Tidy up metadata resolve (#527)
<!-- Thank you for submitting this PR! :) -->

## Description

This stacks on top of https://github.com/hasura/v3-engine/pull/526 and
is the tidying up step following it.

There is a lot going on here, none of it particularly interesting.

- We remove the old `resolve_metadata` function, so all of "the action"
for resolving metadata happens inside `resolved::stages::mod`.
- We move the remaining modules into two folders, `helpers` and `types`.
This is a pretty rough cut, and there are definitely better homes for
the things here, I just wanted the separation of stages and "other bits"
to be clearer.
- We split the `types` helpers into `types` and `type_mappings`, as the
`type_mappings` stuff was clearly defined and didn't belong with the
grab-bag of functions that remain in `types`.
- We explicitly export everything used outside metadata resolve, and
stop other modules dipping into it's internal structure. This will make
future changes (particularly refactors that change the stages etc) a lot
easier as we don't need the rest of the app concerning itself with it.
- I _think_ we may now be able to move metadata resolve into a separate
crate. I have not tried yet, this PR is already silly enough.

When given a choice between "fixing" something, and doing the most
mechanical obvious change, I have opted for the latter. That is to
derisk this big change, and to ensure it doesn't linger, collecting
awful merge conflicts.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2b52403cbfddb0427b8a3e61ad2edaef9d1b3b46
2024-04-30 10:56:28 +00:00
Daniel Harvey
9046cc45b4 Separate model_permissions resolve step (#526)
<!-- Thank you for submitting this PR! :) -->

## Description

Following work in https://github.com/hasura/v3-engine/pull/523 and
friends, this resolves `model_permissions` in a fresh step, creating a
new `ModelWithPermissions` type to differentiate from the regular
`Model` which no longer has any notion of permissions.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fdf928ae12159a6c4ef87effc4704193c5306e46
2024-04-30 10:35:12 +00:00
Daniel Harvey
4b7aa437f0 Remove Option from resolved command permissions (#524)
<!-- Thank you for submitting this PR! :) -->

## Description

Follow up to https://github.com/hasura/v3-engine/pull/523

This removes the `Option` from the Command permissions. Seperated from
the pure "moving things around" PR for clarity, it should be a
functional no-op though, as Command permissions are opt-in, so `None`
and `Some(HashMap::new())` are equivalent, and this layer can be
removed.

V3_GIT_ORIGIN_REV_ID: ebd8fbb54c0f771b7128ff499af2abea85f73808
2024-04-30 07:49:02 +00:00
Daniel Harvey
3e8e6add11 Separate command_permissions resolve step (#523)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/522 and friends, this
breaks out the command permissions into a discreet metadata step. This
creates a new `CommandWithPermissions` with type which is available
after this step, and removes the `Option<CommandPermission>` from the
regular `Command` type.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: ac076a93257d25ec5f9367a5a0b280f8b63371fc
2024-04-29 16:59:37 +00:00
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
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
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
Daniel Harvey
f775580dc9 Separate scalar_types into discreet metadata resolve stage (#470)
<!-- Thank you for submitting this PR! :) -->

## Description

Following from https://github.com/hasura/v3-engine/pull/469 , we split
scalar type resolution too. That will need to be merged before this so
we can tidy up the data passing between them.

No functional change.

V3_GIT_ORIGIN_REV_ID: 5e157c4d15d0223d2bbd24f911ebee24e98b81cd
2024-04-18 10:57:21 +00:00
Daniel Harvey
4b34cddd8a Separate data_connector_type_mappings resolve stage (#469)
<!-- Thank you for submitting this PR! :) -->

## Description

Fairly mechanical change to split the data connector type mappings
resolve into own folders / stage. No functional changes.

V3_GIT_ORIGIN_REV_ID: 805c9d056a64a47afa9005674298e7417e58dad7
2024-04-18 09:24:02 +00:00
Samir Talwar
2cd9714e7f Use anyhow in tests instead of unwrapping everywhere. (#475)
Just a minor change to make tests more readable by avoiding `.unwrap()`.

V3_GIT_ORIGIN_REV_ID: 2cc13b9750e24ea82dfefcc68a05ffd63e1b4b7c
2024-04-18 08:58:17 +00:00
Samir Talwar
98fad6ae45 Use the json! macro to build JSON in JWT tests. (#473)
This uses the `json!` macro in the JWT client code and its associated
tests, rather than embedding a string and parsing it. This will make
compilation fail if the JSON is invalid, which seems better than a
runtime/test-time failure.

There are a few cases where we were constructing a JSON string by
concatenating strings using `format!`. `json!` also handles these cases
better, as you can refer to a JSON value by its variable name too, and
it doesn't require escaping `{` and `}`.

V3_GIT_ORIGIN_REV_ID: 4c40299b71d583efae7b0cdbabee8cff21b09bef
2024-04-18 07:42:33 +00:00
paritosh-08
9ffe298d01 add deserialize trait to AuthConfig (#474)
## Description

There are no user-facing changes in this PR. It just adds the
`Deserialize` trait to `AuthConfig` and makes some changes to internal
functions to avoid clones.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 2e8956bdd3827715693eb14239c808baf737d588
2024-04-18 07:09:53 +00:00
Rakesh Emmadi
010a313988 Expose error caused by negative limit and offset values in the API response (#471)
Previously, negative values for `offset` and `limit` input fields
resulted in an internal error and not exposed in the API response. The
reason is that these errors are raised from normalized_ast conversion
after GraphQL validation. The validation will only check for the type,
but not the value of the input fields.

This Commit:
- Introduces a utility function to lift any unexpected value internal
error to external.
- Use the function for `limit` and `offset` input field value coercion.

V3_GIT_ORIGIN_REV_ID: a186eb89a836359427e58f7a847eab3e2f8fafa4
2024-04-18 06:35:38 +00:00
Daniel Harvey
90082f9fba Enable redundant_closure_for_method_calls clippy rule and fix (#468)
<!-- Thank you for submitting this PR! :) -->

## Description

In https://github.com/hasura/v3-engine/pull/441 we made all our skipped
Clippy rules explicit. This enables one (pretty arbitrarily) and fixes
what comes up.

V3_GIT_ORIGIN_REV_ID: 406692a2a134cb2a6cf5785acd0ac7c5b9f90c61
2024-04-17 14:58:18 +00:00
Samir Talwar
08fce1ff4c Deserialize the NDC response once, not twice. (#467)
## Description

This modifies handling of the NDC response so we deserialize it once,
not twice.

The previous code deserialized first to `serde_json::Value`, and then
again to the required type. This is costly and unnecessary. By
parameterizing over the type, we can go directly to the type we're
looking for.

We still want to do the two-step process for errors, but it's probably
fine if they remain a little slower as the error response shouldn't be
too large.

Analysis with flamegraphs before and after shows a dramatic drop in CPU
time as a result.

V3_GIT_ORIGIN_REV_ID: d7574bd8c82f0863372e1463fda020a8174c7341
2024-04-17 08:12:23 +00:00
Toan Nguyen
3f5461fc62 support OpenTelemetry zipkin propagator (#466)
Support both W3C and Zipkin B3 headers and connectors will
prefer B3 headers to extract traces because Cloud Run doesn't respect
those headers.

V3_GIT_ORIGIN_REV_ID: 1471b848e71d87420bc75b9adee60951f306c856
2024-04-16 14:56:43 +00:00
Anon Ray
d3207869fd revert ndc-pg port to match metadata for local tests (#465)
Revert the local docker-compose to expose ndc-postgres on port `8080` to
match the metadata. Otherwise running tests locally fails.

V3_GIT_ORIGIN_REV_ID: 6ca104a3041f758f13dfb2a05c2a6ab0b449e7cf
2024-04-16 06:51:40 +00:00
Daniel Harvey
422e9af820 Put human readable span name in display.name and add context (#464)
<!-- Thank you for submitting this PR! :) -->

## Description

<img width="435" alt="Screenshot 2024-04-15 at 14 19 21"
src="https://github.com/hasura/v3-engine/assets/4729125/bcaf856a-7dbc-44d5-83af-f05d62232379">

<img width="1445" alt="Screenshot 2024-04-15 at 14 15 07"
src="https://github.com/hasura/v3-engine/assets/4729125/c825ba1c-3004-4145-bbf2-974f627910f6">

This reverts prettifying of span names in
https://github.com/hasura/v3-engine/pull/419/files and instead includes
a `display.name` attribute that we use to include a human readable span
name. Because this doesn't need to be a `'static &str` we can use
`format!` to include dynamic content such as field and data connectors
names.

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

Add human readable `display.name` attribute to spans.

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

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

V3_GIT_ORIGIN_REV_ID: 145046812050e493e164017ae52927b6c463c0de
2024-04-15 14:58:26 +00:00
dependabot[bot]
2d9317df2a Bump strum from 0.25.0 to 0.26.2 (#424)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [strum](https://github.com/Peternator7/strum) from 0.25.0 to
0.26.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Peternator7/strum/releases">strum's
releases</a>.</em></p>
<blockquote>
<h2>v0.26.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix AsRefStr docs to specify lifetime constraints by <a
href="https://github.com/DTrippe"><code>@​DTrippe</code></a> in <a
href="https://redirect.github.com/Peternator7/strum/pull/330">Peternator7/strum#330</a></li>
<li>Fix missing generics on impl for EnumTryAs by <a
href="https://github.com/hasali19"><code>@​hasali19</code></a> in <a
href="https://redirect.github.com/Peternator7/strum/pull/337">Peternator7/strum#337</a></li>
<li>feat(as_ref_str): enable <code>prefix</code> attribute for
<code>AsRefStr</code> derive by <a
href="https://github.com/vbrvk"><code>@​vbrvk</code></a> in <a
href="https://redirect.github.com/Peternator7/strum/pull/334">Peternator7/strum#334</a></li>
<li>Add dependabot by <a
href="https://github.com/oriontvv"><code>@​oriontvv</code></a> in <a
href="https://redirect.github.com/Peternator7/strum/pull/333">Peternator7/strum#333</a></li>
<li>Fix docs that say array instead of slice by <a
href="https://github.com/Peternator7"><code>@​Peternator7</code></a> in
<a
href="https://redirect.github.com/Peternator7/strum/pull/343">Peternator7/strum#343</a></li>
<li>Hide EnumTable by <a
href="https://github.com/Peternator7"><code>@​Peternator7</code></a> in
<a
href="https://redirect.github.com/Peternator7/strum/pull/344">Peternator7/strum#344</a>
<ul>
<li>EnumTable will likely be deprecated.</li>
</ul>
</li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/DTrippe"><code>@​DTrippe</code></a> made
their first contribution in <a
href="https://redirect.github.com/Peternator7/strum/pull/330">Peternator7/strum#330</a></li>
<li><a href="https://github.com/hasali19"><code>@​hasali19</code></a>
made their first contribution in <a
href="https://redirect.github.com/Peternator7/strum/pull/337">Peternator7/strum#337</a></li>
<li><a href="https://github.com/vbrvk"><code>@​vbrvk</code></a> made
their first contribution in <a
href="https://redirect.github.com/Peternator7/strum/pull/334">Peternator7/strum#334</a></li>
<li><a href="https://github.com/oriontvv"><code>@​oriontvv</code></a>
made their first contribution in <a
href="https://redirect.github.com/Peternator7/strum/pull/333">Peternator7/strum#333</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Peternator7/strum/compare/v0.26.1...v0.26.2">https://github.com/Peternator7/strum/compare/v0.26.1...v0.26.2</a></p>
<h2>v0.26.1</h2>
<h2>0.26.1</h2>
<ul>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/325">#325</a>:
use <code>core</code> instead of <code>std</code> in VariantArray.</li>
</ul>
<h2>0.26.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li>The <code>EnumVariantNames</code> macro has been renamed
<code>VariantNames</code>. The deprecation warning should steer you in
the right direction for fixing the warning.</li>
<li>The Iterator struct generated by EnumIter now has new bounds on it.
This shouldn't break code unless you manually
added the implementation in your code.</li>
<li><code>Display</code> now supports format strings using named fields
in the enum variant. This should be a no-op for most code.
However, if you were outputting a string like <code>&quot;Hello
{field}&quot;</code>, this will now be interpretted as a format
string.</li>
<li>EnumDiscriminant now inherits the repr and discriminant values from
your main enum. This makes the discriminant type
closer to a mirror of the original and that's always the goal.</li>
</ul>
<h3>New features</h3>
<ul>
<li>
<p>The <code>VariantArray</code> macro has been added. This macro adds
an associated constant <code>VARIANTS</code> to your enum. The constant
is a <code>&amp;'static [Self]</code> slice so that you can access all
the variants of your enum. This only works on enums that only
have unit variants.</p>
<pre lang="rust"><code>use strum::VariantArray;
<p>#[derive(Debug, VariantArray)]
enum Color {
Red,
Blue,
Green,
</code></pre></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Peternator7/strum/blob/master/CHANGELOG.md">strum's
changelog</a>.</em></p>
<blockquote>
<h2>0.26.2</h2>
<ul>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/337">#337</a>:
Fix missing generic impls for <code>EnumTryAs</code></li>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/334">#334</a>:
Support prefix in <code>AsRefStr</code>. Technically a breaking change,
but <code>prefix</code> was just added in <code>0.26.0</code> so it's a
newer feature and it makes the feature more consisent in general.</li>
</ul>
<h2>0.26.1</h2>
<ul>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/325">#325</a>:
use <code>core</code> instead of <code>std</code> in VariantArray.</li>
</ul>
<h2>0.26.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li>The <code>EnumVariantNames</code> macro has been renamed
<code>VariantNames</code>. The deprecation warning should steer you in
the right direction for fixing the warning.</li>
<li>The Iterator struct generated by EnumIter now has new bounds on it.
This shouldn't break code unless you manually
added the implementation in your code.</li>
<li><code>Display</code> now supports format strings using named fields
in the enum variant. This should be a no-op for most code.
However, if you were outputting a string like <code>&quot;Hello
{field}&quot;</code>, this will now be interpretted as a format
string.</li>
<li>EnumDiscriminant now inherits the repr and discriminant values from
your main enum. This makes the discriminant type
closer to a mirror of the original and that's always the goal.</li>
</ul>
<h3>New features</h3>
<ul>
<li>
<p>The <code>VariantArray</code> macro has been added. This macro adds
an associated constant <code>VARIANTS</code> to your enum. The constant
is a <code>&amp;'static [Self]</code> slice so that you can access all
the variants of your enum. This only works on enums that only
have unit variants.</p>
<pre lang="rust"><code>use strum::VariantArray;
<p>#[derive(Debug, VariantArray)]
enum Color {
Red,
Blue,
Green,
}</p>
<p>fn main() {
println!(&quot;{:?}&quot;, Color::VARIANTS); // prints:
[&quot;Red&quot;, &quot;Blue&quot;, &quot;Green&quot;]
}
</code></pre></p>
</li>
<li>
<p>The <code>EnumTable</code> macro has been <em>experimentally</em>
added. This macro adds a new type that stores an item for each variant
of the enum. This is useful for storing a value for each variant of an
enum. This is an experimental feature because
I'm not convinced the current api surface area is correct.</p>
<pre lang="rust"><code>use strum::EnumTable;
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Peternator7/strum/commits/v0.26.2">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=strum&package-manager=cargo&previous-version=0.25.0&new-version=0.26.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>
V3_GIT_ORIGIN_REV_ID: e3add1ec70f4a1ba2d8a25ef953dde94f5c8ea66
2024-04-15 09:56:34 +00:00
dependabot[bot]
69fec9000f Bump async-graphql-parser from 5.0.10 to 7.0.3 (#462)
Bumps
[async-graphql-parser](https://github.com/async-graphql/async-graphql)
from 5.0.10 to 7.0.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/async-graphql/async-graphql/blob/master/CHANGELOG.md">async-graphql-parser's
changelog</a>.</em></p>
<blockquote>
<h1>[7.0.3] 2024-03-16</h1>
<ul>
<li>Sort schema fields &amp; enums if required <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1475">#1475</a></li>
<li>Change the <code>type_name</code> of <code>EmptySubscription</code>
fix <a
href="https://redirect.github.com/async-graphql/async-graphql/issues/1435">#1435</a>
<a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1475">#1475</a></li>
<li>add <code>Request::set_parsed_query</code> method <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1483">#1483</a></li>
<li>Upgrade strum to 0.26 <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1485">#1485</a></li>
<li>Fix validation of non-nullable variables with default values <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1491">#1491</a></li>
<li>add <code>NextExecute::run_with_data</code> method to attach context
data before execution</li>
<li>feat: add registry method in dynamic::Registry <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1492">#1492</a></li>
<li>Allow non-scalars to be used as directive arguments <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1493">#1493</a></li>
<li>fix: add description to __schema introspection result <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1489">#1489</a></li>
</ul>
<h1>[7.0.2] 2024-02-18</h1>
<ul>
<li>Fix <code>#[derive(OneofObject)]</code> rejecting enums where the
type comes from a macro subsitution <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1473">#1473</a></li>
<li>Optimize object proc-macro codegen <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1470">#1470</a></li>
<li>Use <code>impl Future</code> instead of <code>async-trait</code> in
most traits. <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1468">#1468</a></li>
<li>Upgrade <code>base64</code> to <code>0.21</code> <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1466">#1466</a></li>
<li>Standardize space between Args, Lists and Binary items <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1392">#1392</a></li>
<li>feat: support bigdecimal 0.4.x <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1358">#1358</a></li>
</ul>
<h1>[7.0.1] 2024-01-21</h1>
<ul>
<li>Add <code>Shareable</code> Attribute To InputObjectField <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1459">#1459</a></li>
<li>Feature Generic Unions <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1424">#1424</a></li>
<li>Address axum integration compilation error with non-Sync body <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1460">#1460</a></li>
<li>fix: date cursor precision string format <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1462">#1462</a></li>
</ul>
<h1>[7.0.0] 2024-01-06</h1>
<ul>
<li>upgrade to <code>http1</code></li>
<li>Feature extend ResolveInfo with field attribute <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1428">#1428</a></li>
</ul>
<h1>[6.0.11] 2023-11-19</h1>
<ul>
<li>Clean up example docs <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1411">#1411</a></li>
<li>Run batch requests concurrently <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1420">#1420</a></li>
<li>Update opentelemetry to <code>v0.21.x</code> <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1422">#1422</a></li>
</ul>
<h1>[6.0.10] 2023-11-04</h1>
<ul>
<li>bump opentelemetry <code>0.20.0</code> <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1406">#1406</a></li>
<li>fix check for serial <a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1405">#1405</a></li>
<li>fixes complexity visitor</li>
<li>bump Rocket from <code>0.5.0-rc.2</code> to
<code>0.5.0-rc.4</code></li>
</ul>
<h1>[6.0.9] 2023-10-21</h1>
<ul>
<li>add support uploading files in dynamic schema <a
href="https://github.com/async-graphql/async-graphql/discussions/1384">#1384</a></li>
<li>Include <code>@composeDirective</code> in Federation's
<code>_service</code> field and document <code>#[TypeDirective]</code>
<a
href="https://redirect.github.com/async-graphql/async-graphql/pull/1400">#1400</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/async-graphql/async-graphql/commits">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-graphql-parser&package-manager=cargo&previous-version=5.0.10&new-version=7.0.3)](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>
V3_GIT_ORIGIN_REV_ID: f1b749f6e069c3c72d48cc87f1e014fdff7fbf2d
2024-04-15 09:31:23 +00:00
dependabot[bot]
ef34542f31 Bump nonempty from 0.8.1 to 0.10.0 (#463)
Bumps [nonempty](https://github.com/cloudhead/nonempty) from 0.8.1 to
0.10.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/cloudhead/nonempty/commits">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nonempty&package-manager=cargo&previous-version=0.8.1&new-version=0.10.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>
V3_GIT_ORIGIN_REV_ID: 11c6454b5e7e9877b52075f0e0efe6839ecf3be1
2024-04-15 08:41:48 +00:00
Philip Lykke Carlsen
8752081323 Add /metadata and /metadata-hash endpoints (#461)
## Description

This PR iterates on #459.

Rather than serving the engine metadata it serves an arbitrary file,
given by the command line argument `--introspection-metadata`.
Specifying this argument gives rise to endpoints `/metadata` and
`/metadata-hash`.

![image](https://github.com/hasura/v3-engine/assets/358550/63040f02-876a-4c29-8cf1-52a305ffff67)

Update: We only load the file in at engine startup and serve that
version. Changing the file on disk will not change what the engine
serves.

---------

Co-authored-by: Gil Mizrahi <gil@gilmi.net>
V3_GIT_ORIGIN_REV_ID: db88adb5c08c4489cc1abd5fb5236b8d5ba51b9a
2024-04-11 21:32:40 +00:00
Daniel Harvey
4bc2f21f80 remove TypeRepresentation (#456)
<!-- Thank you for submitting this PR! :) -->

## Description

Previously we moved all our types around in one big bucket, meaning we
often had to check we had the thing we wanted, this splits it up so
dependencies are more granular and clearer.

This means instead of passing `types` around, we'll have both
`scalar_types` or `object_types`. Usually just `object_types` though.

V3_GIT_ORIGIN_REV_ID: 6a6b8d6265b0391f8910f3d4f8932ad151453c18
2024-04-11 14:19:42 +00:00
Philip Lykke Carlsen
624df9a594 Add /metadata endpoint which serves the initial, raw metadata (#459)
## Description

As a temporary means of supporting a local development setup, this PR
adds a `/metadata` endpoint that serves the raw metadata that the engine
was started with.

![image](https://github.com/hasura/v3-engine/assets/358550/bf34c3f8-d153-4a93-9044-dbaa15299481)

V3_GIT_ORIGIN_REV_ID: 44c552cfe29ee587fa0d383f7788aacc5579770f
2024-04-11 11:08:27 +00:00
Daniel Harvey
93d608c1ab break out data_connectors resolving step (#457)
<!-- Thank you for submitting this PR! :) -->

## Description

As per https://github.com/hasura/v3-engine/pull/450, break out creation
of `data_connectors` info (and related types) into it's own files.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 7a8d445217a4fac2bbb135aa48baa20a0789e785
2024-04-11 08:53:58 +00:00
Samir Talwar
8c538f5719 Inject trace context headers into requests to the auth hook. (#458)
This injects trace context headers into requests to the auth hook,
allowing us to figure out how much time is spent here.

I added a basic tracing setup to the dev-auth-webhook, using
`tracing-util`, allowing me to verify that this works. This required
moving the Dockerfile to the root so the context contains the
`tracing-util` crate too.

I have also fixed the reference agent (by updating it), and patched our
Docker Compose files to correctly set up connectivity to Jaeger.

V3_GIT_ORIGIN_REV_ID: 2ff930bda4147d00dcc73268a814b08c8a07a359
2024-04-11 07:42:01 +00:00
Daniel Harvey
50f1243a46 docs: attempt to document roles / annotations (#358)
<!-- Thank you for submitting this PR! :) -->

## Description

This is an attempt to somewhat document how roles / annotations work in
`v3-engine`. The main purpose of this exercise was to solidify my
understanding, so I would very much welcome any corrections.

V3_GIT_ORIGIN_REV_ID: 28600998c8a01ef7f95198b44b875f4f14873793
2024-04-10 08:58:13 +00:00
Anon Ray
1269108b22 remove a stray file (#455)
Remove a stray file, which seems to be accidentally checked in.

V3_GIT_ORIGIN_REV_ID: d7b6c859ddd48b3dde86fc4b087541e78899924e
2024-04-10 08:34:28 +00:00
Tom Harding
4dc02b0967 Add a binary for generating the OpenAPI schema for the metadata type. (#453)
<!-- Thank you for submitting this PR! :) -->

## Description

I needed this, so I made it. It's nothing too complex: we just
pretty-print the `schemars` schema for the root `Metadata` type.

<!--
  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
- [ ] 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: a9e75bfa06c35577c17d8cbf0d021b1f56826a28
2024-04-10 07:36:55 +00:00
Daniel Harvey
66e012f589 break out BooleanExpressionError from Error (#449)
<!-- Thank you for submitting this PR! :) -->

## Description

Further breaking up the big error type. Functional no-op.

V3_GIT_ORIGIN_REV_ID: d34acb7fd6421c250c214b133b8a107e03155c70
2024-04-09 09:16:27 +00:00
Daniel Harvey
6f8470ca3c break out graphql_config resolving step (#450)
<!-- Thank you for submitting this PR! :) -->

## Description

Resolving metadata is pretty messy, so we're breaking it into more
explicit steps. This breaks out the first, and arguably most trivial
step.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: eca1ce3276f826e769ac4a29d62504542e41848d
2024-04-09 08:10:20 +00:00
Rakesh Emmadi
e6829651b1 Default reason for field deprecation (#448)
Generate default `deprecationReason` in GraphQL schema for OpenDd
metadata marked as deprecated without a reason.

V3_GIT_ORIGIN_REV_ID: 6979bd264b5c11d24b6c634115b6fbd8405a5ba6
2024-04-08 16:45:19 +00:00
Daniel Harvey
9b8915b5b5 split out RelationshipError (#445)
<!-- Thank you for submitting this PR! :) -->

## Description

More work to break down the giant `Error` type in metadata resolve step.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 8cfa4ad0bef254e93241d254123910bf3d5357f3
2024-04-08 10:55:36 +00:00
Daniel Harvey
2a24b3060a use clippy settings in Cargo workspace (#441)
<!-- Thank you for submitting this PR! :) -->

## Description

Following the approach taken here:
https://github.com/hasura/ndc-postgres/pull/402

This moves the `clippy` settings into the Cargo workspace file instead
of passing them for each invocation.

We enable all pedantic settings, run `cargo clippy --fix` to auto fix a
few things, and then manually disable all other lints.

Plenty of them are worth enabling and fixing in future IMO.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: aa0e6ccb8d72a7393e14b5c58b82077a67d9cb15
2024-04-08 10:14:11 +00:00
Phil Freeman
209ec112ec Update to ndc-spec-0.1.2 (#443)
<!-- Thank you for submitting this PR! :) -->

## Description

- Update to `ndc-spec`-`0.1.2`
- Use `ndc_models` since `ndc_client` was removed
- Use `Int32` in `custom_connector` everywhere

<!--
  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?
-->

V3_GIT_ORIGIN_REV_ID: 00c6e7a6c213ab0de31303a93f8446c1d371c538
2024-04-05 09:35:47 +00:00
paritosh-08
e56594fe4f fix bug with multiple fields in boolean expressions (#442)
<!-- Thank you for submitting this PR! :) -->
# ⚠️ Behaviour change in query execution

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

This PR fixes a bug (different behaviour from v2) with boolean
expressions.

Slack thread:
https://hasurahq.slack.com/archives/C066TKMH79R/p1711987325682919

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

## 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: 4fcfc16a9a88ed6362315ca2f47911e0c97b7829
2024-04-05 08:02:37 +00:00
David Overton
9a6cb644f1 Allow nulls when expecting object or array in response (#440)
<!-- Thank you for submitting this PR! :) -->

## Description

Fix a bug which was causing an internal error when `null` was returned
by NDC for a field of array or object type.

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

Fix a bug which was causing an internal error when `null` was returned
by NDC for a field of array or object type.

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

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

V3_GIT_ORIGIN_REV_ID: 5c935ccd6720b5e5966dfa87c2e21dbb7a2b36f2
2024-04-04 10:53:40 +00:00
Rakesh Emmadi
0e822cc934 NDC response size limit (#439)
- Introduce a field in NDC `Configuration` struct that carries an
optional limit (`usize`) value.
  - When set, reject NDC response that is greater than the limit.
- Define a `HttpContext` struct that captures both `reqwest::Client` and
an optional limit value. Replace the `http_client` argument with
`http_context: &HttpContext` in all execute related functions.
- The `execute_query` function caller in multitenant code need to pass a
reference to `HttpContext` with appropriate NDC response size limit.

V3_GIT_ORIGIN_REV_ID: 85a3647c4d136cc8d887f343736cc011166f036f
2024-04-04 04:56:50 +00:00
Daniel Harvey
b66c43b645 use new Postgres mutations (#438)
<!-- Thank you for submitting this PR! :) -->

## Description

Set our `ndc-postgres` connector in tests to use new mutations versions
so we can test Boolean Expressions. Also does some house-keeping, like
ensuring we pull the latest `ndc-postgres` in CI and exposing `8080`
from `ndc-postgres` to fix local dev flow.

V3_GIT_ORIGIN_REV_ID: 4c92670e9976a3f75ec31e1224079799380ef6e2
2024-04-03 11:51:53 +00:00
Daniel Harvey
c53c581a00 resolve ValueExpression (#436)
<!-- Thank you for submitting this PR! :) -->

## Description

We'll shortly be adding `BooleanExpression` to `ValueExpression`, which
will require resolving the internal `ModelPredicate`. This PR adds a
resolving step for `ValueExpression` to simplify that later step. It is
essentially a no-op to introduce a new type.

V3_GIT_ORIGIN_REV_ID: 8bfe4a180e12ae50d8f131072886054c0e618ec4
2024-04-03 10:24:15 +00:00
Rakesh Emmadi
46cb1bfe44 refactor execute/ndc/client.rs (#435)
- Move redundant code in `client.rs` into a separate function.
- Doc utility functions through comments

V3_GIT_ORIGIN_REV_ID: f172ec2309b48c627f4ab9179efcb4c278e82989
2024-04-03 09:37:10 +00:00
Samir Talwar
59de1c3c33 Update the ndc-postgres dependency to the latest version. (#386)
This seems appropriate now that we've stabilized the new configuration.
Of note are the configuration updates and the use of an environment
variable to specify the connection URI. This upgrade also fixes the
health checks.

Regenerating the configuration lost the table descriptions, which seems
to be because they were not present in the Chinook SQL. I have dragged
the Chinook SQL in from ndc-postgres and kept it separate from the
initialization of other tables.

The auto-generated configuration is slightly different from the
manually-created configuration in that the collection names are
singular, not plural. This means that I had to change a lot of test
metadata files too.

V3_GIT_ORIGIN_REV_ID: 2b66fd3049aaf4daeb386915ea3b64a209b1f393
2024-04-03 08:04:07 +00:00
Abhinav Gupta
8142819ae0 Enforce titles are set on most metadata json schemas (#434)
- Adds titles to json schemas where missing
- Adds tests to ensure we don't miss titles in the future (modulo some
exceptions)

This is required to be able to autogenerate the docs for the metadata

V3_GIT_ORIGIN_REV_ID: e2027f3e3d5ee3546af99ff5c2d6de59604a3aec
2024-04-02 23:39:44 +00:00
Rakesh Emmadi
a434da835e Avoid using NDC client code from ndc-spec (#433)
Ref: https://github.com/hasura/ndc-spec/pull/130

- Avoid using NDC client code from ndc-spec for ndc API requests.
Instead, copy the client related code from ndc-spec into v3-engine.
- Code is copied into `.../execute/ndc/client.rs` module with the
following changes:
- API, configuration and error type related code is consolidated into a
single `client.rs` module.
- Derive error implementation for the error type using
`thiserror::Error` derive-macro
- Replace `opentelemetry` crate usage with `tracing_util` with necessary
changes
- Lot of redundant logic still there which will be addressed through
https://hasurahq.atlassian.net/browse/APG-53

V3_GIT_ORIGIN_REV_ID: 5766e407495c483cc4814d1286121b233aed3af0
2024-04-02 17:27:06 +00:00
Samir Talwar
5a0102b407 Avoid .unwrap in favor of anyhow for better error messages in tests. (#430)
I am struggling to diagnose some errors and `.unwrap` is not helping, as
it doesn't properly capture stack traces or anything else that might be
useful.

`anyhow` was built for this. Let's use it.

I had to convert `SessionError` to a real `Error`, which I don't think
is a bad thing.

V3_GIT_ORIGIN_REV_ID: 3b8a70bb87e12e7b9e39515cd5f769fbd2cbfb39
2024-04-02 17:06:56 +00:00
Tom Harding
ec62ea463c Run cargo fmt in CI (#431)
<!-- Thank you for submitting this PR! :) -->

## Description

When I run `cargo fmt` on my branches, it makes more diff than I want.
This PR fixes that by adding `just format` / `just fmt`, and adding it
to a CI job.

<!--
  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
- [ ] 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: e31e352f27b9ad0129c3759fead051b1a8d86758
2024-04-02 15:09:32 +00:00
Rakesh Emmadi
cc9cedc268 Set request payload limit to 10 MB (#429)
V3_GIT_ORIGIN_REV_ID: b0377caff0cb6c65b51179037e09e6eae9dc3bfb
2024-04-02 10:51:15 +00:00
Samir Talwar
8bee92864d Listen on any IPv4 or any IPv6 address. (#428)
## Description

Listening on `0.0.0.0` only binds to IPv4 addresses. We can listen on
IPv4 and IPv6 by using `::`.

I have opted to use the constants for this rather than parsing a string,
both for clarity and to avoid errors.

## 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 now binds to all IPv4 and IPv6 addresses. Previously it
only used IPv4.

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

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

V3_GIT_ORIGIN_REV_ID: d63b5544bfbf2ad067113980fa61dd74213c7b78
2024-04-02 10:17:41 +00:00
Samir Talwar
79039afbc0 Fix a bug in usage of mockito. (#421)
If we're running a mockito server in async tests, we must use
`new_async`.

The latest version enforces this.

V3_GIT_ORIGIN_REV_ID: cb58f248336c7bab08329d311b8b97b8244437a1
2024-04-02 08:23:12 +00:00
Abhinav Gupta
18e249dcf4 Fail schema generation if relationship name conflicts with object field name (#423)
Fail schema generation if relationship name conflicts with object field
name

V3_GIT_ORIGIN_REV_ID: fcc979166bffe826c809e7992dd64afeff55c5f7
2024-03-30 19:04:31 +00:00
paritosh-08
dcd0cd4869 Fix explain for remote relationships (#422)
<!-- Thank you for submitting this PR! :) -->

## Description

Currently, the engine doesn't execute remote relationships in parallel
(even if it can). This PR fixes the explain to also reflect the same.

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

Slack: https://hasurahq.slack.com/archives/C02G2M3C1T3/p1711643767793919
V3_GIT_ORIGIN_REV_ID: 53494c317cc7210f1dafd904d65def5c2d06a504
2024-03-29 10:32:27 +00:00
Daniel Harvey
96e8028c01 make user-facing spans human readable (#419)
Most of our span names were in the format `snake_case` and usually
reflected `name_of_the_function`. This is unfriendly, so we've changed
it to match the format used by data connectors, which use a format like
"Database request" or "Waiting for connection".

It would be nice if `Execute request plan for query field` could be
`Execute request plan for query field "person"` but it seems changing
the currently used `&'static str` for `String` causes all sorts of other
lifetime issues, so I suppose we're better including more information as
span attributes instead. Therefore, all our span names need to be pretty
much static (or at least, dynamically chosen from a list of static
names).

Note: I have not changed the `SpanVisibility::Internal` span names for
now. Most of these reflect function names and this is pretty useful IMO.
Happy to change this later if other feel strongly though.
V3_GIT_ORIGIN_REV_ID: f2226b2466e8592676f3f4635d483289f0e3f6aa
2024-03-29 06:37:14 +00:00
Samir Talwar
3a1968317b Upgrade ndc-spec and opentelemetry, and add a traceresponse header. (#416)
<!-- Thank you for submitting this PR! :) -->

## Description

I have upgraded ndc-spec to v0.1.1. This pulls in an upgrade to
opentelemetry v0.22 so I've done that too.

We had issues with the `traceresponse` response header disappearing when
using an opentelemetry version > v0.20. This seems to be resolved here,
probably because we have pinned a single version of opentelemetry rather
than loading multiple at once. I added the `traceresponse` header to
verify this, and have left it in because it doesn't seem to hurt
anything.

I verified that everything works as expected with the OSS components,
but not multitenant.

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

v3 engine GraphQL queries now include a "traceresponse" header.

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

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

V3_GIT_ORIGIN_REV_ID: f37b6bdb1331b55c49f0bd953f522f5eca298d1d
2024-03-28 16:21:22 +00:00
Samir Talwar
00e86292ac Upgrade indexmap and fix deprecation warnings. (#417)
`IndexMap::remove` has been deprecated in favor of
`IndexMap::swap_remove` (which has the same behavior, but is clearer
about breaking ordering) or `IndexMap::shift_remove`, which retains
order but is O(n) complexity.

I have taken a look at the areas where we use `.remove`. Where we
discard the map afterwards, I've changed it to `.swap_remove`. In one
case, we do return the data in the event of error, but we probably care
more about consistency of ordering than the actual precise order, so
I've used a `HashMap` and just sorted it instead.

V3_GIT_ORIGIN_REV_ID: 479e1013a4a9938f973b5ed85dbf3837896151e4
2024-03-28 15:24:03 +00:00
Tom Harding
fe6e99762e Group mutation nodes by connector (#406)
## Description

In order to implement transactions for the connectors that allow it, we
want to group mutation commands by connector. Then, we can execute a
group in a single transaction if possible, else just loop through it as
we always have. Grouping by connector also means we can access things
like capabilities for whole batches at a time.

## 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: 928715b78b214a3ac2452e8d1e5f33c87b20de33
2024-03-28 14:54:52 +00:00
Daniel Harvey
2ea7dbde76 re-add axum and machete-ignore it to fix tests run with cargo test (#418)
<!-- Thank you for submitting this PR! :) -->

## Description

For some reason, `cargo test` fails because of missing types in doc
comment code, but `cargo nextest run` in CI does not. Re-adding `axum`
as a dep dependency to `tracing-util` fixes this.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 518e6faf702895d9c434056a57c40c2db6f4b0a8
2024-03-28 11:28:48 +00:00
Daniel Harvey
d99301f6f6 add just run-local command (#415)
<!-- Thank you for submitting this PR! :) -->

## Description

My memory is bad and I want to make it easy to run the `engine` to try
it out. This adds the `just run-local` command which uses the schema
from the tests (and so is very likely to continue working).

<img width="1445" alt="Screenshot 2024-03-28 at 09 44 46"
src="https://github.com/hasura/v3-engine/assets/4729125/5dc9a8d6-612e-418e-be24-ef0fefd0da99">
V3_GIT_ORIGIN_REV_ID: b5cd009b19805f5e9ed6180f68878207ece50d98
2024-03-28 10:27:18 +00:00
Samir Talwar
748bb3abab Remove unused dependencies using cargo machete. (#413)
`cargo machete` is a very useful tool that figures out when you aren't
using a dependency. I have run this locally to remove unused
dependencies.

I've also added a CI job to make sure we catch these in the future.

Sometimes it reports false positives, e.g. when a dependency isn't used
directly but in macro-generated code (e.g. with `strum`). I have added
`"ignored"` clauses to the `Cargo.toml` files where appropriate.

V3_GIT_ORIGIN_REV_ID: ed015089b695cec8eeb03ce455d6dd3cd312a016
2024-03-28 09:17:47 +00:00
Samir Talwar
04207e1c8f Improvements to Docker configuration. (#414)
- Use `rust-toolchain.toml` to specify tools.
- Drop the unused version field from the compose files.
- Use a modern Docker base for the dev-auth-webhook.
- Handle signals in the test servers so `docker stop` is quick.
- Upgrade Jaeger.

V3_GIT_ORIGIN_REV_ID: b5fee1d5dc953a1fdb0aabd75ba02df6846b7518
2024-03-28 08:52:55 +00:00
Anon Ray
1b4173011f fix empty input object types in introspection result when allowedFields for a type is empty (#412)
When there are no allowed fields for a type (via `TypePermissions`),
engine creates related input object types (like `<TypeName>OrderBy`)
with no fields. This results in an invalid introspection result. Client
libraries fail with validation error.

This PR fixes the issue.

V3_GIT_ORIGIN_REV_ID: a45a56b1f503f6ab99f250884957b6fc723cf9c8
2024-03-28 07:47:00 +00:00
Brandon Simmons
c60a2e7113 lang-graphql: limit recursion to avoid stack overflows
This was a simple solution to prevent crashes from the cases that I was
able to discover,  refactored into a macro that can be used elsewhere;
but I suspect there's a more idiomatic rust solution
(entailing a big refactor?). There's also the stacker crate, and see
also discussion here:
https://hasurahq.slack.com/archives/C04PUMV4X16/p1707337409839869?thread_ts=1701302324.058369&cid=C04PUMV4X16

Note that the compiled binary was built and fuzzed with `--release`.
Many discovered cases caused crashes  when run into non-optimized binary
(probably stack overflows but I did not look into it)

V3_GIT_ORIGIN_REV_ID: 31acfc9e358c807be80ba6a5efa78ace78306291
2024-03-27 23:03:27 +00:00
Brandon Simmons
508be3a185 Test some parser stack overflow panic cases found through fuzzing
V3_GIT_ORIGIN_REV_ID: c9140708c7244546cfab61db2487d62abc51ad38
2024-03-27 23:03:20 +00:00
Brandon Simmons
8d2f0d704b update ahash to keep buildable on rust nightly tkaitchuck/aHash#200
V3_GIT_ORIGIN_REV_ID: a36abced11359755423356f8a2311ae4514978de
2024-03-27 23:03:13 +00:00
Abhinav Gupta
d9a7af2e7f Give types / titles to all maps in the metadata jsonschema (#408)
Give types / titles to all maps in the metadata jsonschema

This helps in automatically generating the metadata docs page. Without a
title/type it's hard to refer to what is the type of the fields which
have a map type.

V3_GIT_ORIGIN_REV_ID: 8d13012b95910be13fdee6a7af1372f7b6cf2b89
2024-03-27 17:08:36 +00:00
Samir Talwar
4d2eb668d0 Alias ndc_client::models as ndc_models. (#411)
An upcoming version of ndc-spec will split out this module as a new
crate named `ndc_models`. This PR gets ahead of this change by aliasing
so that we can simply delete the `use` lines in the future.

This is a very boring, mechanical change that does not modify any
behavior at all.

V3_GIT_ORIGIN_REV_ID: 078d3f5fbc2961fcd93b924134de40ba693f0061
2024-03-27 13:21:43 +00:00
Anon Ray
df032bb1e3 opendd: remove deprecated namespace field from relationship target (#410)
Remove deprecated `namespace` field from relationship target. This is no
longer required, as no tooling doesn't depend on it.

Ref: https://hasurahq.slack.com/archives/C04NS5JCD8A/p1711527952823369
V3_GIT_ORIGIN_REV_ID: 70f2a71c1cb3d44411ec1eaf9c62bd790bf4cd12
2024-03-27 09:55:01 +00:00
Daniel Chambers
5e1d2cf506 Fix missing descriptions on GraphQL input object types (#409)
Fixes descriptions defined on `ObjectType`s and their fields in metadata
not showing up when that type is expressed as an input object type in
GraphQL.

V3_GIT_ORIGIN_REV_ID: de5cb2d545441fdebdf85fa84c90e9f0a4cbaac7
2024-03-27 07:09:38 +00:00
Samir Talwar
50ff30ae5b Nix: Switch to nixpkgs-unstable, rather than nixos-unstable. (#407)
If we're going to be unstable, let's go all the way.

This change was motivated by needing to upgrade cargo-machete to make it
work with Rust v1.77, and not having the upgrade in nixos-unstable.

V3_GIT_ORIGIN_REV_ID: 8191a376a6aeebc08787f973d58d373f8ab9ad0d
2024-03-26 15:38:33 +00:00
Daniel Harvey
6881852b43 rename function to be clearer (#405)
<!-- Thank you for submitting this PR! :) -->

## Description

`check_conflicting_graphql_types` actually inserts a new GraphQL type
into a set (and explodes on failure).

Renamed to `store_new_graphql_type` which I feel is a bit clearer.

V3_GIT_ORIGIN_REV_ID: 4b774b9cd9e479c16f3de8af4df263f97cfab107
2024-03-26 14:33:02 +00:00
Tom Harding
ec9a3aabc1 Remove node-level mutation planning (#397)
## Description

We don't need the per-node mutation plan because, where at all possible,
we won't run per-node mutations. This change doesn't change the
behaviour of anything, but changes the structure of mutation plans to be
whole-request, rather than per-node.

## 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: 9accc9696fabd05f992c6245ccc411a781cf5790
2024-03-26 14:08:09 +00:00
Daniel Harvey
9e73dd7f81 Use correct crate folders in ci.docker-compose.yaml (#404)
<!-- Thank you for submitting this PR! :) -->

## Description

Missed this in https://github.com/hasura/v3-engine/pull/355, apologies.

V3_GIT_ORIGIN_REV_ID: 360b4a3a218f6ba754814c5b3083a8151a7886fb
2024-03-26 13:47:04 +00:00
Anon Ray
10e12d8acf remote joins: do not include the join field if it already exists (#402)
For remote joins, if join field already exists in the selection set, do
not request it again. Include the join field only if it is not in the
selection set.

A field selection might be expensive, so we do not want to duplicate it.

Fixes: https://hasurahq.atlassian.net/browse/V3API-296
V3_GIT_ORIGIN_REV_ID: d09e4298557ca098433b0758c15703295ccbfd39
2024-03-26 10:25:43 +00:00
Daniel Harvey
dda2fb8eca more explicit data flow in metadata resolver (#403)
<!-- Thank you for submitting this PR! :) -->

## Description

As noted in https://github.com/hasura/v3-engine/pull/398, the metadata
resolver works by passing a lot of mutable references around, making the
flow of data quite difficult to follow. This changes the passing of
`types` to make it more explicit. Where possible, any mutation is pushed
up to the top-level, or we return owned values.

V3_GIT_ORIGIN_REV_ID: 61251929cbc9b9410fabba85b58738037dfcb586
2024-03-26 09:59:13 +00:00
Daniel Harvey
b6f6d48027 better name for resolve_data_connector_type_mappings in metadata resolver (#401)
<!-- Thank you for submitting this PR! :) -->

## Description

Addressing
https://github.com/hasura/v3-engine/pull/398#discussion_r1538623981

V3_GIT_ORIGIN_REV_ID: 8f9c4f95fd2c57246693168c901640872b479741
2024-03-26 08:55:25 +00:00
Anon Ray
7dd3dfa235 gardening: split remote joins into smaller modules (#400)
No-op change. Splits `execute/remote_joins.rs` into smaller modules -
`execute/remote_joins/collect.rs` and `execute/remote_joins/join.rs`

V3_GIT_ORIGIN_REV_ID: 15d4e7dc313843691d44d5f9488134c83ffddfea
2024-03-26 07:29:49 +00:00
Phil Curzon
be93dd2a6a Fix json schema description spelling errors (#399)
## Description

Fixes various spelling errors in the JSON schema descriptions.

No behavioural changes.

V3_GIT_ORIGIN_REV_ID: 56454b3193baa8257caa6116a35fbdda4be1d5eb
2024-03-26 05:51:47 +00:00
Daniel Harvey
2743dbc479 split up resolving metadata into functions (#398)
<!-- Thank you for submitting this PR! :) -->

## Description

Was trying to work out where mutation was happening in this massive
function, so broke it up into lots of smaller functions so it's easier
to tell from the inputs what is going on. There is definitely lots of
room for improvement here, have avoided making any functional changes in
lieu of just mechanically moving the code.

Behavioural no-op.

V3_GIT_ORIGIN_REV_ID: 19fa239319d348d486eb18e15d62614d6af2bd9b
2024-03-25 15:21:06 +00:00
Daniel Harvey
4b8f62d399 Break GraphqlConfigError out of large Error type (#396)
<!-- Thank you for submitting this PR! :) -->

## Description

The `Error` enum in `resolved/error.rs` is absolutely giant. Going to
break it down into smaller structures, this is the first of those. There
are probably some missing items in here, but I am starting with rough
cuts and expect the right place for everything to appear over time.

No behavioural change.

V3_GIT_ORIGIN_REV_ID: 69d4ae880ad9cbffdc66adde10996e9f92cee8f4
2024-03-25 14:36:49 +00:00
Daniel Harvey
e68db9136d add exports to tracing-util (#387)
<!-- Thank you for submitting this PR! :) -->

## Description

We don't want `v3-engine-multitenant` to import any opentelemetry
libraries directly, so we add more functions and re-exports here
instead.

V3_GIT_ORIGIN_REV_ID: 2e38b9b1ba6fda23d1bfe8e20549c3a95bd5a2fa
2024-03-25 09:49:22 +00:00
Daniel Harvey
af1a7a9164 update to Rust 1.77.0 (#388)
<!-- Thank you for submitting this PR! :) -->

## Description

https://github.com/rust-lang/rust/releases/tag/1.77.0

V3_GIT_ORIGIN_REV_ID: 7cdbe93ba6188b690c8dd22d86009d1a64470472
2024-03-25 08:25:10 +00:00
paritosh-08
0642cbadaa support apollo federation (part 1) (#332)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR adds the capability to expose _entities and _service fields.
Apollo Federation uses these fields to extend types in other subgraphs
using the types from a subgraph. We can now use Hasura v3 as a subgraph
in an Apollo federated supergraph.

To make this possible, we had to do the following metadata changes:

- Add `apolloFederation` in `ObjectType.graphql`:
  ```yaml
  apolloFederation:
      keys:
        - fields:
          - id
  ```
- Add `apolloFederation` in `Model.graphql`:
  ```yaml
  apolloFederation:
      entitySource: true
  ```
- Add `apolloFederation` in `GraphqlConfig`:
  ```yaml
  apolloFederation:
      enableRootFields: true
  ```

https://github.com/hasura/v3-engine/assets/85472423/b3223c61-360a-4ed6-b8ab-b394469957ce

RFC:
https://github.com/hasura/graphql-engine/pull/10141/files#diff-a9f74850aca6ecad1556723e4b3c7395e59f26cd40d9de20bfef83cb9c64f028

## 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: 73cb9e6c8ef4bfe64d0f0cd9ce3ccbd32e208712
2024-03-22 02:29:49 +00:00
Samir Talwar
e931a391eb Various improvements to the Docker Compose services. (#383)
I got frustrated by the lack of useful output when services failed to
start in CI, so I thought I'd mess around.

I made some changes so that:

1. we wait for services with health checks to report as healthy,
2. we do not rebuild the engine or custom connector when they start,
3. the health checks work (apart from ndc-postgres, which will come
later), and
4. we use environment variables rather than command-line arguments where
possible.

I have also renamed the "agent" binary to "custom-connector", matching
its crate, because it was driving me a little crazy.

V3_GIT_ORIGIN_REV_ID: 8d672b0b25438b54d47368ce82cd236cfdd4e554
2024-03-21 16:49:38 +00:00
Daniel Harvey
db87ec1ab8 accept JSON strings for ID values (#384)
<!-- Thank you for submitting this PR! :) -->

## Description

Forgot this case in https://github.com/hasura/v3-engine/pull/350 - we
should allow strings to be used for GraphQL `ID` values.

<!--
  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 JSON strings to be passed for arguments with ID scalar type.

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

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

V3_GIT_ORIGIN_REV_ID: df2a81a891a6aa0af54c9792916e1469b823f769
2024-03-21 16:22:52 +00:00
Samir Talwar
aa11947067 Disable benchmarks in unit tests. (#376)
This means that we can pass arguments to the Criterion benchmarks
because the test binaries do not try and run.

For example, if you run this:

```
cargo bench -- --warm-up-time=1 --measurement-time=1
```

… it will currently fail, because it will also pass these arguments to
the tests. Disabling the benchmarks for the tests fixes this.

V3_GIT_ORIGIN_REV_ID: 10fe0683b82c506e1a11b24ca0a0a4041e37b655
2024-03-21 12:42:26 +00:00
Philip Lykke Carlsen
b57a8f9f02 Guard against empty selection sets (#377)
## Description

This PR adds a check which ensures that empty selection sets (i.e.,
selecting a field of object type (or list of object type)) in queries
raise an error.

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

Ensure to reject queries with empty selection sets

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

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

V3_GIT_ORIGIN_REV_ID: 79049c39b58288f39ec29ecf713cc3622842d47e
2024-03-21 11:46:00 +00:00
Samir Talwar
fb89603a11 Automate the inclusion of packages in the Justfile package selector. (#382)
Make the computer do boring computer work.

V3_GIT_ORIGIN_REV_ID: e8438293e1307f2f8d5c72d4d88d1a19bbc1577e
2024-03-21 10:40:45 +00:00
paritosh-08
2172cdae7e downgrade opentelemetry versions (#380)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR downgrades the opentelemetry versions to 0.20. This fixed the
tracing propagation issues faced
[here](https://hasurahq.slack.com/archives/C066TKMH79R/p1710177836329809).

### TODOs:

- [ ] Figure out the exact issue which caused the context propagation to
stop working
- [ ] Open an issue with
[opentelemetry](https://github.com/open-telemetry/opentelemetry-rust)
(if required).

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 0bc4d8142bd2f671e04d1cbf806f4626e2217332
2024-03-21 09:57:30 +00:00
Daniel Harvey
e3bd16b5db Revert Bump serde_with from 2.3.3 to 3.7.0 (#381)
Reverts hasura/v3-engine#367

This is causing downstream problems in `v3-metadata-build-service`,
let's roll back for now to unblock things.

V3_GIT_ORIGIN_REV_ID: 3261f2f12825c8eac3353a2282b982f0f3bac80e
2024-03-21 09:33:15 +00:00
Rakesh Emmadi
25d6f571ad avoid using deprecated field in json schema examples (#379)
V3_GIT_ORIGIN_REV_ID: 0e243e37154b745514c9560637bcbe512cd5cf38
2024-03-21 08:37:12 +00:00
paritosh-08
3dc725dce6 remove accidentally duplicated files (#378)
Remove accidentally duplicated files from #349

V3_GIT_ORIGIN_REV_ID: 40ff3f142cd44915d3f6d5bea3cdc99d78f90e71
2024-03-21 06:59:14 +00:00
Anon Ray
e4b1f3166c fix: remote joins bug with nested selections (#371)
## Description

This PR fixes a bug when remote joins is used within nested selections.
The bug is described in #318

Closes: https://hasurahq.atlassian.net/browse/V3ENGINE-20

The fix is to remove the replacement tokens data type. And instead use
each `Argument` as the key to lookup in RHS response and join with LHS
response.

<!--
  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
- [ ] 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
-->

Fix bug when remote joins are used within nested selections

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

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

---------

Co-authored-by: Gil Mizrahi <gil@hasura.io>
V3_GIT_ORIGIN_REV_ID: 3c0648f5fb21eb4f1d6cc004db2f3ee61a731c38
2024-03-20 17:50:19 +00:00
dependabot[bot]
92fc015fac Bump serde_with from 2.3.3 to 3.7.0 (#367)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 2.3.3 to
3.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/jonasbb/serde_with/releases">serde_with's
releases</a>.</em></p>
<blockquote>
<h2>serde_with v3.7.0</h2>
<h3>Added</h3>
<ul>
<li>Implement <code>JsonSchemaAs</code> for <code>EnumMap</code> by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/697">#697</a>)</li>
<li>Implement <code>JsonSchemaAs</code> for
<code>IfIsHumanReadable</code> by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/717">#717</a>)</li>
<li>Implement <code>JsonSchemaAs</code> for <code>KeyValueMap</code> by
<a href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/713">#713</a>)</li>
<li>Implement <code>JsonSchemaAs</code> for <code>OneOrMany</code> by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/719">#719</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Detect conflicting <code>schema_with</code> attributes on fields
with <code>schemars</code> annotations by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/715">#715</a>)
This extends the existing avoidance mechanism to a new variant fixing <a
href="https://redirect.github.com/jonasbb/serde_with/issues/712">#712</a>.</li>
</ul>
<h2>serde_with v3.6.1</h2>
<h3>Changed</h3>
<ul>
<li>Eliminate dependency on serde's &quot;derive&quot; feature by <a
href="https://github.com/dtolnay"><code>@​dtolnay</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/694">#694</a>)
This allows parallel compilation of <code>serde</code> and
<code>serde_derive</code> which can speed up the wallclock time.
It requires that downstream crates do not use the &quot;derive&quot;
feature either.</li>
</ul>
<h2>serde_with v3.6.0</h2>
<h3>Added</h3>
<ul>
<li>Add <code>IfIsHumanReadable</code> for conditional implementation by
<a href="https://github.com/irriden"><code>@​irriden</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/690">#690</a>)
Used to specify different transformations for text-based and binary
formats.</li>
<li>Add more <code>JsonSchemaAs</code> impls for all
<code>Duration*</code> and <code>Timestamp*</code> adaptors by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/685">#685</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Bump MSRV to 1.65, since that is required for the <code>regex</code>
dependency.</li>
</ul>
<h2>serde_with v3.5.1</h2>
<h3>Fixed</h3>
<ul>
<li>The <code>serde_as</code> macro now better detects existing
<code>schemars</code> attributes on fields and incorporates them by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/682">#682</a>)
This avoids errors on existing <code>#[schemars(with = ...)]</code>
annotations.</li>
</ul>
<h2>serde_with v3.5.0</h2>
<h3>Added</h3>
<ul>
<li>Support for <code>schemars</code> integration added by <a
href="https://github.com/swlynch99"><code>@​swlynch99</code></a> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/666">#666</a>)
The support uses a new <code>Schema</code> top-level item which
implements <code>JsonSchema</code>
The <code>serde_as</code> macro can now detect <code>schemars</code>
usage and emits matching annotations for all fields with
<code>serde_as</code> attribute.
Many types of this crate come already with support for the
<code>schemars</code>, but support is not complete and will be extended
over time.</li>
</ul>
<h2>serde_with v3.4.0</h2>
<ul>
<li>
<p>Lower minimum required serde version to 1.0.152 (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/653">#653</a>)
Thanks to <a href="https://github.com/banool"><code>@​banool</code></a>
for submitting the PR.</p>
<p>This allows people that have a problem with 1.0.153 to still use
<code>serde_with</code>.</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bcda3fa3ff"><code>bcda3fa</code></a>
Bump version to 3.7.0 (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/720">#720</a>)</li>
<li><a
href="a446da1e12"><code>a446da1</code></a>
Bump version to 3.7.0</li>
<li><a
href="7e9772ff1e"><code>7e9772f</code></a>
Implement <code>JsonSchemaAs</code> for <code>OneOrMany</code> (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/719">#719</a>)</li>
<li><a
href="5e360837b0"><code>5e36083</code></a>
Add impls and tests for OneOrMany</li>
<li><a
href="c5c35db655"><code>c5c35db</code></a>
Implement JsonSchemaAs for KeyValueMap (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/713">#713</a>)</li>
<li><a
href="046f820610"><code>046f820</code></a>
Bump the github-actions group with 1 update (<a
href="https://redirect.github.com/jonasbb/serde_with/issues/718">#718</a>)</li>
<li><a
href="7e87fe5632"><code>7e87fe5</code></a>
Bump the github-actions group with 1 update</li>
<li><a
href="ffade779c5"><code>ffade77</code></a>
Add <code>JsonSchemaAs</code> impl for <code>IfIsHumanReadable</code>
(<a
href="https://redirect.github.com/jonasbb/serde_with/issues/717">#717</a>)</li>
<li><a
href="bb2ab60a3a"><code>bb2ab60</code></a>
Add JsonSchemaAs impl for IfIsHumanReadable</li>
<li><a
href="a80425783f"><code>a804257</code></a>
Implement JsonSchemaAs for KeyValueMap</li>
<li>Additional commits viewable in <a
href="https://github.com/jonasbb/serde_with/compare/v2.3.3...v3.7.0">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_with&package-manager=cargo&previous-version=2.3.3&new-version=3.7.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>
V3_GIT_ORIGIN_REV_ID: 1db291014bc664f7e9d46c8f187989994980ea85
2024-03-20 14:26:14 +00:00
Philip Lykke Carlsen
631df50fb8 Reference correct folder for auth hook (#375)
## Description

The `just dev` command had ceased to work because the path to the auth
hook dockerfile had changed with the move to the `crates/` folder.

V3_GIT_ORIGIN_REV_ID: 52c21e41ff39125daeffb7e1a8e5b77664617d7b
2024-03-20 13:45:38 +00:00
Rakesh Emmadi
ce1d0d23e3 Deny unknown fields while deserializing Deprecated (#374)
Add `serde(deny_unknown_fields)` attribute for `Deprecated` struct. In
v3-metadata-build-service, there's a test to ensure no arbitrary
additional properties exists for any schema definition except
`JWTClaimsMap` struct. It actually caught the missing
`deny_unknown_fields` attribute for `Deprecated` struct. This PR also
includes the same test to catch such misses in the future.

V3_GIT_ORIGIN_REV_ID: 2c0a9d2efcd76946885f2e54a364a388e80c283b
2024-03-20 12:25:38 +00:00
dependabot[bot]
596a5db1a0 Bump bson from 2.7.0 to 2.9.0 (#368)
Bumps [bson](https://github.com/mongodb/bson-rust) from 2.7.0 to 2.9.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.9.0</h2>
<p>The MongoDB Rust driver team is pleased to announce the v2.9.0
release of the <code>bson</code> crate.</p>
<h2>Highlighted Changes</h2>
<p>This release adds several externally contributed improvements!</p>
<ul>
<li>A new <code>RawIter</code> type that iterates over elements in a
document without deserializing them,</li>
<li>An improvement to the <code>doc</code> and <code>bson</code> macros
(and their <code>raw</code> counterparts) that allows using types that
implement <code>Into&lt;Bson&gt;</code> or
<code>Into&lt;RawBson&gt;</code>,</li>
<li>An impl of <code>From&lt;&amp;mut T&gt;</code> for <code>Bson</code>
for types that implement <code>Into&lt;Bson&gt;</code>,</li>
<li>A smaller dependency tree thanks to updating the indexmap
crate,</li>
<li>And a fix for the <code>serde_with</code> 3.x support for the
<code>Uuid</code> type.</li>
</ul>
<h2>Full Release Notes</h2>
<h2>New Features</h2>
<ul>
<li>RUST-1815 provide lazy iterator implementation (thanks <a
href="https://github.com/tychoish"><code>@​tychoish</code></a>!)</li>
<li>RUST-1716 Add BSON Binary Data subtype Sensitive (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/454">#454</a>)</li>
</ul>
<h2>Improvements</h2>
<ul>
<li>RUST-1822 Allow using the {,raw}{bson,doc} with types implementing
Into<!-- raw HTML omitted --> (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/450">#450</a>)
(thanks <a
href="https://github.com/tyilo"><code>@​tyilo</code></a>!)</li>
<li>RUST-1825 Implement From<!-- raw HTML omitted --> for Bson (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/452">#452</a>)
(thanks <a
href="https://github.com/tyilo"><code>@​tyilo</code></a>!)</li>
<li>RUST-1814 minor: bump indexmap to 2.1.0 (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/448">#448</a>)
(thanks <a
href="https://github.com/froydnj"><code>@​froydnj</code></a>!)</li>
</ul>
<h2>Bugfixes</h2>
<ul>
<li>RUST-1828 Fix feature name for serde_with Uuid implementation (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/453">#453</a>)
(thanks <a
href="https://github.com/jonasbb"><code>@​jonasbb</code></a>!)</li>
</ul>
<h2>v2.8.1</h2>
<p>The MongoDB Rust driver team is pleased to announce the v2.8.1
release of the <code>bson</code> crate.</p>
<h2>Highlighted Changes</h2>
<p>This release fixes compilation for the <code>wasm32-wasi</code>
target, which broke in the 2.8.0 release.</p>
<h2>Full Release Notes</h2>
<h2>Bugfixes</h2>
<ul>
<li>Fix compilation on wasm32-wasi target <a
href="https://redirect.github.com/mongodb/bson-rust/issues/445">#445</a>
(thanks <a
href="https://github.com/tyranron"><code>@​tyranron</code></a>!)</li>
</ul>
<h2>v2.8.0</h2>
<p>The MongoDB Rust driver team is pleased to announce the v2.8.0
release of the <code>bson</code> crate.</p>
<h2>Highlighted Changes</h2>
<p>This release adds optimizations to the <code>serde</code> integration
that show up to 50% deserialization speed improvement in our benchmarks,
as well as a variety of user-submitted fixes.</p>
<h2>Full Release Notes</h2>
<h2>Improvements</h2>
<ul>
<li>RUST-1132 Implement DeserializeSeed for owned and borrowed raw
documents (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/433">#433</a>)</li>
<li>RUST-1780 Bump MSRV to 1.61.0, upgrade ahash to 0.8.5 in
<code>Cargo.lock.msrv</code> (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/436">#436</a>)
(thanks <a
href="https://github.com/stIncMale"><code>@​stIncMale</code></a>!)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="38ffff5343"><code>38ffff5</code></a>
release v2.9.0 (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/455">#455</a>)</li>
<li><a
href="230dab13f5"><code>230dab1</code></a>
RUST-1716 Add BSON Binary Data subtype Sensitive (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/454">#454</a>)</li>
<li><a
href="81a9895089"><code>81a9895</code></a>
Fix feature name for serde_with Uuid implementation (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/453">#453</a>)</li>
<li><a
href="8247d271b2"><code>8247d27</code></a>
Implement From&lt;&amp;mut T&gt; for Bson (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/452">#452</a>)</li>
<li><a
href="622007da1d"><code>622007d</code></a>
minor: update clippy to 1.75 (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/451">#451</a>)</li>
<li><a
href="7e114303ae"><code>7e11430</code></a>
Allow using the {,raw}{bson,doc} with types implementing
Into&lt;{,Raw}Bson&gt; (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/450">#450</a>)</li>
<li><a
href="9294ee5b45"><code>9294ee5</code></a>
provide lazy iterator implementation (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/449">#449</a>)</li>
<li><a
href="d044889a9f"><code>d044889</code></a>
minor: bump indexmap to <code>2.1.0</code> (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/448">#448</a>)</li>
<li><a
href="4af5805248"><code>4af5805</code></a>
Fix compilation on <code>wasm32-wasi</code> target (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/445">#445</a>)</li>
<li><a
href="6981c342c7"><code>6981c34</code></a>
release v2.8.0 (<a
href="https://redirect.github.com/mongodb/bson-rust/issues/443">#443</a>)
(<a
href="https://redirect.github.com/mongodb/bson-rust/issues/444">#444</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/mongodb/bson-rust/compare/v2.7.0...v2.9.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.7.0&new-version=2.9.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>
V3_GIT_ORIGIN_REV_ID: 8e483de7788695902efdfbb2c9fe0b9b185b4bf7
2024-03-20 12:04:53 +00:00
dependabot[bot]
2898a0dbe6 Bump openssl from 0.10.60 to 0.10.64 (#370)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.60
to 0.10.64.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sfackler/rust-openssl/releases">openssl's
releases</a>.</em></p>
<blockquote>
<h2>openssl-v0.10.64</h2>
<h2>What's Changed</h2>
<ul>
<li>Make _STACK opaque for LibreSSL &gt;= 3.9.0 by <a
href="https://github.com/botovq"><code>@​botovq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2153">sfackler/rust-openssl#2153</a></li>
<li>enable x509 verify and groups list for boringssl by <a
href="https://github.com/zh-jq"><code>@​zh-jq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2155">sfackler/rust-openssl#2155</a></li>
<li>Cleanup some not-required Path::new invocations by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2158">sfackler/rust-openssl#2158</a></li>
<li>fixed a clippy (nightly) warning by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2161">sfackler/rust-openssl#2161</a></li>
<li>Bump actions versions by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2162">sfackler/rust-openssl#2162</a></li>
<li>Add support for setting the nonce type and digest on a PKEY_CTX by
<a href="https://github.com/facutuesca"><code>@​facutuesca</code></a> in
<a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2144">sfackler/rust-openssl#2144</a></li>
<li>rebuild openssl-sys if the underlying openssl has changed by <a
href="https://github.com/reaperhulk"><code>@​reaperhulk</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2157">sfackler/rust-openssl#2157</a></li>
<li>Added binding for EVP_default_properties_enable_fips by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2168">sfackler/rust-openssl#2168</a></li>
<li>LibreSSL 3.9: fix CRYPTO_malloc/free signatures by <a
href="https://github.com/botovq"><code>@​botovq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2170">sfackler/rust-openssl#2170</a></li>
<li>Expose alias on X509 structs by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2167">sfackler/rust-openssl#2167</a></li>
<li>bump openssl and openssl-sys + changelogs by <a
href="https://github.com/reaperhulk"><code>@​reaperhulk</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2175">sfackler/rust-openssl#2175</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...openssl-v0.10.64">https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...openssl-v0.10.64</a></p>
<h2>openssl-v0.10.63</h2>
<h2>What's Changed</h2>
<ul>
<li>Allow passing a passphrase callback when loading a public key by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2135">sfackler/rust-openssl#2135</a></li>
<li>Expose several additional ciphers for symmetry with symm by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2140">sfackler/rust-openssl#2140</a></li>
<li>brew: add openssl@3.0 (for 3.0.x LTS releases) by <a
href="https://github.com/chenrui333"><code>@​chenrui333</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2141">sfackler/rust-openssl#2141</a></li>
<li>Add PKey::from_dhx by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2142">sfackler/rust-openssl#2142</a></li>
<li>Make X509_PURPOSE opaque for LibreSSL &gt;= 3.9.0 by <a
href="https://github.com/botovq"><code>@​botovq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2145">sfackler/rust-openssl#2145</a></li>
<li>PEM parsing: check last error instead of first by <a
href="https://github.com/botovq"><code>@​botovq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2148">sfackler/rust-openssl#2148</a></li>
<li>Expose brainpool NIDs on libressl by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2150">sfackler/rust-openssl#2150</a></li>
<li>Add two methods to the PKCS7 API by <a
href="https://github.com/facutuesca"><code>@​facutuesca</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2111">sfackler/rust-openssl#2111</a></li>
<li>add more boringssl methods by <a
href="https://github.com/zh-jq"><code>@​zh-jq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2138">sfackler/rust-openssl#2138</a></li>
<li>Release openssl v0.10.63 and openssl-sys v0.9.99 by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2152">sfackler/rust-openssl#2152</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.62...openssl-v0.10.63">https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.62...openssl-v0.10.63</a></p>
<h2>openssl-v0.10.62</h2>
<h2>What's Changed</h2>
<ul>
<li>fixes <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2119">#2119</a>
-- use ErrorStack abstraction in X.509 error handling by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2120">sfackler/rust-openssl#2120</a></li>
<li>Fix building with latest BoringSSL by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2121">sfackler/rust-openssl#2121</a></li>
<li>Fix tests on macOS by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2123">sfackler/rust-openssl#2123</a></li>
<li>Upcoming API changes in LibreSSL 3.9 by <a
href="https://github.com/botovq"><code>@​botovq</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2124">sfackler/rust-openssl#2124</a></li>
<li>Add <code>rand_priv_bytes</code> by <a
href="https://github.com/overvenus"><code>@​overvenus</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2126">sfackler/rust-openssl#2126</a></li>
<li>Add nid constant for curve brainpoolP320r1 by <a
href="https://github.com/nicklaswj"><code>@​nicklaswj</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2129">sfackler/rust-openssl#2129</a></li>
<li>Release openssl v0.10.62 and openssl-sys v0.9.98 by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2133">sfackler/rust-openssl#2133</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/overvenus"><code>@​overvenus</code></a>
made their first contribution in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2126">sfackler/rust-openssl#2126</a></li>
<li><a href="https://github.com/nicklaswj"><code>@​nicklaswj</code></a>
made their first contribution in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2129">sfackler/rust-openssl#2129</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.61...openssl-v0.10.62">https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.61...openssl-v0.10.62</a></p>
<h2>openssl v0.10.61</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4a19cd4825"><code>4a19cd4</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2175">#2175</a>
from reaperhulk/changelog</li>
<li><a
href="4e0e05a629"><code>4e0e05a</code></a>
bump openssl and openssl-sys + changelogs</li>
<li><a
href="c2b124aa2c"><code>c2b124a</code></a>
Be explicit that aliases are not part of X.509 certificates</li>
<li><a
href="1abf4a5b79"><code>1abf4a5</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2167">#2167</a>
from alex/expose-alias</li>
<li><a
href="a644ec2542"><code>a644ec2</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2170">#2170</a>
from botovq/crypto-free</li>
<li><a
href="83940d14e3"><code>83940d1</code></a>
LibreSSL 3.9: fix CRYPTO_malloc/free signatures</li>
<li><a
href="51fc569482"><code>51fc569</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2168">#2168</a>
from sfackler/alex-patch-1</li>
<li><a
href="3c53dee153"><code>3c53dee</code></a>
Added binding for EVP_default_properties_enable_fips</li>
<li><a
href="a12abe1b92"><code>a12abe1</code></a>
Expose alias on X509 structs</li>
<li><a
href="3acf2eff0b"><code>3acf2ef</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2157">#2157</a>
from reaperhulk/rebuild-if-changed</li>
<li>Additional commits viewable in <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...openssl-v0.10.64">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=openssl&package-manager=cargo&previous-version=0.10.60&new-version=0.10.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>
V3_GIT_ORIGIN_REV_ID: 99b2df7f5f80c162d6e917f94cf0d545e31a2022
2024-03-20 11:38:46 +00:00
Rakesh Emmadi
1895e87e84 add deprecated config for opendd metadata (#372)
Add an optional `deprecated` key to the following OpenDD metadata
- Object type field definitions
- Model select unique and select many graphql API
- Command GraphQL API
- Relationship

The `deprecated` value is an object with an optional `reason` key.
```
"deprecated": {
  "reason": "Optional reason"
}
```
Produce `@deprecated` against GraphQL fields generated from
aforementioned OpenDD metadata using `deprecated` config.

V3_GIT_ORIGIN_REV_ID: b26fe8a8b62de24d04820578b8201d3ff8585375
2024-03-20 09:23:40 +00:00
Daniel Harvey
0b69370cc9 add support for argument presets in models (#348)
<!-- Thank you for submitting this PR! :) -->

## Description

Following on https://github.com/hasura/v3-engine/pull/340 (and stacked
on top of it, as such) - this adds preset arguments for models, allowing
hard coded values for different roles.

```yaml
kind: ModelPermissions
version: v1
definition:
  modelName: ActorsByMovie
  permissions:
  - role: admin
    select:
      filter:
      argumentPresets:
      - argument: movie_id
        value:
          literal: 3
```

<!--
  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 setting preset values for arguments on models, based on user's
role.

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

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

V3_GIT_ORIGIN_REV_ID: 7dd23bf78e92980384cb2b2e109305cdb42d1c0b
2024-03-20 08:42:02 +00:00
Daniel Harvey
bdd5d06437 Move all crates into a folder (#355)
<!-- Thank you for submitting this PR! :) -->

## Description

This moves all the crates into a `/crates` folder. Everything appears to
just work, thanks Cargo!

V3_GIT_ORIGIN_REV_ID: 8e3ef287b1a46cabdb4d919a50e813ab2cddf8b1
2024-03-19 18:07:14 +00:00
Tom Harding
0123fa339a Separate the query request tree and mutation request tree (#349)
## Description

Following on from #347, this PR separates "query requests" and "mutation
requests" at the level of the query plan, rather than the individual
fields. The result of this is that we can separate the functions to plan
and execute the two things entirely, which will make it easier in the
forthcoming PR to add support for transactions.

There's almost certainly some further refactoring that could be done
here, but I'm choosing to wait until transactions are in place before
getting too excited.

V3_GIT_ORIGIN_REV_ID: 849f4682cc01d3b9e44d2748e4cc34382c8547a7
2024-03-19 11:52:43 +00:00
Abhinav Gupta
7c7e50505f constraint allowed open dd identifier names (#356)
V3_GIT_ORIGIN_REV_ID: 66512df837ccd1b72cd39fd35979bdc8ce39de55
2024-03-18 20:28:35 +00:00
Samir Talwar
249b86b328 Improve the speed of test Docker builds. (#354)
V3_GIT_ORIGIN_REV_ID: a5229c4361bcd2de373fedb5d3ee43c9af75c556
2024-03-18 11:21:23 +00:00
Daniel Harvey
7e0f0bb1ab migrate build job to Github Actions (#352)
V3_GIT_ORIGIN_REV_ID: b26d1479508aeb9168459f0db82591f8995bb174
2024-03-15 17:24:02 +00:00
Daniel Harvey
ecee753d6f upgrade to use Rust 1.76 (#353)
V3_GIT_ORIGIN_REV_ID: fee5e0dbd617a71c7da0a3f588b83064c23df2af
2024-03-15 16:53:56 +00:00
Daniel Harvey
9b1920d6fa basic typechecker for preset argument values (#350)
V3_GIT_ORIGIN_REV_ID: 6dac85968ea599812db56568a9422657b5cf96f4
2024-03-15 13:25:11 +00:00
Daniel Harvey
681ce9dcae add just update-golden-files-local command (#351)
V3_GIT_ORIGIN_REV_ID: 428d47af17949396037e4942ddcb2267801e56dc
2024-03-15 13:06:16 +00:00
Daniel Harvey
c754f273eb add support for argument presets in commands (#340)
V3_GIT_ORIGIN_REV_ID: 9d7401e5c629040fda7824966588af7f39e4a14c
2024-03-15 11:00:24 +00:00
Puru Gupta
a86d2d0450 add support for async span with parent context (#341)
V3_GIT_ORIGIN_REV_ID: f24ff08407a4f00787dfb76a72f9de072b5a02a2
2024-03-15 09:26:30 +00:00
Tom Harding
ee225734f1 Run mutations sequentially (#347)
V3_GIT_ORIGIN_REV_ID: 805e0d008954617e85ad6e1688f8016a85748bb5
2024-03-13 12:27:18 +00:00
Daniel Harvey
797aa43080 run clippy in watch command (#346)
V3_GIT_ORIGIN_REV_ID: 2cf4796a45aa1acc0846ebd6293ccf218356b5bf
2024-03-13 11:14:54 +00:00
Rakesh Emmadi
1e91ac1f41 add a roundtrip test for metadata serialization (#343)
V3_GIT_ORIGIN_REV_ID: e6195bcd2fcdfa472ac40a11acf81938d7aa6205
2024-03-13 10:17:06 +00:00
paritosh-08
b44711aaa5 revert copy traces to stdout (38fd62f) (#345)
V3_GIT_ORIGIN_REV_ID: c9ee70e9201026378a96d1205a2a566c211230d1
2024-03-13 09:32:11 +00:00
Jesse Hallett
c50ad27037 update dev-auth-webhook lockfile (#344)
V3_GIT_ORIGIN_REV_ID: 279110b4bb1605baa36a2770e5ec0d1530944ed5
2024-03-13 08:25:10 +00:00
Daniel Harvey
6b283f7032 add just local-watch command (#339)
V3_GIT_ORIGIN_REV_ID: af7b9083fcde703010a6096d8db65ceade80f58c
2024-03-12 15:27:28 +00:00
Abhinav Gupta
8489a4b9b0 implement serialization for opendd types (#342)
V3_GIT_ORIGIN_REV_ID: e7bd868bf53e6960498c0ec764f9ee4f7ea70ff8
2024-03-12 03:01:19 +00:00
Anon Ray
441b81b96e add boolean expression types to the metadata (#331)
Co-authored-by: Abhinav Gupta <abhinav@hasura.io>
Co-authored-by: Abhinav Gupta <127770473+abhinav-hasura@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 86e90978132e9e87c4c20ec25902be11ffb0a56c
2024-03-12 00:29:28 +00:00
Rakesh Emmadi
f5c9a6f291 Custom deserializer for OpenDd objects (#313)
V3_GIT_ORIGIN_REV_ID: 4c7a9380e517ac8e7ac1bd44dbe879918bd0d9a2
2024-03-11 12:17:50 +00:00
paritosh-08
c04ae5994c support input coercion (#325)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 7578b836c0491db1d1cbf5bf876b0ed5d1fc910e
2024-03-11 10:54:28 +00:00
Jesse Hallett
b255495378 copy traces to stdout (#327)
Outputs traces to stdout in addition to exporting via otlp. Stdout contains one JSON object per line, with a single span resource in each output line. This will make it quite a bit easier for me to get a quick look at what is going on in the engine during local development.

The first commit makes the change using the existing opentelemetry crate versions. The second commit upgrades the opentelemetry dependencies. I thought I would include that just because I went to the trouble of figuring out how to do that upgrade.

The JSON output is noisy, but can be formatted nicely with some shell functions. For example in nushell I use these functions to process the opentelemetry data coming via docker-compose or arion-compose log output:

```nu
# Get log output from arion/docker-compose services with JSON parsing. If an
# argument is given filters to logs from the given service
def logs [
  service?: string@docker_compose_services
  --file (-f): string = "./arion-compose.nix" # Use FILE instead of the default ./arion-compose.nix
] {
  let args = [$service] | compact
  let input = if ($file | path exists) {
    arion --file $file logs ...$args
  } else {
    docker-compose logs ...$args
  }
  $input
    | lines
    | parse -r '^(?<service>\S+)\s*\|\s*(?<log>.*)$'
    | where {|it| is_json $it.log}
    | update log {|it| $it.log | from json }
    | flatten
}

# Gets log output from a given docker-compose service, and extracts and formats
# relevant opentelemetry data
def otel [
  service: string@docker_compose_services
  --file (-f): string = "./arion-compose.nix" # Use FILE instead of the default ./arion-compose.nix
] {
  logs $service -f $file | get resourceSpans | each {|it| $it.scopeSpans.0.spans.0 | select name attributes status }
}

# Helper to provide autocompletion for inputs to the logs command
def docker_compose_services [] {
  let compose_file = if ("arion-compose.nix" | path exists) {
    arion cat | from json
  } else if ("docker-compose.yaml" | path exists) {
    open docker-compose.yaml
  } else {
    return []
  }
  $compose_file | get services | columns
}

# Helper for the logs command
def is_json [input: string] {
  ($input | from json | describe) =~ '^(record|table|list)'
}
```

V3_GIT_ORIGIN_REV_ID: 38fd62f321a363a52b03d661b66d4dd49ac922de
2024-03-07 21:26:50 +00:00
Gil Mizrahi
bb34a9ae66 Replace the nodejs dev-auth-webhook with a rust one to improve performance (#336)
Co-authored-by: Samir Talwar <samir@functional.computer>
V3_GIT_ORIGIN_REV_ID: 37eb6ad3fc93f4f9beca6568d60a581edca45a71
2024-03-07 14:18:25 +00:00
Samir Talwar
f869e7a8af Use ndc-spec v0.1.0. (#337)
V3_GIT_ORIGIN_REV_ID: ef97a6a0692e7c0741de96f0848d414d9b172106
2024-03-07 13:19:55 +00:00
Jesse Hallett
a7ccadbcd9 listen for sigterm to avoid 10-second shutdown delay (#328)
V3_GIT_ORIGIN_REV_ID: c2a1eb358d139df6234730851beadfff30f29f16
2024-03-07 00:24:22 +00:00
Samir Talwar
078b0d3487 Get the Nix build working. (#335)
V3_GIT_ORIGIN_REV_ID: e70e2a42b2445b4bcf4e9ee7db771b475c32d2f9
2024-03-06 17:51:17 +00:00
Samir Talwar
dea588255b Set the crate properties once, to improve the Nix build. (#334)
V3_GIT_ORIGIN_REV_ID: ec5f3d968306a64ad5c63df324ca5c524838c598
2024-03-06 17:15:13 +00:00
Daniel Harvey
353b0d1ca6 basic Nix flake for deps (#333)
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 013207c169f31db363b7cfb072570c5b8246ba60
2024-03-06 11:39:19 +00:00
Abhinav Gupta
f9a77428d0 [V3ENGINE-13] Fix NDC IR generation for functions / procedures (#330)
V3_GIT_ORIGIN_REV_ID: f579e9fb7a413adb24481bfc04feee7d661aa534
2024-02-29 05:30:27 +00:00
Samir Talwar
d21d8277c8 Stop publishing arm64 images. (#329)
Co-authored-by: Paritosh <paritosh@hasura.io>
V3_GIT_ORIGIN_REV_ID: d41a19cb58afb69843d7450d884d1e69b585fcfa
2024-02-27 10:36:02 +00:00
paritosh-08
5c9033a66a add health endpoint (#326)
V3_GIT_ORIGIN_REV_ID: c2868238d43045e65b30df4dff4bc909a4999a17
2024-02-27 09:15:29 +00:00
David Overton
64bb9c873d Nested selections (#255)
Co-authored-by: Abhinav Gupta <127770473+abhinav-hasura@users.noreply.github.com>
Co-authored-by: Brandon Martin <brandon@codedmart.com>
V3_GIT_ORIGIN_REV_ID: 4f4674c5bad551afa7ed718ae78c281b6f571a62
2024-02-23 19:11:10 +00:00
Abhinav Gupta
4f1276dac1 add a test for opendd object mapped to ndc scalar (#324)
V3_GIT_ORIGIN_REV_ID: 7972eda702c43c2a121c1333ae32c4252b1b44d2
2024-02-23 18:07:01 +00:00
Gil Mizrahi
8071b11194 fix relationship collection of filter and order by clauses (#323)
This fixes a bug with collection_relationships not being populated by relationships constructed from where and/or order by clauses.

We fix this by not only collecting relationships from field selection, but also considering relationships introduced by order by and where clauses.

V3_GIT_ORIGIN_REV_ID: c612ceed8b3831257ca2c7d23ec9ed23261efedf
2024-02-23 08:30:17 +00:00
paritosh-08
a351d3fa84 update ndc-spec to rc.18 (#316)
Co-authored-by: Daniel Chambers <daniel@hasura.io>
Co-authored-by: Abhinav Gupta <127770473+abhinav-hasura@users.noreply.github.com>
Co-authored-by: Abhinav Gupta <abhinav@hasura.io>
V3_GIT_ORIGIN_REV_ID: 0f36da2472c44a1e403bc2fa10ebbc377daeba0d
2024-02-21 12:23:41 +00:00
Abhinav Gupta
dfd2e940b1 Make schema field mandatory in ConnectorLink (#315)
V3_GIT_ORIGIN_REV_ID: 5d782bc8dec8630b5b63821b61ecec615f0ed47f
2024-02-05 23:11:45 +00:00
Abhinav Gupta
339cc34d06 [RFC] Boolean expression types in OpenDD (#311)
V3_GIT_ORIGIN_REV_ID: 73241ca9f4324d1978aaa1e64426fa1a642a3b1f
2024-02-05 22:01:02 +00:00
Abhinav Gupta
6581657f8b Improve schema / capabilities structure in ConnectorLink (#314)
V3_GIT_ORIGIN_REV_ID: 4a5b5d1870637461c2c4b7d50da80cf0ca74847b
2024-02-05 21:14:53 +00:00
Abhinav Gupta
19259546a9 rename asc / desc enum values to PascalCase (#310)
V3_GIT_ORIGIN_REV_ID: 57bda06f5ebb4640410edf4d2756a3a588609fab
2024-02-02 01:15:09 +00:00
pranshi06
d595fb6cd0 remove colored package as a dependency (#289)
V3_GIT_ORIGIN_REV_ID: d08536edec330a9fd5df009fcb5ddbb466e7d585
2024-02-01 10:28:16 +00:00
Naveen Naidu
12ff4fcd9c add all chinook tables to schema.json and fix doctests (#308)
V3_GIT_ORIGIN_REV_ID: c637690fae9debad793c17a5b9b4c55a8dfeb15d
2024-02-01 05:34:25 +00:00
Puru Gupta
c31844d383 Error fix for RelationshipTargetDoesNotSupportForEach (#309)
V3_GIT_ORIGIN_REV_ID: 1fb982ff3b84e6634d534d273823666e620ccc94
2024-01-31 13:39:38 +00:00
Puru Gupta
71b10cf2bf changes for improved DX workflow (#304)
V3_GIT_ORIGIN_REV_ID: 28cc0ba50508778f1464ed90dbeb1ba94ab9170e
2024-01-31 12:51:52 +00:00
Karthikeyan Chinnakonda
f65d67bd10 Change order_by to accept a list (#298)
V3_GIT_ORIGIN_REV_ID: 603f6ae4ab8c6505a5484d6b71042b0a7e5aaa8c
2024-01-31 09:51:17 +00:00
Anon Ray
486249902a add remote joins docs (#303)
V3_GIT_ORIGIN_REV_ID: f107422751293f1b3cd6d9eb00a19d58a3409a12
2024-01-31 07:38:57 +00:00
Brandon Simmons
6c83ec7985 lang-graphql: add parser tests (#290)
Co-authored-by: Abhinav Gupta <127770473+abhinav-hasura@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: d7b70a3cc70e6b9ead5867fd4b4fc56809878ebd
2024-01-30 17:42:44 +00:00
Samir Talwar
82df77cd8e Remove SSH from Docker builds. (#305)
V3_GIT_ORIGIN_REV_ID: 832619b36c18ccdfbabacb44c4af4098bf296e2a
2024-01-30 13:03:51 +00:00
Naveen Naidu
56828db682 Metadata configuration for global field/type names (#199)
V3_GIT_ORIGIN_REV_ID: e1f756a53bbbce722032df4f9b44f33473a09a1f
2024-01-30 12:33:17 +00:00
pranshi06
5fce5c04f1 allow adding descriptions to schema (#296)
Co-authored-by: Karthikeyan C <karthikeyan@hasura.io>
V3_GIT_ORIGIN_REV_ID: 4128ea54439d4035a449060f90b763400616f1d3
2024-01-30 10:16:32 +00:00
paritosh-08
1de78b0aa1 redact ndc explain in tests (#306)
V3_GIT_ORIGIN_REV_ID: 25dce47edf92eb2c37af3865de42ddab354e7201
2024-01-30 09:18:30 +00:00
Anon Ray
bd19e2248b gardening: fix formatting for rustdoc (#302)
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 02b2c7646c6cf1fcb10472a030abcb923a3f0bb4
2024-01-29 11:04:05 +00:00
Anon Ray
c71a4ccdd6 remove unused execution error types (#300)
V3_GIT_ORIGIN_REV_ID: 492940c66723b61fbb7af2a925e53d3f4b21e31e
2024-01-29 07:14:12 +00:00
paritosh-08
a0d30feab9 add ndc_explain to select node (#285)
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: e45510454fe299fb41690a8fb56bcdce7628cd67
2024-01-29 05:12:42 +00:00
Krushan Bauva
4bed94b01f use short commit SHA as version and mark non-release builds as dev (#295)
V3_GIT_ORIGIN_REV_ID: 78475725003cd57790361caa8659c7a7146eacf2
2024-01-25 08:54:21 +00:00
Naveen Naidu
761c2a3b3a add deserialization tests for resolved metadata (#301)
V3_GIT_ORIGIN_REV_ID: fde1d8f7d598758f434b09aaf922187a10761fd5
2024-01-24 08:04:42 +00:00
Naveen Naidu
2b8cbd0808 add deserialize_with for BTreeMap used in Relationship Annotation (#299)
V3_GIT_ORIGIN_REV_ID: e6ae398db7f9124a9fb4eb5ffa300b7dac82e03b
2024-01-24 05:58:40 +00:00