-
Notifications
You must be signed in to change notification settings - Fork 41
Merge queue test #1628
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
base: hqpho-test
Are you sure you want to change the base?
Merge queue test #1628
Conversation
Summary of ChangesHello @hqpho, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a robust control mechanism for deploying feature flag changes, particularly for production environments. It introduces a new CI/CD step that leverages a bash script to enforce time-based restrictions, ensuring that critical production feature flag modifications can only be merged during designated business hours and weekdays. Additionally, it initializes environment-specific feature flag configurations, enabling a new V3 feature across various deployment stages with tailored mirror fractions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a new CI check to enforce restrictions on merging changes to production feature flags. The changes include a Cloud Build configuration and a bash script to perform the checks, along with several new feature flag configuration files. My review has identified a few critical issues in the implementation that will prevent the CI check from working as intended. Specifically, the script is called incorrectly in the Cloud Build config, and the script uses incorrect exit codes for success paths, which would cause the build to fail when it should pass. I've provided suggestions to fix these issues.
build/ci/cloudbuild.merge_test.yaml
Outdated
- -c | ||
- | | ||
set -e | ||
./deploy/featureflags/enforce_merge_restrictions.sh |
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 enforce_merge_restrictions.sh
script is called without the required <config_dir>
argument. The script's usage indicates it expects a directory path to scan for feature flag files. Based on the project structure, it seems deploy/featureflags
should be passed as the argument.
./deploy/featureflags/enforce_merge_restrictions.sh deploy/featureflags
|
||
if [[ -z "$MODIFIED_PROD_FILES" ]]; then | ||
echo "No modified 'prod' feature flag files found. No restrictions apply." | ||
exit 1 |
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.
fi | ||
|
||
echo "Production change is within the allowed time window. Checks passed." | ||
exit 1 |
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 time checks are always performed in the US Pacific Time Zone. | ||
|
||
set -e |
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 improved robustness, it's a good practice to validate that required environment variables like _BASE_REF
are present at the start of the script. This provides a clearer error if the script is run in an unexpected environment where the variable is not set.
set -e | |
set -e | |
if [[ -z "${_BASE_REF}" ]]; then | |
echo "Error: _BASE_REF is not set. This script is intended to be run in a Google Cloud Build merge trigger." >&2 | |
exit 1 | |
fi |
No description provided.