-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
models: disable bindings using a boolean
This changes the representation of disabled capture and materialization bindings in Flow specs. We previously used `target: null` and `resource: null` to represent disabled capture and materialization bindings respctively. That change was introduced quite recently and has not seen any use yet. This commit changes both capture and materialization bindings to use `disabled: true`. Ultimately, the reason for this is to make it easier to programatically manipulate Flow specs. Say a user runs a discover of an existing capture via the UI. Afterward, the draft could contain a bunch of disabled bindings with `target: null` along with a corresponding collection for each disabled binding. The UI needs those collections so that it can make sure they're included in the draft if the user re-enables any of the disabled bindings. But the UI would have no idea how to match a disabled binding with its corresponding collection spec because the `target` is null. We'd have a similar problem in Flowctl. The output of a discover needs to somehow communicate the relationship between each binding and the collection that goes along with it. Rather than introduce a separate data structure containing these relationships, it seems preferable to just keep them within the specs themselves. This ends up being a simpler, it works the same for both captures and materializations, and seems a bit more obvious and clear. It also means that disabled capture bindings would be required to have a non-null `target`. The validation logic is skipped for bindings that are disabled, so disabled bindings can have _any_ collection name. It's a little awkward, but it seems preferable to the alternative of having a separate data structure containing the mappings from resources to collections.
- Loading branch information
Showing
15 changed files
with
69 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.