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

Improved schema_generator tool #13518

Merged
merged 8 commits into from
Jul 13, 2022

Conversation

dougpm
Copy link
Contributor

@dougpm dougpm commented Jun 7, 2022

What

Improves the developer experience when using the schema generator tool.

How

  1. Created a package for the tool.
  2. Added a command for generating a Configured Catalog.
  3. Added documentation on how the tool works and how to use it.

Recommended reading order

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

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/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
  • If new credentials are required for use in CI, add them to GSM. 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
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped 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

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@CLAassistant
Copy link

CLAassistant commented Jun 7, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jun 7, 2022
Copy link
Contributor

@vincentkoc vincentkoc left a comment

Choose a reason for hiding this comment

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

Good stuff, i think you need to add unit tests and re-instate the licence. I only did a quick eye-ball on the logic

@@ -1,27 +1,3 @@
#
# MIT License
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think you can drop the licence

from .configure_catalog import configure_catalog


def main():
Copy link
Contributor

Choose a reason for hiding this comment

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

Any unit tests for the tool?

@marcosmarxm marcosmarxm added the CDK Connector Development Kit label Jun 7, 2022
@github-actions github-actions bot removed the CDK Connector Development Kit label Jun 7, 2022
@alafanechere alafanechere added CDK Connector Development Kit team/extensibility labels Jun 7, 2022
@alafanechere alafanechere linked an issue Jun 7, 2022 that may be closed by this pull request
@alafanechere
Copy link
Contributor

Thank you @dougpm for this great contribution! Our team will review it soon.

@alafanechere alafanechere self-assigned this Jun 7, 2022
@github-actions github-actions bot removed the CDK Connector Development Kit label Jun 7, 2022
@alafanechere alafanechere requested a review from bleonard June 9, 2022 07:37
@alafanechere
Copy link
Contributor

Hi @dougpm let me know if I'm wrong:

  • Your tool is generating schemas files from running a read command
  • The read command requires a catalog to run, hence the underlying stream schema

So I'm under the impression that this tool can't be used to initially create schema files while starting a new connector project. Am I right?

@dougpm
Copy link
Contributor Author

dougpm commented Jun 14, 2022

Hey @alafanechere

You're right, to generate the catalog we need the schema files. These files can be empty json files, they just need to be there for the discover and read commands to succeed.
I could add instructions for the creation of empty schema files for each stream before the connector container is built.
Should we go with that or are there any other options?

@alafanechere alafanechere added the CDK Connector Development Kit label Jun 14, 2022
@alafanechere
Copy link
Contributor

Hey @dougpm I pinged our Developer Experience team to get their opinion about this addition 😄

@alafanechere
Copy link
Contributor

@dougpm it would help if you can add a bit more details in your documentation about the context in which this tool can be used in the connector development cycle.

@github-actions github-actions bot removed the CDK Connector Development Kit label Jun 19, 2022
@dougpm
Copy link
Contributor Author

dougpm commented Jun 19, 2022

@alafanechere Added a Prerequisites section in the tool README file.

@alafanechere alafanechere requested a review from sherifnada June 20, 2022 14:16
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

Generally looks good, thanks for adding docs! would also support having unit tests here but otherwise LGTM

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

@dougpm how do you feel about adding unit tests?

@dougpm
Copy link
Contributor Author

dougpm commented Jun 22, 2022

@dougpm how do you feel about adding unit tests?

@alafanechere Sure I'll do that!

@alafanechere
Copy link
Contributor

Hey @dougpm do you have the bandwidth to implement the unit tests soon?

@dougpm
Copy link
Contributor Author

dougpm commented Jul 5, 2022

Hey @alafanechere yes, I'll do it this week, sorry for the delay.

@dougpm
Copy link
Contributor Author

dougpm commented Jul 12, 2022

@alafanechere tests added!

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Thank you for adding the tests. I played with the schema generator locally, I had to make minor changes to the installation process to make it work.

@alafanechere alafanechere mentioned this pull request Jul 13, 2022
@alafanechere alafanechere temporarily deployed to more-secrets July 13, 2022 09:45 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation community team/extensibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve schema_generator.py developer experience
7 participants