Skip to content
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

loosen definition of object specs in SecretsHelper #6654

Merged
merged 8 commits into from
Oct 19, 2021

Conversation

jrhizor
Copy link
Contributor

@jrhizor jrhizor commented Oct 2, 2021

Postgres SSH keys aren't being handled properly by SecretsHelper test cases because it didn't specify that its type was an object in the spec. This adds a test case using the actual Postgres spec and fixes the behavior of SecretsHelpers (and also preemptively fixes a similar problem for array).

Before merging, we need to figure out how to migrate between the two again.

"title": "SSH Tunnel Method",
"description": "Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.",
"oneOf": [
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is where the problem was. It was expecting a "type": "object" here, which is missing. However, it isn't technically required by JSONSchema, so my implementation was wrong.

@jrhizor jrhizor temporarily deployed to more-secrets October 2, 2021 19:38 Inactive
@jrhizor jrhizor changed the title address missing SecretsHelper testcase loosen definition of object specs in SecretsHelper Oct 2, 2021
@jrhizor jrhizor requested a review from cgardens October 2, 2021 19:41
@jrhizor jrhizor mentioned this pull request Oct 4, 2021
14 tasks
Copy link
Contributor

@cgardens cgardens left a comment

Choose a reason for hiding this comment

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

is the preferred state that specs follow json schema more rigidly and always specify types? or is this a permanent loosening?

i think ideally we would lint specs and make them actual conforment jsonschema. so i'd vote for it being temporary. if we are going with temporary let's create a follow up issue.

@jrhizor
Copy link
Contributor Author

jrhizor commented Oct 4, 2021

I don't think this can be temporary. Technically not specifying type is an option in valid JSONSchema.

@jrhizor jrhizor temporarily deployed to more-secrets October 18, 2021 21:28 Inactive
final ConfigPersistence writeToPersistence = new FileSystemConfigPersistence(TEST_ROOT);
final SecretsMigration migration = new SecretsMigration(readFromPersistence, writeToPersistence, false);

final Database database = new ConfigsDatabaseInstance(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this to a production version in a separate PR

@jrhizor jrhizor temporarily deployed to more-secrets October 19, 2021 00:16 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 19, 2021 00:23 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 19, 2021 00:30 Inactive
@jrhizor jrhizor merged commit 41db058 into master Oct 19, 2021
@jrhizor jrhizor deleted the jrhizor/missing-secretshelper-case branch October 19, 2021 00:47
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* address missing secretshelper case

* fix test

* migration changes

* fix build

* format

* switch secrets migration to platform-only build
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.

4 participants