-
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
🐛 Source Github: Fix set up validation #5456
🐛 Source Github: Fix set up validation #5456
Conversation
/test connector=connectors/source-github
|
/test connector=connectors/source-github
|
organizations = list(filter(None, config.get("organization", "").split(" "))) | ||
repositories = list(filter(None, config.get("repository", "").split(" "))) |
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.
If user doesn't send the two field any change to print the exception? Because both will become a empty string and not a None value.
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.
@marcosmarxm Sorry, I didn't quite understand what you meant, could you reformulate it?
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.
@yevhenii-ldv we don't handle the case when both fields are empty. I think we should either handle this by schema (use oneOf) or in the code.
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.
also about repo/org usage, not sure which one will take precedence. Maybe it is better to use a single field and ask a user to use format:
<org>:<repo>
or simply <org>
(or <org>:*
)
i.e.
repositories = "airbyte:*,eugene:airbyte"
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.
@keu @marcosmarxm
Unfortunately, in order to maintain backward compatibility, the Sheriff and I made a decision that using oneOf
will not work in this case and it is necessary to check directly in the check
method, and not in the spec.json
.
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.
@keu As for Organizations
and Repositories
- now there have absolutely equal rights and we receive data for absolutely all repositories that we received using both fields.
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.
please use single field repositories
with the following format acceptable:
org/repo
- sync concrete repoorg/
- sync all repos from org
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.
@keu done
@@ -127,6 +127,8 @@ def read_records(self, stream_slice: Mapping[str, any] = None, **kwargs) -> Iter | |||
# For private repositories `Teams` stream is not available and we get "404 Client Error: Not Found for | |||
# url: https://api.github.com/orgs/sherifnada/teams?per_page=100" error. | |||
error_msg = f"Syncing `Team` stream isn't available for repository `{stream_slice['repository']}`." | |||
else: | |||
raise e |
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.
Can we have an additional information where this error is being thrown? Maybe
else:
logging.ERROR("Undefined error while reading records")
raise e
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.
Done
/test connector=connectors/source-github
|
/test connector=connectors/source-github
|
|
||
repositories_list = [] | ||
repositories_list = [repo for repo in repositories if not re.match("^.*/\\*$", repo)] | ||
organizations = [org.split("/")[0] for org in repositories if org not in repositories_list] |
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.
Are we going to pull all repos from organization without the user request this? @yevhenii-ldv
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.
@marcosmarxm If the user specifies, for example, airbytehq/*
, this means that he wants to pull all the repositories for this organization.
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.
btw, there is no unit_test for this? would be amazing to have a test mocking this function.
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.
LGTM, but this private functions must have functions
/publish connector=connectors/source-github
|
/publish connector=connectors/source-github
|
What
closes #5434.
How
Describe the solution
Recommended reading order
x.java
y.python
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
docs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes