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

🎉 New Source: Hellobaton #8461

Merged
merged 23 commits into from
Jan 14, 2022
Merged

🎉 New Source: Hellobaton #8461

merged 23 commits into from
Jan 14, 2022

Conversation

dluftspring
Copy link
Contributor

@dluftspring dluftspring commented Dec 2, 2021

What

Creating a new python HTTP source for hellobaton based on this API spec

How

Using the python CDK to implement full refresh streams for every available endpoint listed in the redoc

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

None

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

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
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as 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

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
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as 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 Dec 2, 2021

CLA assistant check
All committers have signed the CLA.

@marcosmarxm
Copy link
Member

thanks for the contribution @dluftspring we're going to review soon. I had create one issue to get credentials to run our integration tests #8476, is it possible for you share yours so we can anticipate the review?

@dluftspring
Copy link
Contributor Author

@marcosmarxm let me ask for a set of dummy credentials from the baton folks. Mine are attached to real company data and i'd prefer not to expose them unless it's absolutely necessary. I'll reply to this conversation with more details

@marcosmarxm
Copy link
Member

@marcosmarxm let me ask for a set of dummy credentials from the baton folks. Mine are attached to real company data and i'd prefer not to expose them unless it's absolutely necessary. I'll reply to this conversation with more details

Not a problem! So we need to wait the team to have a sandbox account.

@marcosmarxm
Copy link
Member

@dluftspring can you share the unit test and integration test output?

@dluftspring
Copy link
Contributor Author

@marcosmarxm which commands are used to run the unit and integration tests? Was searching through the docs but couldn't seem to find the right ones.

@marcosmarxm
Copy link
Member

you can run ./gradlew airbyte-integrations:connectors:soruce-hellobaton:integrationTest

@marcosmarxm
Copy link
Member

@dluftspring make sure this commands works in your local machine, right now there are some failures building the docker container because of Flake/Black formatting files and the integration tests are not working.

@dluftspring
Copy link
Contributor Author

dluftspring commented Dec 16, 2021

Okay running the integration tests I can see two task failures. Here are the two failures

2021-12-16T08:28:15.961-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Run main tasks' completed
2021-12-16T08:28:15.965-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-16T08:28:15.967-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build completed with 2 failures.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 1: Task failed with an exception.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] -----------
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':airbyte-integrations:connectors:source-hellobaton:flakeCheck'.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Python call failed: .venv/bin/python -m flake8 . --config /Users/dluftspring/repos/airbyte/tools/python/.flake8
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ==============================================================================
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2: Task failed with an exception.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] -----------
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':tools:code-generator:airbyteDocker'.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command '/Users/dluftspring/repos/airbyte/tools/bin/build_image.sh'' finished with non-zero exit value 1
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
2021-12-16T08:28:15.968-0500 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ==============================================================================

Do you need the full stacktrace? Any places I should start looking for linting errors?

=========== Update =================

Found these let me push a commit and see if this at least gets rid of the linting failures

> Task :airbyte-integrations:connectors:source-hellobaton:flakeCheck FAILED
[python] .venv/bin/python -m flake8 . --config /Users/dluftspring/repos/airbyte/tools/python/.flake8
         ./source_hellobaton/streams.py:7:1: F401 'typing.List' imported but unused
         ./source_hellobaton/streams.py:7:1: F401 'typing.Tuple' imported but unused
         ./source_hellobaton/streams.py:11:1: F401 'airbyte_cdk.AirbyteLogger' imported but unused
         ./source_hellobaton/streams.py:12:1: F401 'airbyte_cdk.sources.streams.Stream' imported but unused
         ./source_hellobaton/streams.py:14:1: F401 'airbyte_cdk.sources.streams.http.auth.TokenAuthenticator' imported but unused
         ./source_hellobaton/source.py:6:1: F401 'abc.ABC' imported but unused
         ./source_hellobaton/source.py:7:1: F401 'typing.Iterable' imported but unused
         ./source_hellobaton/source.py:7:1: F401 'typing.MutableMapping' imported but unused
         ./source_hellobaton/source.py:7:1: F401 'typing.Optional' imported but unused
         ./source_hellobaton/source.py:14:1: F401 '.streams.HellobatonStream' imported but unused
         ./source_hellobaton/source.py:32:1: E302 expected 2 blank lines, found 1

@dluftspring
Copy link
Contributor Author

dluftspring commented Dec 16, 2021

Might need a little help chasing down the issues in build_image.sh

I think this is the relevant stacktrace

> Task :tools:code-generator:airbyteDocker FAILED
#5 8.038     Running setup.py install for typed-ast: started
#5 8.161     Running setup.py install for typed-ast: finished with status 'error'
#5 8.166     ERROR: Command errored out with exit status 1:
#5 8.166      command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t7ha8wv7/typed-ast_57d9f08187904d3c90acceded4abb219/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t7ha8wv7/typed-ast_57d9f08187904d3c90acceded4abb219/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rah6u5dw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/typed-ast
#5 8.166          cwd: /tmp/pip-install-t7ha8wv7/typed-ast_57d9f08187904d3c90acceded4abb219/
#5 8.166     Complete output (23 lines):
#5 8.166     running install
#5 8.166     running build
#5 8.166     running build_py
#5 8.166     creating build
#5 8.166     creating build/lib.linux-aarch64-3.7
#5 8.166     creating build/lib.linux-aarch64-3.7/typed_ast
#5 8.166     copying typed_ast/ast3.py -> build/lib.linux-aarch64-3.7/typed_ast
#5 8.166     copying typed_ast/__init__.py -> build/lib.linux-aarch64-3.7/typed_ast
#5 8.166     copying typed_ast/conversions.py -> build/lib.linux-aarch64-3.7/typed_ast
#5 8.166     copying typed_ast/ast27.py -> build/lib.linux-aarch64-3.7/typed_ast
#5 8.166     package init file 'ast3/tests/__init__.py' not found (or not a regular file)
#5 8.166     creating build/lib.linux-aarch64-3.7/typed_ast/tests
#5 8.166     copying ast3/tests/test_basics.py -> build/lib.linux-aarch64-3.7/typed_ast/tests
#5 8.166     running build_ext
#5 8.166     building '_ast27' extension
#5 8.166     creating build/temp.linux-aarch64-3.7
#5 8.166     creating build/temp.linux-aarch64-3.7/ast27
#5 8.166     creating build/temp.linux-aarch64-3.7/ast27/Parser
#5 8.166     creating build/temp.linux-aarch64-3.7/ast27/Python
#5 8.166     creating build/temp.linux-aarch64-3.7/ast27/Custom
#5 8.166     gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iast27/Include -I/usr/local/include/python3.7m -c ast27/Parser/acceler.c -o build/temp.linux-aarch64-3.7/ast27/Parser/acceler.o
#5 8.166     unable to execute 'gcc': No such file or directory
#5 8.166     error: command 'gcc' failed with exit status 1
#5 8.166     ----------------------------------------
#5 8.166 ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t7ha8wv7/typed-ast_57d9f08187904d3c90acceded4abb219/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t7ha8wv7/typed-ast_57d9f08187904d3c90acceded4abb219/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rah6u5dw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/typed-ast Check the logs for full command output.
#5 8.168 WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
#5 8.168 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
#5 ERROR: executor failed running [/bin/sh -c pip install datamodel-code-generator==0.10.1]: exit code: 1

@marcosmarxm marcosmarxm self-assigned this Dec 17, 2021
@marcosmarxm
Copy link
Member

@dluftspring are you still having problems? You can use the command I sent to you or the ones in the README.md file created with the generator.

@dluftspring
Copy link
Contributor Author

@marcosmarxm I fixed the linter errors with this commit but I don't really have a good idea of why build_image.sh is failing. It just says theres a nonzero exit code but no other logging that I can find easily. Any help would be very appreciated :)

@marcosmarxm
Copy link
Member

@dluftspring what command are you executing?

@dluftspring
Copy link
Contributor Author

dluftspring commented Dec 22, 2021

From the repo root im running ./gradlew airbyte-integrations:connectors:source-hellobaton:integrationTest

@github-actions github-actions bot removed area/frontend area/worker Related to worker area/platform issues related to the platform kubernetes area/scheduler area/server normalization CDK Connector Development Kit area/documentation Improvements or additions to documentation labels Jan 14, 2022
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jan 14, 2022
@marcosmarxm marcosmarxm temporarily deployed to more-secrets January 14, 2022 17:34 Inactive
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 work @dluftspring 📟

@marcosmarxm marcosmarxm merged commit e331387 into airbytehq:master Jan 14, 2022
pmossman pushed a commit that referenced this pull request Jan 15, 2022
* Connector working through read method for hellobaton source

* Check connection method fixes

* Cleaning up directories and files +activity stream

* Changing webapp port for testing

* More testing ports

* Ports ports ports

* porto

* Reverting port changes

* Updating activity stream schema and config catalog

* Fixing flake lint failures

* fix schemas

* correct schemas and acceptance tests

* run format

* bump version in config files

* Docs page for hellobaton

* add doc

* run format

Co-authored-by: Marcos Marx <marcosmarxm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants