-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🐙 octavia-cli: implement apply
#10703
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
Conversation
ef9ef88
to
22c80b7
Compare
d248711
to
2b3e149
Compare
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.
Had a few small comments but nothing major. Nice work on this! I think it looks great
diff = compute_diff(remote_config, current_config) | ||
return diff.pretty() | ||
|
||
def _create_or_update( |
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.
I think this will all work as expected if the remote Airbyte instance does not have any sources/destinations already that the user wants to interact with with this CLI.
However, what about the case where someone wants to use this CLI to manage sources/destinations that already exist in their Airbyte instance? Is there some way for them to export their existing sources/destinations to create these resources, so that they don't need to recreate them with this CLI? Maybe that functionality is coming in a later PR?
Another way I could see a user getting into this case is if they delete all of the octavia-cli resource files - they should have some way to regenerate them from their Airbyte instance.
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.
You're 💯 right! This functionality will come with the octavia import
feature. It's only possible to update resources created with the CLI at the moment.
Thank you for the review @lmossman . I implemented your suggestions. Sorry for the typos, in French resource is ressource 😄 . |
What is
octavia apply
The
octavia apply
command creates and updates Airbyte remote resources according to the local YAML configuration of these resources.By default, running
octavia apply
will:BaseResource
objectstate.yaml
file with the resource id, the checksum of the latest configuration applied, and the generation timestamp/state.yaml
fileOptional behavior:
--force
flag to not prompt the user with a diff validation and always run create or update.--file
option to target specific configuration files (can be used multiple times-.Demo
Previous actions made:
octavia init
octavia generate octavia generate source decd338e-5647-4c0b-adf4-da0e75f5a750 my_db
./sources/my_db/configuration.yaml
Recommended reading order
Refacto made
state.yaml
file for all the managed resources. I decided to create a subfolder for each resource. These subfolders will containconfiguration.yaml
andstate.yaml
. (octavia-cli/octavia_cli/generate/renderer.py)apply
andgenerate
commands require an initialized project directory. I implemented a decorator for these commands (octavia-cli/octavia_cli/check_context.py).What's missing
octavia generate connection
to be ready)check_connection_to_*
andcheck_connection_to_*_for_update
endpoints)🚨 User Impact 🚨
octavia apply
command is now available