graphql-engine/v3/crates/open-dds/Cargo.toml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
916 B
TOML
Raw Normal View History

[package]
name = "open-dds"
version.workspace = true
edition.workspace = true
license.workspace = true
[lib]
bench = false
[dependencies]
Remove duplicate JSON Schema entries (#692) <!-- Thank you for submitting this PR! :) --> ## Description When we generate a JSON schema via `schemars`, we end up with duplicate types in the schema, which get names like `ValueExpression2`, `Role2`, and so on. This isn't ideal, and seems to arise for two reasons: 1. The type is polymorphic, and is monomorphised in two ways, and thus the types can't be unified. 2. The type is monomorphic, but is used inside and outside of its home module. The first problem was fixed previously by splitting polymorphic types, but the second has proven to be a bit more work. This PR finally solves the problem by introducing a new library, `jsonschema-tidying`: * First, we search the definitions within the JSON schema for any whose names end in a number, such as `ValueExpression2` or `MetadataV2`. * Then, we look for types whose names match everything up to the final numeric digits, and discard any types for whom we can't find a match (so we keep `ValueExpression2` because `ValueExpression` exists, but discard `MetadataV2` because `MetadataV` does not). * Next, we remove the duplicate definition from the definitions map, potentially breaking links in both the schema _and_ the rest of the definitions map. * Finally, we traverse the entirety of the tree looking for any references to the duplicate entry, and replace them with references to the original entry. This PR has no direct user-facing change, however it _will_ have an effect on the docs generation code, which will hopefully result in tidier documentation. <!-- Questions to consider answering: 1. What user-facing changes are being made? 4. What are issues related to this PR? (Consider adding `(close #<issue-no>)` to the PR title) 5. What is the conceptual design behind this PR? 6. How can this PR be tested/verified? 7. Does the PR have limitations? 8. 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 - [x] 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 --> _Replace with changelog entry_ <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: fe73acf7d9df0b9867852e673e53cb086e3725d3
2024-06-11 11:27:42 +03:00
jsonschema-tidying = { path = "../utils/jsonschema-tidying" }
opendds-derive = { path = "../utils/opendds-derive" }
derive_more = "0.99.17"
indexmap = { version = "2", features = ["serde"] }
lazy_static = "1.4.0"
Aggregates Root Field - Part 2: Metadata Resolve (#684) This is Part 2 in a stacked PR set that delivers aggregate root field support. * Part 1: OpenDD: https://github.com/hasura/v3-engine/pull/683 * Part 3: GraphQL API: https://github.com/hasura/v3-engine/pull/685 JIRA: [V3ENGINE-159](https://hasurahq.atlassian.net/browse/V3ENGINE-159) ## Description This PR implements the metadata resolve phase of the engine and adds support for resolving `AggregateExpression`s and validates their use when linked to a `Model`. The bulk of the changes can be found in: * `crates/metadata-resolve/src/stages/aggregates/*` - This is where the `AggregateExpression`s are resolved * `crates/metadata-resolve/src/stages/models/mod.rs` - This is where we validate the `AggregateExpression` specified for use in the model is actually compatible with the model and its data connector The `ndc-spec` version used has been lifted to the latest version that adds support for aggregates over nested objects (https://github.com/hasura/ndc-spec/pull/144). This necessitated changes in the Custom Connector, but actual functionality to implement aggregation over nested objects is implemented in Part 3. There are also some changes in `crates/metadata-resolve/src/types/subgraph.rs` where the `Display` trait for the various `Qualified<T>`, `QualifiedTypeReference`, etc types has been reworked so that they print more cleanly, with the subgraph being put outside the type syntax, and array types getting formatted correctly. For example, previous an array of Varchars would have printed as `Varchar (in subgraph default)!`, now it properly formats as `[Varchar!]! (in subgraph default)`. This was necessary to make useful error messages using these types. A tonne of tests have been added in `crates/engine/tests/validate_metadata_artifacts/aggregate_expressions` to test every error condition of the metadata resolve process. [V3ENGINE-159]: https://hasurahq.atlassian.net/browse/V3ENGINE-159?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ V3_GIT_ORIGIN_REV_ID: ffd859127a3f1560707f06ef01906c9d1b183d31
2024-06-12 11:29:38 +03:00
ndc-models = { git = "https://github.com/hasura/ndc-spec.git", rev = "aa8ad48e42aefd9e585a4c923bebfd56eee40204" }
ref-cast = "1.0"
Bump schemars from 0.8.19 to 0.8.20 (#592) Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.19 to 0.8.20. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/GREsau/schemars/releases">schemars's releases</a>.</em></p> <blockquote> <h2>v0.8.20</h2> <h3>Fixed:</h3> <ul> <li>Revert unintentional change in behaviour when combining <code>default</code> and <code>required</code> attributes (<a href="https://redirect.github.com/GREsau/schemars/issues/292">GREsau/schemars#292</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/GREsau/schemars/blob/master/CHANGELOG.md">schemars's changelog</a>.</em></p> <blockquote> <h2>[0.8.20] - 2024-05-18</h2> <h3>Fixed:</h3> <ul> <li>Revert unintentional change in behaviour when combining <code>default</code> and <code>required</code> attributes (<a href="https://redirect.github.com/GREsau/schemars/issues/292">GREsau/schemars#292</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/GREsau/schemars/commit/7ecaa7feabc2d7061bd61af78de3b64fdea00280"><code>7ecaa7f</code></a> Revert unintentional change in behaviour when combining <code>default</code> and `requir...</li> <li><a href="https://github.com/GREsau/schemars/commit/cf5be1b266add95212bdcec8fecd8c330a119558"><code>cf5be1b</code></a> Ignore failing test</li> <li><a href="https://github.com/GREsau/schemars/commit/449bb1a0ca64ddb549c95d8ebb5d210bebd187e8"><code>449bb1a</code></a> Add more tests for different schema settings</li> <li>See full diff in <a href="https://github.com/GREsau/schemars/compare/v0.8.19...v0.8.20">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=schemars&package-manager=cargo&previous-version=0.8.19&new-version=0.8.20)](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: 0a55128d53088b9b0c8c8f2dc5fb03de8af09413
2024-05-20 11:45:01 +03:00
schemars = { version = "0.8.20", features = ["smol_str", "preserve_order"] }
serde = "1.0.203"
serde_json = { version = "1.0.116", features = ["preserve_order"] }
serde_path_to_error = "0.1.14"
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 12:55:49 +03:00
strum = "0.26.2"
strum_macros = "0.26.3"
thiserror = "1.0"
[dev-dependencies]
goldenfile = "^1.7.1"
pretty_assertions = "1.3.0"
[package.metadata.cargo-machete]
ignored = [
"strum", # used by strum_macros
]
[lints]
workspace = true