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

Source GitHub: Add more streams #5483

Closed
wants to merge 12 commits into from

Conversation

cjwooo
Copy link
Contributor

@cjwooo cjwooo commented Aug 17, 2021

What

Adds the following streams:

  • Organizations
  • Repositories
  • Users
  • Review Comments
  • Tags
  • Branches
  • Pull Request Stats (for values not returned by the Github "ListPullRequests" endpoint)

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions
  • Connector added to connector index like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Connector Generator

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -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
  • Documentation which references the generator is updated as needed.

@github-actions github-actions bot added the area/connectors Connector related issues label Aug 17, 2021
@cjwooo cjwooo marked this pull request as ready for review August 17, 2021 23:51
@cjwooo cjwooo marked this pull request as draft August 17, 2021 23:52
@cjwooo
Copy link
Contributor Author

cjwooo commented Aug 18, 2021

/test connector=connectors/source-github

@marcosmarxm
Copy link
Member

thanks @cjwooo the test only work for forks created from master branch. This PR is ready to review and test?

@marcosmarxm marcosmarxm self-assigned this Aug 18, 2021
@cjwooo cjwooo changed the title Add Organizations stream to Github Source Source GitHub: Add more streams Aug 18, 2021
@cjwooo cjwooo marked this pull request as ready for review August 19, 2021 00:40
@cjwooo
Copy link
Contributor Author

cjwooo commented Aug 19, 2021

@marcosmarxm It is now ready for review. Is it possible for you to share which repository Github Actions run the source acceptance test for the Github Source on? Is it a public repo?

# Below are full refresh streams
def stream_slices(self, **kwargs) -> Iterable[Optional[Mapping[str, Any]]]:
for stream_slice in super().stream_slices(**kwargs):
pull_requests_stream = PullRequests(authenticator=self.authenticator, repositories=[stream_slice["repository"]], start_date="")
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 based this off the Reviews stream. Would it be beneficial for both streams to pass the config's start_date to reduce the number of API calls these streams make?

Copy link
Contributor

Choose a reason for hiding this comment

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

To reduce the number of requests for Pull Refresh Stream, we use caching (vcr library)

@yevhenii-ldv
Copy link
Contributor

Hello, @cjwooo
I looked at your PR and it looks very nice, today I will pull this branch for myself locally for running tests and local testing, and I will tell you about results.

@yevhenii-ldv
Copy link
Contributor

yevhenii-ldv commented Aug 31, 2021

@cjwooo I created a new PR based on yours (to be able to run tests), made a couple of small updates, merged the origin/master branch into cwu/github-org-stream and resolved conflicts, and ran the tests, everything went fine.
Unfortunately, it will not work to add you as a reviewer of this PR, but you are participant.

@cjwooo
Copy link
Contributor Author

cjwooo commented Aug 31, 2021

Thanks for doing that @yevhenii-ldv !

@yevhenii-ldv
Copy link
Contributor

Merged as #5757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants