这是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

Conversation

hallettj
Copy link
Collaborator

@hallettj hallettj commented Mar 7, 2025

Previously running introspection would not update existing schema definitions, it would only add definitions for newly-added collections. This PR 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. Fields that appear to have been added to collections will not be removed from configurations.

I included output that shows any detected database changes that were not applied to configuration. Here's what that looks like:

Warning: introspection detected some changes to to database thate were **not** applied to existing
schema configurations. To avoid accidental breaking changes the introspection system is
conservative about what changes are applied automatically.

To apply changes delete the schema configuration files you want updated, and run introspection
again; or edit the files directly.

These database changes were **not** applied:

app/connector/test_cases/schema/uuids.json:
 {
   objectTypes: {
     uuids: {
       fields: {
         uuid: {
           type: {
-            scalar: "uuid"
+            scalar: "binData"
           }
         }
       }
     }
   }
 }

eprintln!("Warning: introspection detected some changes to to database thate were **not** applied to existing
schema configurations. To avoid accidental breaking changes the introspection system is
conservative about what changes are applied automatically.");
eprintln!();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all extremely explicit about what is going on, which is excellent.

hallettj and others added 3 commits March 10, 2025 09:37
Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
@hallettj hallettj merged commit 9c7b131 into v1 Mar 10, 2025
2 checks passed
@hallettj hallettj deleted the jessehallett/eng-965-connector-introspection-enhancements branch March 10, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants