-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(endpoints): migrate all regions #9943
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(endpoints): migrate all regions #9943
Conversation
|
Here is the summary of changes. You are about to add 3 region tags.
This comment is generated by snippet-bot.
|
ghost
left a comment
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.
Hi team,
I'm currently reviewing this pull request and will provide feedback shortly. In the meantime, here's a summary for you and other reviewers to quickly get up to speed:
This pull request, submitted by OremGLG, aims to migrate all regions in the endpoints directory by adding the prefixes "endpoints_" and "_go" to region names and replacing hyphens with underscores. This addresses issue b/347825448.
Key Changes:
The core change involves modifying the esp_echo_http.yaml file. Specifically:
- Lines 41-48 and 56-72 were modified to include the new prefixes and underscore replacements in comments related to secrets and services. The changes are primarily focused on updating comment blocks within the YAML file to reflect the new naming convention.
Checklist:
The author has included a checklist indicating that they have followed the sample format guide, updated the pom.xml file, made appropriate README changes, and confirmed that tests and lint checks pass. Static analysis is advisory only.
I'll provide a more detailed review shortly, but this summary should give everyone a good overview of the changes.
A tiny poem for your coding pleasure:
Code flows like a river,
Each line a drop, a journey,
To a sea of bugs.
ghost
left a comment
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.
This pull request adds prefixes and suffixes to region identifiers and replaces hyphens with underscores. This change improves consistency and addresses the issue linked. The commit message clearly describes the changes made. The comments within the YAML file could be slightly improved by providing more context and explaining the purpose of each section. Additionally, ensure the README is updated to reflect these changes if they affect user interaction.
Summary of Style Guide Elements Referenced:
- Comment Formatting: Comments should clearly explain the why behind the code, not just the what. This was referenced in the feedback on the
esp_echo_http.yamlfile. While no specific style guide was provided, this is a general best practice for comments.
| labels: | ||
| app: esp-echo | ||
| spec: | ||
| # [START endpoints_secret_1_java] |
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.
The comment # [START endpoints_secret_1_java] could be more descriptive. Instead of just indicating the start of a section, explain the purpose of this section, e.g., # [START endpoints_secret_1_java] Define the service account credentials volume. This improves readability and maintainability by providing context. This recommendation is based on general comment formatting best practices, which emphasize clarity and explaining the why behind the code.
| # [START endpoints_secret_1_java] | |
| # [START endpoints_secret_1_java] Define the service account credentials volume |
| secret: | ||
| secretName: service-account-creds | ||
| # [END secret-1] | ||
| # [END endpoints_secret_1_java] |
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.
Similar to the previous comment, consider making this comment more descriptive. For example: # [START endpoints_service_java] Define the ESP container and its configuration. Explaining the purpose of the section makes the code easier to understand. This recommendation is based on general comment formatting best practices, which emphasize clarity and explaining the why behind the code.
| # [END endpoints_secret_1_java] | |
| # [START endpoints_service_java] Define the ESP container and its configuration |
| # [END endpoints_service_java] | ||
| ports: | ||
| - containerPort: 8080 | ||
| # [START endpoints_secret_2_java] |
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.
Could you clarify the purpose of this section in the comment? For instance, # [START endpoints_secret_2_java] Mount the service account credentials into the ESP container. Providing context for the code block enhances readability and maintainability. This recommendation is based on general comment formatting best practices, which emphasize clarity and explaining the why behind the code.
| # [START endpoints_secret_2_java] | |
| # [START endpoints_secret_2_java] Mount the service account credentials into the ESP container |
ghost
left a comment
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.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly understand the changes:
This pull request, submitted by OremGLG, aims to migrate all regions in the endpoints directory by adding the prefixes endpoints_ and _go to region names and replacing hyphens with underscores. This addresses issue b/347825448.
Key Changes:
- The primary changes are focused within the
endpoints/getting-started/k8s/esp_echo_http.yamlfile. - Specifically, code blocks with comments like
# [START secret-1]and# [START service]have been updated to include theendpoints_prefix. For example,# [START secret-1]becomes# [START endpoints_secret_1_java]and# [START service]becomes# [START endpoints_service_java]. Similar modifications are present for# [END]comments. - The changes appear to consistently add
endpoints_before and_goafter region identifiers, and replace hyphens with underscores.
Checklist Status:
The author has indicated completion of the Sample Format Guide and the merge request. The remaining checklist items require verification.
I'll provide a more detailed review shortly. Thanks!
And now for a little haiku to brighten your day:
Code flows like a stream,
Fixes merge, a gentle tide,
Progress finds its way.
ghost
left a comment
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.
This pull request migrates all regions by adding prefixes and suffixes and replacing hyphens with underscores. The changes look good overall, and the commit message clearly explains the purpose of the changes. The checklist is also helpful. I didn't see a style guide specified, so I'm defaulting to commonly used YAML best practices.
One small suggestion for the README: Since this change affects how regions are used, it's worth updating the README files (if any exist in the affected directories) to reflect these changes. This will help users understand the new naming conventions.
| labels: | ||
| app: esp-echo | ||
| spec: | ||
| # [START endpoints_secret_1_java] |
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.
For better readability and maintainability, consider adding a comment explaining the purpose of this volume and secret. While the secret-1 tag helps, a brief explanation within the YAML itself can improve understanding. For example, you could add a comment like "# Mount service account credentials for ESP".
| # [START endpoints_secret_1_java] | |
| # Mount service account credentials for ESP | |
| # [START endpoints_secret_1_java] |
| # [END endpoints_service_java] | ||
| ports: | ||
| - containerPort: 8080 | ||
| # [START endpoints_secret_2_java] |
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.
ghost
left a comment
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.
Hi team,
I'm currently reviewing this pull request and will provide feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly understand the changes:
This pull request, submitted by OremGLG, aims to migrate all regions by adding the prefixes "endpoints_" and "_go" to region names and replacing hyphens with underscores. This addresses issue b/347825448.
Key Changes:
- The primary changes are focused within the
endpoints/getting-started/k8s/esp_echo_http.yamlfile. - Specifically, lines 41-48 and 56-72 have been modified. The changes involve adding
endpoints_prefixes to several code snippets, specifically those marked with comments such as# [START endpoints_secret_1_java]and# [END endpoints_secret_1_java]. - The goal is to standardize region naming conventions for better consistency and clarity.
Checklist Status:
The author has indicated that the checklist items related to the sample format guide and merging the PR are complete. Other checklist items require further verification.
I'll provide a more detailed review shortly, but this summary should give everyone a head start.
Here's a little haiku to brighten your day:
Code flows like a stream,
Fixes merge, a gentle tide,
Progress finds its way.
ghost
left a comment
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.
This pull request adds prefixes and suffixes to region identifiers in esp_echo_http.yaml and replaces hyphens with underscores. While the changes are understandable, the commit message and pull request description could be improved. The description should clearly state the reason for these changes (e.g., aligning with a new naming convention, resolving a bug) and their impact on the application. Additionally, since this change affects regions, it's crucial to update relevant documentation and READMEs to reflect the new identifiers.
Regarding the changes in the YAML file, the added comments are helpful, but ensure consistency in their format and content. Specifically, the end comments could be more concise and follow a similar structure as the start comments.
Here's a summary of style guide elements I referenced:
- Comments: Emphasized the importance of clear, concise, and consistent comments to improve maintainability.
- Documentation: Highlighted the need to update documentation to reflect code changes, especially those affecting user-facing aspects like region identifiers.
- Commit Messages: Recommended providing more context and details in commit messages to explain the rationale behind changes.
| labels: | ||
| app: esp-echo | ||
| spec: | ||
| # [START endpoints_secret_1_java] |
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.
The addition of endpoints_secret_1_java is good. For consistency, use a concise comment explaining the purpose of this tag. For example:
# Start Java secret configuration| # [START endpoints_secret_1_java] | |
| # Start Java secret configuration | |
| # [START endpoints_secret_1_java] | |
| # [START secret-1] |
| secret: | ||
| secretName: service-account-creds | ||
| # [END secret-1] | ||
| # [END endpoints_secret_1_java] |
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.
Similar to the previous comment, add a concise explanation for endpoints_service_java. For example:
# Start Java service configuration| # [END endpoints_secret_1_java] | |
| # [END secret-1] | |
| # [END endpoints_secret_1_java] | |
| # Start Java service configuration | |
| # [START endpoints_service_java] | |
| # [START service] |
| "--service_account_key", "/etc/nginx/creds/service-account-creds.json", | ||
| ] | ||
| # [END service] | ||
| # [END endpoints_service_java] |
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.
| # [END endpoints_service_java] | ||
| ports: | ||
| - containerPort: 8080 | ||
| # [START endpoints_secret_2_java] |
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.
Add a concise comment explaining the endpoints_secret_2_java tag, similar to the previous suggestions. For example:
# Start Java secret configuration (part 2)| # [START endpoints_secret_2_java] | |
| # Start Java secret configuration (part 2) | |
| # [START endpoints_secret_2_java] | |
| # [START secret-2] |
| name: service-account-creds | ||
| readOnly: true | ||
| # [END secret-2] | ||
| # [END endpoints_secret_2_java] |
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.
ghost
left a comment
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.
Hi team,
I'm currently reviewing this pull request and will provide feedback shortly. In the meantime, here's a summary for you and other reviewers to quickly get up to speed:
This pull request, submitted by OremGLG, aims to migrate all regions by adding the prefixes "endpoints_" and "_go" to region names and replacing hyphens with underscores. This addresses issue b/347825448.
Key Changes:
The core changes are focused on the endpoints/getting-started/k8s/esp_echo_http.yaml file. Specifically:
- Added Prefixes and Underscores: The PR modifies comments within the YAML file, adding
endpoints_prefixes to several code snippets (e.g.,# [START endpoints_secret_1_java]). Hyphens in existing comments have been replaced with underscores. - Specific Line Changes: The changes are concentrated around lines 38-52 and 56-75 of
endpoints/getting-started/k8s/esp_echo_http.yaml. The exact nature of these changes is to add theendpoints_prefix to the start and end markers of code snippets.
Checklist Status: The author has marked the checklist items related to the sample format guide and merging the PR as complete. Other items remain to be verified.
Overall: The changes appear straightforward and well-documented. I'll be checking the build and lint status, as well as the overall impact on the application, before providing a final review.
A little haiku to brighten your day:
Code flows like a stream,
Fixes merge, a gentle hum,
Progress finds its way.
ghost
left a comment
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.
This pull request migrates all regions by adding prefixes and suffixes and replacing hyphens with underscores. This improves consistency and addresses the linked issue. The commit message and PR description are well-written and informative. I've included some minor suggestions for the YAML file to enhance readability and maintainability.
Summary of Style Guide References:
I referenced general YAML best practices for readability and maintainability, including consistent indentation and the use of comments to explain sections. While no specific style guide was provided, these practices are widely accepted and contribute to cleaner YAML files.
Recommendations for Approval:
I recommend addressing the suggestions below regarding documentation before merging this PR.
| labels: | ||
| app: esp-echo | ||
| spec: | ||
| # [START endpoints_secret_1_java] |
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.
Add a comment explaining the purpose of this section. For example, "Define volumes for mounting service account credentials." This improves readability and understanding of the YAML structure.
| # [START endpoints_secret_1_java] | |
| # Define volumes for mounting service account credentials. | |
| # [START endpoints_secret_1_java] | |
| # [START secret-1] | |
| volumes: |
* chore(job): migrate regions by associating them with an official product with a job_ prefix (#9883) * chore(endpoints): delete region 'swagger' in endpoints/multiple-versions (#9857) * chore(endpoints): delete region swagger to openapi-v1.yaml * chore(endpoints): delete region swagger to openapi-v2.yaml * chore(job): delete sample jobs_java_dependencies_beta (#9810) * chore(job): delete sample jobs_java_dependencies_beta * chore(job): delete region_tab 'jobs_java_dependencies_beta' and update 'google-api-services-jobs' version * feat(compute): add compute disk regional replicated sample (#9697) * Implemented compute_disk_regional_replicated sample, created test * Fixed zone * Fixed test * Fixed test * Fixed disk size * Fixed code as requested in the comment * feat(compute): add compute disk start/stop replication samples (#9650) * Implemented compute_disk_start_replication and compute_disk_stop_replication samples, created tests * Fixed test * Deleted not related classes * Fixed lint issue * Increased timeout * Split samples for zonal location * Fixed code * Fixed code * Increased timeout * Increased timeout * feat(tpu): add tpu vm create spot sample. (#9610) * Changed package, added information to CODEOWNERS * Added information to CODEOWNERS * Added timeout * Fixed parameters for test * Fixed DeleteTpuVm and naming * Added comment, created Util class * Fixed naming * Fixed whitespace * Split PR into smaller, deleted redundant code * Implemented tpu_vm_create_spot sample, created test * changed zone * Changed zone * Fixed empty lines and tests, deleted cleanup method * Changed zone * Deleted redundant test class * Increased timeout * Fixed test * feat(tpu): add tpu vm create startup script sample. (#9612) * Changed package, added information to CODEOWNERS * Added information to CODEOWNERS * Added timeout * Fixed parameters for test * Fixed DeleteTpuVm and naming * Added comment, created Util class * Fixed naming * Fixed whitespace * Split PR into smaller, deleted redundant code * Implemented tpu_vm_create_startup_script sample, created test * Fixed tests and empty lines * Changed zone * Deleted redundant test classes * Increased timeout * Fixed code * feat(tpu): add tpu queued resources create/get/delete samples (#9613) * Changed package, added information to CODEOWNERS * Added information to CODEOWNERS * Added timeout * Fixed parameters for test * Fixed DeleteTpuVm and naming * Added comment, created Util class * Fixed naming * Fixed whitespace * Split PR into smaller, deleted redundant code * Implemented tpu_queued_resources_create, tpu_queued_resources_get, tpu_queued_resources_delete_force and tpu_queued_resources_delete samples, created tests * Fixed test * Fixed tests * Fixed error massage * Fixed typo * Fixed zone * Fixed test * Fixed code * Deleted commented imports * Fixed code as requested in comments * feat(tpu): add tpu queued resources create spot (#9615) Add a code sample for tpu_queued_resources_create_spot * chore: add translate dev team for translate samples (#9888) b/385243174 * feat(securitycenter): Add Resource SCC Management API Org ETD Custom Module code samples (Create, Delete, List, Get) (#9743) * sample codes for event threat detection custom modules * addressed comments * addressed comments * addressed comments * addressed comments * fix(compute): fixed compute_reservation_create_shared sample and test to use mocked client (#9840) * Fixed sample and test to use mocked client * Fixed code as requested in the comments * feat(compute): add compute instance create replicated boot disk sample (#9735) * Implemented compute_instance_create_replicated_boot_disk sample, created test * Fixed test * Fixed code as requested in the comments * Fixed Util class * Fixed code * feat(compute): add compute consistency group stop replication (#9694) * Implemented compute_consistency_group_create and compute_consistency_group_delete samples, created test * Implemented compute_consistency_group_stop_replication sample * Implemented compute_consistency_group_stop_replication sample * Created test and added needed classes for testing * Fixed test * Moved clean up methods * Added clean up methods for reservations * Fixed clean up method * Fixed clean up method * Added timeout * Reverted not related changes * Reverted not related changes * Reverted not related changes * Reverted not related changes * Fixed code * Split samples for zonal location * Added comments for methods * Fixed comments * feat(secretmanager): add optional ttl to create secret sample (#9889) * feat(secretmanager): add optional ttl to create secret sample * nit: Update secretmanager/src/main/java/secretmanager/CreateSecret.java Co-authored-by: code-review-assist[bot] <182814678+code-review-assist[bot]@users.noreply.github.com> * fix(secretmanager): fix comment indentation to resolve linting issues --------- Co-authored-by: Jennifer Davis <[email protected]> Co-authored-by: code-review-assist[bot] <182814678+code-review-assist[bot]@users.noreply.github.com> * feat(tpu): add tpu queued resources list sample (#9614) * Changed package, added information to CODEOWNERS * Added information to CODEOWNERS * Added timeout * Fixed parameters for test * Fixed DeleteTpuVm and naming * Added comment, created Util class * Fixed naming * Fixed whitespace * Split PR into smaller, deleted redundant code * Implemented tpu_queued_resources_create, tpu_queued_resources_get, tpu_queued_resources_delete_force and tpu_queued_resources_delete samples, created tests * Implemented tpu_queued_resources_list sample, created test * Fixed test * Fixed tests, deleted cleanup method * Fixed test * Fixed imports * feat(compute): add compute disk create secondary regional sample (#9641) * Implemented compute_disk_create_secondary_regional. created test * Fixed test * Fixed test * Fixed test * Fixed zone * Fixed naming * Fixed spaces * Fixed code * Fixed indentations * Fixed variable * Fixed code * Added cleanup methods * Fixed lint issue * Fixed lint issue * Fixed test * Fixed code * Fixed code * Fixed code * Deleted duplicated assertion * feat(compute): add compute disk create secondary sample. (#9643) * Implemented compute_disk_create_secondary sample, created test * Fixed code * Fixed variable * Fixed code * Merged changes from main * Fixed lint issue * fix(storage): migrate old region all to storagetransfer_transfer_all step 1 (#9917) * fix(job): remove old region create_job (#9914) * feat(compute): attach/ remove snapshot schedule to disk (#9791) * Implemented compute_snapshot_schedule_attach sample, created test * Implemented compute_snapshot_schedule_remove sample, created test * Fixed code * Fixed code as requested in the comments * feat(compute): add compute consistency group clone sample (#9885) * Implemented compute_consistency_group_clone and compute_consistency_group_clone_regional_disk samples, created tests * Fixed naming * feat(compute): add compute instance attach regional disk force sample (#9730) * Implemented compute_instance_attach_regional_disk_force sample, created test * Added clean up method * Fixed comments and parameters * Test order deleted * Fixed code * Fixed code * Fixed code * Increased timeout * Increased timeout * Increased timeout * Fixed code * Fixed code * Fixed code * Fixed naming * feat(compute): add compute disk create secondary custom sample (#9644) * Implemented compute_disk_create_secondary_custom sample, created test * Fixed code * Fixed variable * Fixed code * Fixed whitespace * Fixed whitespace * feat(compute): add compute snapshot schedule create/get/edit/list/delete samples (#9742) * Implemented compute_snapshot_schedule_delete and compute_snapshot_schedule_create samples, created test * Fixed test * Added compute_snapshot_schedule_get sample, created test * Fixed naming * Implemented compute_snapshot_schedule_edit, created test * Fixed naming * Implemented compute_snapshot_schedule_list sample, created test * Cleaned resources * Cleaned resources * Cleaned resources * Cleaned resources * Fixed test * Added comment * Fixed tests * Fixed code * Fixed code as requested in the comments * feat(compute): add compute disk create with snapshot schedule (#9788) * Implemented compute_disk_create_with_snapshot_schedule sample, created test * Fixed code * Fixed code * Fixed test * Fixed code * Fixed code as requested in the comments * Fixed lint issue * Fixed lint issue * Deleted redundant code * feat(tpu): add tpu queued resources time bound sample. (#9617) * Changed package, added information to CODEOWNERS * Added information to CODEOWNERS * Added timeout * Fixed parameters for test * Fixed DeleteTpuVm and naming * Added comment, created Util class * Fixed naming * Fixed whitespace * Split PR into smaller, deleted redundant code * Implemented tpu_queued_resources_create, tpu_queued_resources_get, tpu_queued_resources_delete_force and tpu_queued_resources_delete samples, created tests * Implemented tpu_queued_resources_time_bound sample, created test * Changed zone for tpu * Cleanup resources * Fixed tests * Fixed test * Fixed code as requested in the comments * Fixed code as requested in the comments * fix(job): delete old region tag update_job_with_field_mask (#9940) * feat(job): migrate region tags to include product prefix (#9966) * fix(endpoints): migrate all regions (#9943) * fix: disable flakybot reporting (#9968) * chore(job): remove unused region tags (#9969) * feat(securitycenter): Add Resource SCC Management API Org ETD Custom Module code samples (Update, Get Eff, List Eff, List Desc, Validate) (#9912) * sample codes for event threat detection custom modules * fixed lint * addressed comments * lint fix * addressed comments --------- Co-authored-by: OremGLG <[email protected]> Co-authored-by: eapl.me <[email protected]> Co-authored-by: Тетяна Ягодська <[email protected]> Co-authored-by: Jennifer Davis <[email protected]> Co-authored-by: lovenishs04 <[email protected]> Co-authored-by: alarconesparza <[email protected]> Co-authored-by: Jennifer Davis <[email protected]> Co-authored-by: code-review-assist[bot] <182814678+code-review-assist[bot]@users.noreply.github.com> Co-authored-by: Brian Dorsey <[email protected]>
Description
Add "endpoints_" and "_java" suffix to all regions, also replace "-" character to underscore
Fixes b/347825448
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only