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 Jira: Add caching and more streams #6523

Merged
merged 9 commits into from
Oct 4, 2021

Conversation

cjwooo
Copy link
Contributor

@cjwooo cjwooo commented Sep 29, 2021

What

Reduce the number of duplicate Jira API calls caused by nested streams and add a Boards and Sprints stream.

How

Use the same VCR caching strategy implemented by the Github Source, and integrate with an older version of the Jira Rest API that surfaces types of records that the latest V2 and V3 APIs do not support.

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
    • Connector's bootstrap.md. See description and examples
    • 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
    • Connector's bootstrap.md. See description and examples
    • 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.

@CLAassistant
Copy link

CLAassistant commented Sep 29, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/connectors Connector related issues label Sep 29, 2021
@marcosmarxm marcosmarxm self-assigned this Sep 30, 2021
Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

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

Awesome @cjwooo, I added some comments and request @vitaliizazmic to review your contribution too! thanks

@github-actions github-actions bot added the CDK Connector Development Kit label Sep 30, 2021
@github-actions github-actions bot removed the CDK Connector Development Kit label Sep 30, 2021
@cjwooo cjwooo requested a review from marcosmarxm September 30, 2021 18:06
@cjwooo cjwooo requested a review from vitaliizazmic October 1, 2021 16:47
Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

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

thanks @cjwooo

@marcosmarxm
Copy link
Member

@cjwooo CI is not passing. Can you send your local tests?

2021-10-04 01:11:48 ERROR i.a.c.i.LineGobbler(voidCall):65 - *** -     for message in generator:
2021-10-04 01:11:48 ERROR i.a.c.i.LineGobbler(voidCall):65 - *** -   File "/usr/local/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 108, in read
2021-10-04 01:11:48 ERROR i.a.w.p.a.DefaultAirbyteStreamFactory(internalLog):88 - *** - Encountered an exception while reading stream SourceJira
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 104, in read
    internal_config=internal_config,
  File "/usr/local/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 134, in _read_stream
    for record in record_iterator:
  File "/usr/local/lib/python3.7/site-packages/airbyte_cdk/sources/abstract_source.py", line 206, in _read_full_refresh
    for record in records:
  File "/airbyte/integration_code/source_jira/streams.py", line 405, in read_records
    for property_key in issue_property_keys_stream.read_records(stream_slice=***"key": issue["key"*** **kwargs):
  File "/airbyte/integration_code/source_jira/streams.py", line 386, in read_records
    yield from super().read_records(stream_slice=***"key": issue_key*** **kwargs)
  File "/airbyte/integration_code/source_jira/streams.py", line 100, in read_records
    with self.cache:
  File "/usr/local/lib/python3.7/site-packages/vcr/cassette.py", line 80, in __enter__
    assert self.__finish is None, "Cassette already open."
AssertionError: Cassette already open.

https://github.com/airbytehq/airbyte/actions/runs/1301743551

@cjwooo
Copy link
Contributor Author

cjwooo commented Oct 4, 2021

I test using the same acceptance test files in the repo, but against our own playground Jira instance. I think I've fixed the test errors that were caused by the VCR caching.

@cjwooo cjwooo requested a review from marcosmarxm October 4, 2021 17:13
Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

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

LGTM thanks @cjwooo

@marcosmarxm marcosmarxm merged commit 95bf699 into airbytehq:master Oct 4, 2021
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* Add caching for Jira source and add Boards stream

* Fix draft version

* Add sprints stream

* Add vcr to setup.py

* Formatting

* Fix acceptance tests

* Fix acceptance tests
@cjwooo cjwooo deleted the cwu/jira branch January 26, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants