-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
metadata: fix tests not running, fix failing non-running tests, fix validate base images exist #33127
Merged
Merged
metadata: fix tests not running, fix failing non-running tests, fix validate base images exist #33127
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
349721c
add debugging info
erohmensing 88debfe
fix invalid data fixture and assert that our fixtures have contents
erohmensing a5821f6
fix debugging expected errors
erohmensing d18fef1
add 2 tests and fix one which didn't represent what the filename indi…
erohmensing 89bc218
fix incorrect arg name
erohmensing 75a09b1
fix incorrect property name
erohmensing 2250e1f
add more clarity
erohmensing e695919
clarify even more
erohmensing 2bc38c0
use correct path to retrieve base image
erohmensing 483da70
fix stub
erohmensing 0a67bc0
add retries to the regular docker hub checks. why the hell not
erohmensing 367ca98
fix stub for base images
erohmensing fe76b12
fix base images for stubbing
erohmensing 0cc9dd3
mock dockerhub for valid files check
erohmensing 2f60529
move base image tests to validate, not upload. add new one for if the…
erohmensing a9b95cf
better error info if no GCS creds, and patch dockerhub in test_valida…
erohmensing 6e305de
Automated Commit - Formatting Changes
erohmensing 75590dc
remove redundant comment
erohmensing eafc72e
fix error messages for if validation succeeds when it shouldnt have
erohmensing 2a836f0
refactor the checking it failed correctly
erohmensing b513577
use pytest.fail
erohmensing 534c7e2
use better mock versions
erohmensing 2ecbbc7
assume shas are valid by default
erohmensing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,28 +7,45 @@ | |
|
||
def list_all_paths_in_fixture_directory(folder_name: str) -> List[str]: | ||
file_path = os.path.join(os.path.dirname(__file__), folder_name) | ||
|
||
# If folder_name has subdirectories, os.walk will return a list of tuples, | ||
# one for folder_name and one for each of its subdirectories. | ||
fixture_files = [] | ||
for root, dirs, files in os.walk(file_path): | ||
return [os.path.join(root, file_name) for file_name in files] | ||
fixture_files.extend(os.path.join(root, file_name) for file_name in files) | ||
return fixture_files | ||
Comment on lines
+10
to
+16
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 fixes an issue where cleaning up our fixtures by adding subdirectories actually led to no files being found for the fixture - we weren't looking in the subdirectories for files because we early returned after grabbing the (non-nested) files from the directory itself. |
||
|
||
|
||
@pytest.fixture(scope="session") | ||
def valid_metadata_yaml_files() -> List[str]: | ||
return list_all_paths_in_fixture_directory("metadata_validate/valid") | ||
files = list_all_paths_in_fixture_directory("metadata_validate/valid") | ||
if not files: | ||
pytest.fail("No files found in metadata_validate/valid") | ||
return files | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def invalid_metadata_yaml_files() -> List[str]: | ||
return list_all_paths_in_fixture_directory("metadata_validate/invalid") | ||
files = list_all_paths_in_fixture_directory("metadata_validate/invalid") | ||
if not files: | ||
pytest.fail("No files found in metadata_validate/invalid") | ||
return files | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def valid_metadata_upload_files() -> List[str]: | ||
return list_all_paths_in_fixture_directory("metadata_upload/valid") | ||
files = list_all_paths_in_fixture_directory("metadata_upload/valid") | ||
if not files: | ||
pytest.fail("No files found in metadata_upload/valid") | ||
return files | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def invalid_metadata_upload_files() -> List[str]: | ||
return list_all_paths_in_fixture_directory("metadata_upload/invalid") | ||
files = list_all_paths_in_fixture_directory("metadata_upload/invalid") | ||
if not files: | ||
pytest.fail("No files found in metadata_upload/invalid") | ||
return files | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
|
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
File renamed without changes.
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
File renamed without changes.
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
18 changes: 18 additions & 0 deletions
18
...s/fixtures/metadata_validate/invalid/metadata_breaking_change_versions_under_releases.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
metadataSpecVersion: 1.0 | ||
data: | ||
name: AlloyDB for PostgreSQL | ||
definitionId: 1fa90628-2b9e-11ed-a261-0242ac120002 | ||
connectorType: source | ||
dockerRepository: airbyte/image-exists-1 | ||
githubIssueLabel: source-alloydb-strict-encrypt | ||
dockerImageTag: 0.0.1 | ||
documentationUrl: https://docs.airbyte.com/integrations/sources/alloydb | ||
connectorSubtype: database | ||
releaseStage: generally_available | ||
license: MIT | ||
releasestests/fixtures/metadata_validate/invalid/metadata_breaking_change_versions_under_releases.yml: | ||
2.1.3: | ||
message: "This version changes the connector’s authentication method from `ApiKey` to `oAuth`, per the [API guide](https://amazon-sqs.com/api/someguide)." | ||
upgradeDeadline: 2023-08-22 | ||
tags: | ||
- language:java |
18 changes: 18 additions & 0 deletions
18
...tests/fixtures/metadata_validate/invalid/metadata_breaking_changes_not_under_releases.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
metadataSpecVersion: 1.0 | ||
data: | ||
name: AlloyDB for PostgreSQL | ||
definitionId: 1fa90628-2b9e-11ed-a261-0242ac120002 | ||
connectorType: source | ||
dockerRepository: airbyte/image-exists-1 | ||
githubIssueLabel: source-alloydb-strict-encrypt | ||
dockerImageTag: 0.0.1 | ||
documentationUrl: https://docs.airbyte.com/integrations/sources/alloydb | ||
connectorSubtype: database | ||
releaseStage: generally_available | ||
license: MIT | ||
breakingChanges: | ||
2.1.3: | ||
message: "This version changes the connector’s authentication method from `ApiKey` to `oAuth`, per the [API guide](https://amazon-sqs.com/api/someguide)." | ||
upgradeDeadline: 2023-08-22 | ||
tags: | ||
- language:java |
29 changes: 29 additions & 0 deletions
29
...rvice/lib/tests/fixtures/metadata_validate/invalid/metadata_invalid_base_image_no_sha.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
data: | ||
allowedHosts: | ||
hosts: | ||
- "*.googleapis.com" | ||
connectorBuildOptions: | ||
baseImage: docker.io/airbyte/base-repo-exists:1.1.0 | ||
connectorSubtype: file | ||
connectorType: source | ||
definitionId: 71607ba1-c0ac-4799-8049-7f4b90dd50f7 | ||
dockerImageTag: 0.3.7 | ||
dockerRepository: airbyte/source-google-sheets | ||
githubIssueLabel: source-google-sheets | ||
icon: google-sheets.svg | ||
license: Elv2 | ||
name: Google Sheets | ||
registries: | ||
cloud: | ||
enabled: true | ||
oss: | ||
enabled: true | ||
releaseStage: generally_available | ||
documentationUrl: https://docs.airbyte.com/integrations/sources/google-sheets | ||
tags: | ||
- language:python | ||
ab_internal: | ||
sl: 300 | ||
ql: 400 | ||
supportLevel: certified | ||
metadataSpecVersion: "1.0" |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗ this fixes the behavior of the validator - previously it wasn't checking the right tag. This means that we have not been running this validation, and should probably do a run on all connectors on this branch/after this is merged to make sure that no connectors currently reference invalid base images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! I don't think running full validation is necessary: if the value of this field is incorrect the connector build will fail, so we'd probably catch this error on publish failure anyway.