-
Notifications
You must be signed in to change notification settings - Fork 17
fix: (PoC) (do not merge) (CDK) (Manifest) - Migrate manifest fields #463
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
base: main
Are you sure you want to change the base?
Conversation
…ll migrations available
somewhat minor comment: should this code live outside of the |
another high-level thing. Before you open this PR for review, I wonder if it makes sense to break down the changes into several related PRs since there is a lot happening here. What about something like this? PR1: introduce the migration framework |
) | ||
|
||
|
||
class V_6_45_2_ManifestMigration_HttpRequesterUrlBaseToUrl(ManifestMigration): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
What
Resolves:
How
Manifest Migrations:
Introduced a framework to handle manifest migrations in the
Airbyte CDK
to apply transformations on given manifest.Added migration logic to convert
url_base
andpath
tourl
.http_requester_url_base_to_url_v6_45_2__0.py
http_requester_path_to_url_v6_45_2__1.py
Created migration files with clear
versioning
andorder
handling.Registered migration classes dynamically and applied them in order.
Updated Component Models:
HttpRequester
to support the newurl
field and prioritize it.url_base
andpath
fields.Deprecation of url_base and path fields:
HttpRequester.url
field to replace the deprecatedurl_base
andpath
fields.url_base
andpath
asdeprecated
with deprecation messages.Handling Deprecation Warnings:
deprecation_warnings
method to theDeclarativeSource
andManifestDeclarativeSource
class to collect and process deprecation notices._categorise_groups()
to handle deprecation warnings alongside message groups.BaseModelWithDeprecations
.airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py
module is added to cover thedeprecation
warnings for the fields marked asdeprecated
. This class is static (not autogenerated) and re-used when thedeclarative_component_schema.py
is being generated. In this way, there is no need to set additional validations on top of the existing component implementations.Unit Tests and Documentation:
unit_tests/sources/declarative/migrations/test_manifest_migration.py
README.md
in themanifest/migrations
directory to document the migration framework.User Impact
migrate_manifest: bool = False
by default, to not to have any regressions, before we're ready to use it within the UI (/resolve
should be havingmigrate: bool
flag to set the migration toTrue
)Related PR parts:
Manifest Normalizer
- fix: (CDK) (Manifest) - AddManifest Normalization
module (reduce commonalities + handle schema $refs) #447Deprecation Warning examples
The deprecation rules applied to the
declarative_component_schema.yaml
are automatically picked up and propagated to thedeclarative_component_schema.py
(auto-gen models), see the example bellow.Warning example
When
using
the deprecated field orcreating
an instance of the class with the deprecated field.Python default behavior:
If multiple fields are marked as
deprecated
and used - more than 1 deprecation message is shown.Connector Builder behavior: