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 CloudBuild build id log #30516

Merged
merged 13 commits into from
May 16, 2023
Merged

Conversation

tnk-ysk
Copy link
Contributor

@tnk-ysk tnk-ysk commented Apr 7, 2023

Added logging for CloudBuild build id.
This fix makes it easier to investigate when CloudBuild fails, etc.

Summary

  1. Add log for build id
  2. Remove hooks.create_build as it was unused
  3. Deprecate create_build as it is an unused method. related: Add deferrable mode to CloudBuildCreateBuildOperator #27783
  4. Add test for hooks.create_build_without_waiting_for_result because there was no test
  5. Fix to use wait_for_operation instead of using operation.result directly

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Apr 7, 2023
@tnk-ysk tnk-ysk marked this pull request as draft April 7, 2023 02:49
@tnk-ysk tnk-ysk marked this pull request as ready for review April 7, 2023 09:18
return operation, id_

@GoogleBaseHook.fallback_to_default_project_id
def create_build(
Copy link
Member

Choose a reason for hiding this comment

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

maybe need to deprecated it first and we should remove it only in major release

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pankajastro
Thank you for your review. I have reverted the changes based on your feedback.
If you happen to know, could you please tell me what is the common way to deprecate a method in Airflow?

Copy link
Member

Choose a reason for hiding this comment

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

It depends - look at similar cases where DeprecationWarning is raised - just search in our codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@potiuk
Thank you as always!
I changed create_build to be deprecated as it is an unused old method.
e1cd56d

@tnk-ysk tnk-ysk changed the title Fix cloud build create build log Add CloudBuild build id log Apr 16, 2023
@@ -207,6 +209,11 @@ def create_build(
:param metadata: Optional, additional metadata that is provided to the method.

"""
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

since we have merged #30975 so we should use AirflowProviderDeprecationWarning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you I fixed it.

@potiuk potiuk merged commit d9f70df into apache:main May 16, 2023
@tnk-ysk tnk-ysk deleted the fix-cloud-build-create-build-log branch May 17, 2023 10:14
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.

3 participants