-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Migrations for scoped connectors #11305
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
Changes from 5 commits
6d8e58f
32a922d
d103d6d
f994786
596f79a
00670f9
3205407
da64b0d
a584e92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -34,6 +34,14 @@ properties: | |||||||||||||||||||||
if not set or false, the configuration is active. if true, then this | ||||||||||||||||||||||
configuration is permanently off. | ||||||||||||||||||||||
type: boolean | ||||||||||||||||||||||
public: | ||||||||||||||||||||||
description: true if this connector definition is available to all workspaces | ||||||||||||||||||||||
type: boolean | ||||||||||||||||||||||
default: false | ||||||||||||||||||||||
custom: | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from @michel-tricot in https://github.com/airbytehq/airbyte/pull/11339/files#r832831845
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's my take on what the possible combinations mean: Connector Definition
Originally, the plan was just to introduce the We need to clearly differentiate these private, opt-in connectors from user-uploaded custom connectors so that an instance admin doesn't accidentally grant a custom connector to a different customer. The data model doesn't currently support this differentiation, so we decided that adding a 'custom' boolean in addition to the 'public' boolean made sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup. It also seems possible that I do agree though that we should be wary of flag proliferation and the current states can be conveniently captured in a single enum as well. fyi the original discussion about whether to use an enum for this is here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cgardens fyi in case you want to weigh in, since you were part of the original discussion about boolean vs enum tradeoffs. I think the original resistance to an enum came from the fact that we'd be duplicating information that we can already glean from the However, this In general, I think conflating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with @pmossman 's comment. The original source_type enum (originated for billing purposes) was misleading. e.g. we had: api, file, db, custom in a single enum. One of these things is not like the others. Custom is a different concept from other enums and concepts we've discussed and having it be clearly separate makes that clear. Private / public are also totally disjoint concepts from the custom idea. Parker's table lays it out well (and we should probably integrate it into how we document the project). |
||||||||||||||||||||||
description: whether this is a custom connector definition | ||||||||||||||||||||||
type: boolean | ||||||||||||||||||||||
default: false | ||||||||||||||||||||||
releaseStage: | ||||||||||||||||||||||
type: string | ||||||||||||||||||||||
enum: | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,12 +52,15 @@ | |
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
import org.jooq.Condition; | ||
import org.jooq.DSLContext; | ||
import org.jooq.Field; | ||
import org.jooq.JSONB; | ||
import org.jooq.Record; | ||
import org.jooq.Record1; | ||
import org.jooq.Record2; | ||
import org.jooq.Result; | ||
import org.jooq.impl.DSL; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
@@ -778,4 +781,12 @@ public void loadDataNoSecrets(final ConfigPersistence seedPersistenceWithoutSecr | |
persistence.loadData(seedPersistenceWithoutSecrets); | ||
} | ||
|
||
private Condition includeTombstones(final Field<Boolean> tombstoneField, final boolean includeTombstones) { | ||
if (includeTombstones) { | ||
return DSL.trueCondition(); | ||
} else { | ||
return tombstoneField.eq(false); | ||
} | ||
} | ||
|
||
Comment on lines
+793
to
+800
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one doesn't fit in this PR thematically but I wanted to use this convenience method in multiple upcoming PRs |
||
} |
Uh oh!
There was an error while loading. Please reload this page.