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

fix: add missing KMS resource name method in post-processing #5043

Merged
merged 5 commits into from
Jan 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Kms/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,34 @@
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)

# fix backwards-compatibility issues due to removed resource name helpers

s.replace(
'src/V1/Gapic/KeyManagementServiceGapicClient.php',
r"}",
Copy link
Contributor

Choose a reason for hiding this comment

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

This operation is not idempotent.

Can you grep the new function name and if it doesn't exist inject it?

Copy link
Contributor Author

@bshaffer bshaffer Jan 24, 2022

Choose a reason for hiding this comment

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

great idea! Is there a grep functionality in synthtool, or should I just implement it in python like this

 f = open('src/V1/Gapic/KeyManagementServiceGapicClient.php',  "r")
if 'public static function cryptoKeyName' not in f.read():
     s.replace(..)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, implemented in latest change. PTAL!

r"""

/**
* Formats a string containing the fully-qualified path to represent
* a crypto_key_path resource.
*
* @param string $project
* @param string $location
* @param string $keyRing
* @param string $cryptoKeyPath
*
* @return string The formatted crypto_key_path resource.
* @deprecated
*/
public static function cryptoKeyPathName($project, $location, $keyRing, $cryptoKeyPath)
{
return self::getCryptoKeyPathNameTemplate()->render([
'project' => $project,
'location' => $location,
'key_ring' => $keyRing,
'crypto_key_path' => $cryptoKeyPath,
]);
}
}"""
)