Commit Graph

8437 Commits

Author SHA1 Message Date
paritosh-08
8389388d54 document unit of prometheus metrics
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10806
GitOrigin-RevId: 9358230950c0fe488e3fc14f93c1cea158066296
2024-05-13 12:21:50 +00:00
Rob Dominguez
b2c7c7ab57 Docs: Add missing env var and update performance tuning
[DOCS-2015]: https://hasurahq.atlassian.net/browse/DOCS-2015?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10796
GitOrigin-RevId: 1a03783abc4c77a6b95e58b84835cc61e1b40fe3
2024-05-13 11:46:43 +00:00
ashwiniag
a710454f9b ci: tag release v2.39.1
GitOrigin-RevId: 4bb72aee05ab6b7bd3af062e6f9eeab70f6b7f8d
2024-05-13 11:46:33 +00:00
Rikin Kachhia
b1c2998fc4 ci: update latest stable release as v2.39.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10809
GitOrigin-RevId: 09df4c35cffae8f1b11c16c5293805079141d85c
2024-05-13 11:46:22 +00:00
Anon Ray
7f166c3372 docs: add a para about random selection of read replicas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10807
GitOrigin-RevId: 986ccc2114e5dc4b67048091cc8358058b4a60e8
2024-05-13 11:46:11 +00:00
ashwiniag
d29be5ad19 catalog version v2.39.0 stable release
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10803
GitOrigin-RevId: 3e796592b4005aae444dc1e93aabb39d77ff5cd8
2024-05-13 11:46:00 +00:00
Anon Ray
516cbd59e8 docs: clarify we don't load balance across read replicas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10800
GitOrigin-RevId: 39da1b7d7de924a19b0671a5e03c70ccd95ab57b
2024-05-13 11:45:49 +00:00
Anon Ray
aa109ba331 fix: deregister relevant connection pool metrics when part of the source config is modified
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10786
GitOrigin-RevId: 6ba7a1db1df19453c59de3f41d0e0d9de93d3a8e
2024-05-13 11:45:38 +00:00
Rob Dominguez
a87de6e48c Docs: Update GitHub Deployment troubleshooting
[DOCS-1819]: https://hasurahq.atlassian.net/browse/DOCS-1819?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10794
GitOrigin-RevId: 2252d50734526a69f17d2db554fb7bcdd6646dd2
2024-05-13 11:45:28 +00:00
paritosh-08
25f92f379e add timeout for redis queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10788
GitOrigin-RevId: 7a18b077e106812703c73d57b70d9a7f10a7e8ac
2024-05-13 11:45:17 +00:00
Daniel Harvey
6710a5cf78 Replace HashMap / HashSet with BTreeMap / BTreeSet in metadata-resolve (#568)
<!-- Thank you for submitting this PR! :) -->

## Description

We're adding some tests that compare the output of metadata resolve.
Unfortunately, the results are nondeterministic because we use `HashMap`
/ `HashSet` in a lot of places. This replaces those uses with `BTreeMap`
and `BTreeSet` in `metadata-resolve`, and in a few places in `schema`
that rely on those types.

Some light reading around suggests that as well as giving us consistent
ordering, `BTree-` versions are better in terms of memory usage, esp
with < 1000 items (which I'm pretty sure most metadata items are)

https://www.reddit.com/r/rust/comments/xbkuc7/btreemap_vs_hashmap/
https://users.rust-lang.org/t/hashmap-vs-btreemap/13804/2
https://iq.opengenus.org/hashmap-and-btreemap-rust/

Functional no-op.

V3_GIT_ORIGIN_REV_ID: dbf49aefef0cd7084a3a37ef4fe9fc61257e1305
2024-05-13 11:04:35 +00:00
Daniel Harvey
0e2eb62874 Rename boolean_expression_type to object_boolean_expression_type (#567)
<!-- Thank you for submitting this PR! :) -->

## Description

There is about to be a separate thing called `boolean_expression_type`,
so let's have a nice time and make the two things explicitly different.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 0035e39a2ca8657a6ded5d5f0a4f284c3e72126d
2024-05-10 12:29:07 +00:00
Daniel Harvey
42b1a63484 Replace mutation in remote joins with more explicit return types (#566)
Found some of the remote join argument collection a little tricky to
follow, so changed it to be a little more explicit. It is still broken
for nested remote joins inside local ones, but at least is more explicit
about it's behaviour regarding returning joins.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 77d4717ee9d5effc1c08bcf5f4fbcf0af9f5d777
2024-05-10 12:29:01 +00:00
Philip Lykke Carlsen
c6513f6887 Add CORS layer last (#564)
## Description

This PR adds the CORS layer last, as it otherwise does not affect the
/metadata endpoint.

V3_GIT_ORIGIN_REV_ID: 77792d6bc35fe7e1df4191c834026f5c8a335bb3
2024-05-10 12:28:54 +00:00
Abhinav Gupta
5d1f9938e2 nest is_null and logical operator configuration in OpenDD expressions RFC (#562)
Tiny change to the RFC to allow for _is_null / _and / _or / _not field
renaming per-type in the future.

V3_GIT_ORIGIN_REV_ID: e090b300f804d72fe2127a5d769e12b89af44f7b
2024-05-10 12:28:48 +00:00
Rakesh Emmadi
f6ebaf345a enable CORS in engine server (#560)
<!-- Thank you for submitting this PR! :) -->

## Description

JIRA: https://hasurahq.atlassian.net/browse/V3ENGINE-135
Introduce an option to enable CORS in engine's single tenant server.
- `--enable-cors` CLI flag or `ENABLE_CORS=true` env var to support
preflight CORS request and include relevant headers in responses.
- `--cors-allow-origin` CLI option or `CORS_ALLOW_ORIGIN=` env var that
accepts comma-separated list of allowed origin domains.

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

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: d562cde28898416cfbfd00ffd97e7b668ff3c953
2024-05-10 12:28:41 +00:00
Samir Talwar
e6d1f5785e Avoid using the internals of schemars. (#561)
The internals of `schemars` has recently changed, removing
`schemars::_private::apply_metadata`. We should not be using this
function. I have rewritten the code to modify the metadata through the
public API instead.

I have not actually bumped the version of schemars in this change; we
can do that separately.

V3_GIT_ORIGIN_REV_ID: 84a7d39cbd586d8486ae18f47ddc0a51270b8628
2024-05-10 12:28:35 +00:00
Rakesh Emmadi
134f48a7f1 Contributing guide for error management in Rust (#554)
Add a document that lays down some recommendations around design and
usage or error types in Rust code.

V3_GIT_ORIGIN_REV_ID: 3b2489bf632c96abcac0cd0966a675aa1e15e1bc
2024-05-10 12:28:28 +00:00
Daniel Harvey
de342fb2bf Split schema into own crate (#556)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR splits the GraphQL schema generation into the `schema` crate.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 4f1a91387305d88e9b5fbe4bc8df0575292cf878
2024-05-10 12:28:22 +00:00
Daniel Harvey
35c58f0000 Use argument_mapping when resolving remote relationships to commands (#557)
<!-- Thank you for submitting this PR! :) -->

## Description

When trying to reproduce a remote relationships bug, I managed to find
this bug where remote relationships to commands ignore the argument
mappings. A command argument can be called one thing in the NDC itself
(ie, `id`), but we might want to expose it as `actor_id` in the engine
as that's nicer for the user. As we referred to everything with
`String`, we did not convert back to the NDC argument name when sending
information from a remote relationship, this PR fixes that.

We also add a `ConnectorArgumentName` newtype which replaces a bunch of
uses of `String`, and would have guided us towards not creating this bug
in the first place.

<!--
  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 to correctly use argument mappings when resolving remote
relationships to commands.

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

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

V3_GIT_ORIGIN_REV_ID: 2219e50d6cb28456e60c6794dc163d9b90573f8e
2024-05-10 12:28:15 +00:00
Anon Ray
1130e271c7 add some newtypes to remote_joins::types (#558)
## Description

Add some newtype wrappers around existing types in remote joins.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: dbd11eb30d48fc7aafd30604fc18e124d15b59ba
2024-05-10 12:28:08 +00:00
Daniel Harvey
afa93c6b35 Move utils into json_ext crate (#555)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to split the engine into smaller crates where possible, to
enforce boundaries better. The next step is splitting `schema`, but it
uses things in `engine/utils`. This splits those utils into a `json_ext`
package, as they all seem like JSON helpers.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 44d93a7346dc83194abaa46158be2b8401905bd0
2024-05-10 12:28:01 +00:00
Daniel Harvey
c5151fb3cb Resolve relationships in type predicates (#536)
<!-- Thank you for submitting this PR! :) -->

## Description

We have a separate copy of the code for resolving type predicates that
we use for object types (when resolving BooleanExpressions), because the
previous code was heavily tied to the Model it used. We'd like to unify
that code again, so the first step is re-implementing relationships in
`resolve_model_predicate_with_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)_

- [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 boolean expressions to use relationships

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

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

V3_GIT_ORIGIN_REV_ID: 6225a4ab752b71df3cdfd0982bf2107ca39f4940
2024-05-10 12:27:55 +00:00
Daniel Harvey
ce4dd596fb Add instructions for using the Nix Flake (#547)
<!-- Thank you for submitting this PR! :) -->

## Description

We maintain a Nix Flake for installing project dependencies but do not
advertise or explain it. Hopefully this fixes that.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: f1c5d471a5d1ffd5fa3ef31a471da7fcc44a935b
2024-05-10 12:27:48 +00:00
dependabot[bot]
085277491c Bump goldenfile from 1.6.0 to 1.7.1 (#552)
V3_GIT_ORIGIN_REV_ID: 68a37111246c8a923a9e881f5bb944b770b17d8c
2024-05-10 12:27:41 +00:00
dependabot[bot]
882b907235 Bump serde_json from 1.0.115 to 1.0.116 (#553)
V3_GIT_ORIGIN_REV_ID: 8ca39537cca63e86b1a350f484c351093418467f
2024-05-10 12:27:34 +00:00
dependabot[bot]
c5fc05b8c2 Bump serde_with from 2.3.3 to 3.8.1 (#549)
V3_GIT_ORIGIN_REV_ID: 73f08cd518591be471b8825dbb84d368c45f5f2c
2024-05-10 12:27:27 +00:00
dependabot[bot]
3188a61e60 Bump base64 from 0.22.0 to 0.22.1 (#551)
V3_GIT_ORIGIN_REV_ID: 5cebb181c8edd4dc539ce7166156cc9a2d6c47a4
2024-05-10 12:27:20 +00:00
dependabot[bot]
d0ea246d8d Bump async-recursion from 1.1.0 to 1.1.1 (#550)
V3_GIT_ORIGIN_REV_ID: cc078462ec7713139875b0991e86f670d81b7ae6
2024-05-10 12:27:13 +00:00
Abhinav Gupta
e891998ba2 RFC for OpenDD expression type changes (#511)
RFC for OpenDD expression type changes

Proposes many changes to scalar type comparison expressions, object
boolean expressions, and model order by expressions to be consistent and
robust to all possible object type structures.

[Rendered](https://github.com/hasura/v3-engine/blob/open_dd_expression_type_changes/rfcs/open-dd-expression-type-changes.md)

V3_GIT_ORIGIN_REV_ID: ac9134ac7713de087f07d08d39d9ca67ee6ef86f
2024-05-03 15:53:05 +00:00
Daniel Harvey
f6220cad37 Explicitly export types from schema module (#548)
<!-- Thank you for submitting this PR! :) -->

## Description

As per [similar changes in metadata
resolve](https://github.com/hasura/v3-engine/pull/527/files#diff-9c8df6114296efea5aa2e5bf31762d5b1db14165504cd15b96d5022551065921R1),
this makes the `schema` module explicitly export everything other
modules need. This means we should also be able to pull it into it's own
crate.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: a0840116d82316aa9e89a6e2197cef76e961f572
2024-05-03 14:20:18 +00:00
Daniel Harvey
aae750ae92 Remove Option from ModelWithPermissions (#529)
<!-- Thank you for submitting this PR! :) -->

## Description

Much as per https://github.com/hasura/v3-engine/pull/524 for
`CommandWithPermission`, this removes the `Option` from
`ModelWithPermissions`. Again, select permissions are opt-in, so
`Some(HashMap::new())` is the same as `None`, so we can remove this
layer of indirection, which I believe was only there because we were
building up the `Model` type incrementally.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fcb6479f32b001380ae24db6439e96339a868692
2024-05-03 13:20:31 +00:00
Gil Mizrahi
66990c0d91 use a newtype for data connector object type (#542)
## Description

Introduce a newtype for data connector object type for the added
context.

V3_GIT_ORIGIN_REV_ID: b499d3a9cd2610fec05a4bc2e1b3cf522f198b9c
2024-05-03 09:33:15 +00:00
Daniel Harvey
5fe266ca01 Boolean expressions in command argument presets (#539)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR enables boolean expressions in command argument presets. This
allows users to provide an expression to do things like "when the `user`
role runs the `deleteUser` command they can only delete users with `id`
== `x-hasura-user-id`".

It's up to the data connector to interpret the expression as it sees
fit.

<!--
  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 using boolean expressions in command arguments.

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

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

V3_GIT_ORIGIN_REV_ID: 302f62a266db9c090ba232fe9ab06db4953f38a6
2024-05-03 08:12:35 +00:00
Daniel Harvey
e3c0cb4e1a Use Postgres in readme (#546)
<!-- Thank you for submitting this PR! :) -->

## Description

The getting starting instructions for Docker don't work because they use
the reference agent sample metadata from `open-dds` crate. I managed to
get the metadata building but for some reason I get connection errors
when running the queries (cannot reach the reference agent).

I would like to investigate this further, but in the meantime, this
updates the readme to use the metadata from the tests, which should at
least get them up and running with a working GraphiQL / Jaeger.

V3_GIT_ORIGIN_REV_ID: d0dc81560a068b960104228f89ee7e7d483a58d9
2024-05-02 21:40:37 +00:00
Daniel Harvey
7dfb9d1a1f Build dev-auth-webhook Docker image with Nix (#544)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to speed up creation of all these Docker images, so this adds
`dev-auth-webhook` to the Nix flake. Functional no-op.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 384eb467b2fe7fba1644f5b4cc6224cdc043ce01
2024-05-02 14:23:28 +00:00
Samir Talwar
20514ab580 Remove unused Display implementations and fix a broken one. (#545)
There were multiple locations where we were implementing
`derive_more::Display` with a fixed format string, mostly of
`"Display"`. This means that the `to_string` implementations of those
types would just return `"Display"`, which is quite unhelpful.

In all cases but one, I was simply able to remove the implementation.

In the last case, `QualifiedTypeReference` had a broken implementation.
I replaced it with something more meaningful: the type name, followed by
a `"!"` if the type is non-nullable. `derive_more` was unable to help me
here so I implemented it the old-fashioned way. (I think replacing it
with an `enum` could also work.)

V3_GIT_ORIGIN_REV_ID: 35cf573d1efab2bba0707b248ae8b74bd535d0ed
2024-05-02 13:59:36 +00:00
Gil Mizrahi
690711ea1e add some code comments to resolved stage (#537)
## Description

Checking my understanding by documenting some stuff. Today it is
resolved/graphql_config, which lets us change the names of hasura
features in the syntax of the graphql.

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: a7053e610a1f310dfc9bab2a31e79e7b0e5110c3
2024-05-02 13:35:17 +00:00
hasura-bot
d896ad1552 docs: fix inherited role select permission example
GITHUB_PR_NUMBER: 10221
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/10221

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10787
Co-authored-by: Nick Amoscato <847532+namoscato@users.noreply.github.com>
GitOrigin-RevId: 55371f6050d20f3c5ca6c75d91998cd646216bf1
2024-05-02 12:55:04 +00:00
Daniel Harvey
11240e2bff Split metadata-resolve into own crate (#543)
<!-- Thank you for submitting this PR! :) -->

## Description

Now that metadata resolve has a clear interface with the rest of the
engine, let's take it out into it's own crate. This will make it easier
to maintain a strong boundary between things.

To simplify imports etc, removed nested layers of modules, so now we
import `use metadata_resolve::Qualified` instead of `use
crate::metadata::resolved::Qualified`.

The changes in `engine` crate are all just updating imports.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fb94304f7ed8883287c18bd6870045dfd69e3fe3
2024-05-02 12:29:22 +00:00
Daniel Harvey
3f74f2e93d Move annotation type back into metadata resolve (#540)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to split metadata resolve into it's own crate to enforce
module boundaries better. In doing so, discovered that it's using a type
from the later schema stage called `PredicateRelationshipAnnotation`,
which isn't really an annotation type at all, just a data structure for
a resolved predicate.

This moves that types back into metadata resolve, renaming it to
`PredicateRelationshipInfo`.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 5b37ca77fb4ddf17093277e6727360d6077c4e06
2024-05-02 09:17:41 +00:00
Gil Mizrahi
fbe6e1c263 add format step after update goldenfiles (#541)
## Description

When regenerating goldenfiles, all tests formatting go out of order.
This adds a subsequent formatting step afterwards.

V3_GIT_ORIGIN_REV_ID: 5cddd4cc4ec6c1d684b1841be9347f1fcaa3aade
2024-05-02 08:43:58 +00:00
Rakesh Emmadi
7944fdbe4e Refactor errors, and split execute and explain code path (#525)
The massive `Error` enum from `execute.rs` disintegrates into the
following independent error types.
- `RequestError`: All exceptions occurred before executing the root
field plans. Each variant in this error enum contains the error type
stemming from isolated steps in the pipeline involving parsing,
validation, IR conversion, and plan generation.
- `FieldError`: Exception occurred when resolving a field through its
plan. Multiple root fields are executed isolated, and field errors are
collected in a list.

Code paths for `explain` and `execute` query are split into two
functions. This is done to avoid few error variants and unburden the
function that previously does both.

V3_GIT_ORIGIN_REV_ID: 21f2f43ee4805a955fa0ce7d9b45c4b1902def63
2024-05-02 07:29:06 +00:00
Daniel Harvey
4f2a29b9cf rename data_connector_type_mappings stage to object_types (#533)
<!-- Thank you for submitting this PR! :) -->

## Description

We named this stage after the least interesting thing about it, this
resolves that.

`data_connector_type_mappings` -> `object_types`.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 67c94356cc7207e94eb3b696abbd32efe31551ac
2024-05-01 11:03:57 +00:00
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