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

Connector Levels: Add new internal metadata fields #28904

Merged

Conversation

bnchrch
Copy link
Contributor

@bnchrch bnchrch commented Aug 1, 2023

Overview

closes #28712

  1. Adds new internal fields to registry and metadata types
  2. Populates them according to https://docs.google.com/spreadsheets/d/17tuDHfCJwwyGF6DyrwI3oZKM2UIhvHsyhYFRKTKrWFU/edit#gid=768783834
  3. Fills in the remaining by assuming the destination and sources have the same level

@bnchrch bnchrch requested review from a team as code owners August 1, 2023 08:44
@octavia-squidington-iii octavia-squidington-iii added the area/connectors Connector related issues label Aug 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Coverage report for source-postgres

There is no coverage information present for the Files changed

Total Project Coverage 70.27% 🍏

@bnchrch bnchrch requested a review from a team August 1, 2023 15:41
Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

Looks reasonable! Only question is about required/defaults or not

Comment on lines 22 to 26
class ReleaseStage1(BaseModel):
__root__: Literal["community", "certified"] = Field(
...,
description="enum that describes a connector's release stage",
title="ReleaseStage",
Copy link
Contributor

Choose a reason for hiding this comment

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

is it still called ReleaseStage in the new setup? I thought they were "quality level"s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is wrong! fixing

@@ -154,6 +170,7 @@ class Config:
False, description="whether this is a custom connector definition"
)
releaseStage: Optional[ReleaseStage] = None
supportLevel: Optional[ReleaseStage1] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this explains my question earlier - though I did find this confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah missed this! will fix up!

Comment on lines 5 to 11
description: Fields for internal use only
type: object
additionalProperties: false
properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

are these properties required? (I think it makes sense for these to be required, and to default to the lowest values if not provided (i.e. a new connector)

if so we should be able to apply the required and the defaults here (I think, on the defaults at least)

Copy link
Contributor

Choose a reason for hiding this comment

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

If they are required, we should add one to the invalid examples where the properties don't exist.

I have the same overall question for supportLevel - is it a required property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I had left it as not a required property so as not to break metadata processing at this time.

Once these are out and the systems are updated the plan is to cut a v2 of the metadata spec

Deprecate releaseStage in Metadata Schema

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure how adding this as required would break metadata processing since you've manually patched all of the files so far. Can you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are still old metadata files that can be processed.

For example at this time if you were to rerun the add metadata partition job in our orchestrator we would see a lot of failures for previous versions of metadata files.

This isnt a major issue, and overtime we expect there are old metadata files we cant/no longer want to process. Hell even right now we fail silently as long as this doesnt occur on a latest file path.

However I believe its good practise that while were still updating our downstream systems to use these new fields we allow them to exist harmoniously with the existing (old) systems. That way we can always rollback changes to downstream systems in case things go wrong.

Also it delays me from cutting the v2 of the metadata spec. And the more we delay their the more we learn. and the more we learn the less likely we end up in a situation where we have to cut a v3 immediately afterward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea! Also Ill add the defaults to the scaffold, but I want them to set them explicitly! If we add defaults here then they never have to add them to the metadata

Copy link
Contributor

Choose a reason for hiding this comment

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

mm yeah i'm mostly concerned about community contributors - though I guess they'd not add the ab_internal stuff at all

Copy link
Contributor

Choose a reason for hiding this comment

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

in that case no defaults but still reqired sub-keys makes sense to me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair call out. These are akward that way.

I think this means that the defaults for this fields are pushed to the consuming service.

In this case the transformation from metadata to registry entry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Meaning for the Registry we can make these required and fill in the defaults when transforming from the metadata definition

@bnchrch bnchrch force-pushed the bnchrch/connector-cert/add-metadata-definition branch from 2d85dcc to 3dc8b34 Compare August 1, 2023 22:17
@bnchrch bnchrch requested a review from a team as a code owner August 1, 2023 22:17
@bnchrch
Copy link
Contributor Author

bnchrch commented Aug 1, 2023

/approve-and-merge reason="Adding benign metadata fields"

@octavia-approvington
Copy link
Contributor

A crack team of mammals has made a decision.
imagine a seal of approval

@octavia-approvington octavia-approvington merged commit e9490e3 into master Aug 1, 2023
@octavia-approvington octavia-approvington deleted the bnchrch/connector-cert/add-metadata-definition branch August 1, 2023 23:08
bnchrch added a commit that referenced this pull request Aug 3, 2023
* Add airbyte internal

* Add tests

* First pass

* Set destinations to same levels as sources

* Best guess at missing statuses

* Best guess at _ql

* Add separate enum class

* Fix support level name

* Update templates

* Add one more test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Metadata Schema to include new fields
4 participants