-
Notifications
You must be signed in to change notification settings - Fork 41
[WIP] Bundled mixer configs; pre-merge checks #1627
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: master
Are you sure you want to change the base?
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 introduces a robust mechanism for managing and controlling feature flag deployments, particularly for production environments. It integrates a new pre-merge check into the CI pipeline that strictly enforces time-based restrictions on changes to production feature flag configurations, ensuring that such critical updates occur during monitored business hours. Additionally, it establishes a structured approach to defining feature flags across various environments by introducing dedicated configuration files. 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 configuration files for feature flags across different environments and adds a CI check to enforce merge restrictions on production configurations. My review focuses on the new CI script and its configuration. I've found a few critical issues in the shell script and its invocation that would cause the CI check to fail incorrectly. There's also a recommendation to make the file matching logic more robust.
|
||
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.
|
||
# Get the list of modified YAML files containing "prod" in their name within the config directory. | ||
# This compares the current temporary merge commit (HEAD) with the target branch. | ||
MODIFIED_PROD_FILES=$(git diff --name-only "$(git merge-base HEAD "$BASE_BRANCH")" HEAD -- "$CONFIG_DIR" | grep 'prod.*\.yaml$' || true) |
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 grep
pattern prod.*\.yaml$
is too broad and could cause false positives by matching files that contain "prod" but are not production environment configurations (e.g., a file named reproduction.yaml
). To avoid this, consider using a more specific pattern that matches the naming convention of your production config files, such as files starting with prod_
.
MODIFIED_PROD_FILES=$(git diff --name-only "$(git merge-base HEAD "$BASE_BRANCH")" HEAD -- "$CONFIG_DIR" | grep 'prod.*\.yaml$' || true) | |
MODIFIED_PROD_FILES=$(git diff --name-only "$(git merge-base HEAD "$BASE_BRANCH")" HEAD -- "$CONFIG_DIR" | grep 'prod_.*\.yaml$' || true) |
No description provided.