这是indexloc提供的服务,不要输入任何密码
Skip to content

introspection updates existing schemas to add fields only #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[advisories]
ignore = [
"RUSTSEC-2024-0437" # in protobuf via prometheus, but we're not using proto so it shouldn't be an issue
]
25 changes: 19 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ jobs:
- name: run linter checks with clippy 🔨
run: nix build .#checks.x86_64-linux.lint --print-build-logs

- name: update rust-sec advisory db before scanning for vulnerabilities
run: nix flake lock --update-input advisory-db

- name: audit for reported security problems 🔨
run: nix build .#checks.x86_64-linux.audit --print-build-logs

- name: run integration tests 📋
run: nix develop --command just test-mongodb-versions

audit:
name: Security Audit
runs-on: ubuntu-24.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4

- name: Link Cachix 🔌
uses: cachix/cachix-action@v12
with:
name: '${{ vars.CACHIX_CACHE_NAME }}'
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

- name: audit for reported security problems 🔨
run: nix develop --command cargo audit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
debug/
target/

.cargo/*
!.cargo/audit.toml

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,31 @@ This changelog documents the changes between release versions.

- Add uuid scalar type ([#148](https://github.com/hasura/ndc-mongodb/pull/148))

### Changed

- On database introspection newly-added collection fields will be added to existing schema configurations ([#152](https://github.com/hasura/ndc-mongodb/pull/152))

### Fixed

- Update dependencies to get fixes for reported security vulnerabilities ([#149](https://github.com/hasura/ndc-mongodb/pull/149))

#### Changes to database introspection

Previously running introspection would not update existing schema definitions, it would only add definitions for
newly-added collections. This release changes that behavior to make conservative changes to existing definitions:

- added fields, either top-level or nested, will be added to existing schema definitions
- types for fields that are already configured will **not** be changed automatically
- fields that appear to have been added to collections will **not** be removed from configurations

We take such a conservative approach to schema configuration changes because we want to avoid accidental breaking API
changes, and because schema configuration can be edited by hand, and we don't want to accidentally reverse such
modifications.

If you want to make type changes to fields that are already configured, or if you want to remove fields from schema
configuration you can either make those edits to schema configurations by hand, or you can delete schema files before
running introspection.

#### UUID scalar type

Previously UUID values would show up in GraphQL as `BinData`. BinData is a generalized BSON type for binary data. It
Expand Down
48 changes: 45 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum-iterator = "^2.0.0"
futures-util = "0.3.28"
indexmap = { workspace = true }
itertools = { workspace = true }
json-structural-diff = "^0.2.0"
ndc-models = { workspace = true }
nom = { version = "^7.1.3", optional = true }
nonempty = "^0.10.0"
Expand All @@ -35,7 +36,8 @@ tokio = { version = "1.36.0", features = ["full"] }
mongodb-agent-common = { path = "../mongodb-agent-common", features = ["test-helpers"] }

async-tempfile = "^0.6.0"
googletest = "^0.12.0"
googletest = "^0.13.0"
pretty_assertions = "1"
proptest = "1"
ndc-test-helpers = { path = "../ndc-test-helpers" }
test-helpers = { path = "../test-helpers" }
Loading