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

Add CloudSQLCloneInstanceOperator #29726

Merged
merged 11 commits into from
Mar 3, 2023

Conversation

FloMom
Copy link
Contributor

@FloMom FloMom commented Feb 23, 2023

Created CloudSQLCloneInstanceOperator to provide a simple way of cloning a cloudSQL instance from a DAG.

It is making use of google's instance.clone method as described here: https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/instances/clone

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Feb 23, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 23, 2023

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@FloMom FloMom changed the title Create CloudSQLCloneInstanceOperator to clone cloudSQL instances. Created CloudSQLCloneInstanceOperator to clone cloudSQL instances. Feb 23, 2023
@potiuk
Copy link
Member

potiuk commented Feb 25, 2023

tests/static checks are failing

@@ -289,6 +289,7 @@ class TestGoogleProviderProjectStructure(ExampleCoverageTest, AssetsCoverageTest
"airflow.providers.google.cloud.operators.vertex_ai.endpoint_service.UpdateEndpointOperator",
"airflow.providers.google.cloud.operators.vertex_ai.batch_prediction_job."
"GetBatchPredictionJobOperator",
"airflow.providers.google.cloud.operators.cloud_sql.CloudSQLCloneInstanceOperator",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the motivation to add new operator without example?
Is there a difficulty in creating the example dag?
Out goal is to reduce this list not to make it bigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Thank you for the hint. I updated the associated example DAG to demonstrate usage of the CloudSQLCloneInstanceOperator.

Copy link
Contributor

@eladkal eladkal Feb 27, 2023

Choose a reason for hiding this comment

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

Great. We are almost there. The example was created but it is not referenced in the docs so users can't find it.
See our docs https://airflow.apache.org/docs/apache-airflow-providers-google/stable/operators/cloud/cloud_sql.html

You need to add a short description in the docs and refer to the example you wrote.
The relevant file to edit is:
https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers-google/operators/cloud/cloud_sql.rst

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all right. Thank you for pointing me to the right files. I updated the PR accordingly.

@eladkal eladkal changed the title Created CloudSQLCloneInstanceOperator to clone cloudSQL instances. Add CloudSQLCloneInstanceOperator Feb 27, 2023
@eladkal
Copy link
Contributor

eladkal commented Mar 1, 2023

@FloMom static checks are failing :(

@FloMom FloMom force-pushed the google-cloud-sql-instance-clone-operator branch from faa6f98 to 91d7860 Compare March 1, 2023 12:49
@FloMom FloMom force-pushed the google-cloud-sql-instance-clone-operator branch from 91d7860 to 14fc75c Compare March 1, 2023 16:34
@eladkal eladkal merged commit 3fc9461 into apache:main Mar 3, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 3, 2023

Awesome work, congrats on your first merged pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants