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

[Rollout Infra] Adds the fallback flags, creates the script to upload to GCS and modifies the loading logic. #4871

Merged
merged 13 commits into from
Jan 24, 2025

Conversation

gmechali
Copy link
Contributor

@gmechali gmechali commented Jan 21, 2025

This PR modifies the logic for reading the feature flags such that it falls back to local files if for some reason the GCS bucket file is not found, if there's a permission error, etc.

We also modify the logic on the 3 existing flags (autocomplete, Place page experiment, Place page GA) to represent what is needed.

We create the local files to be used as fallback, and from which the GCS files will get updated. Note that we enabled Autocomplete on all environment (for the next release). But kept Place page experiment and GA disabled for now.

Creates the script to update the GCS files from the local files.
For production, we also diff the file in the staging GCS bucket in order to ensure it has been verified.

Lastly the script is able to trigger a Kubernetes restart.

This has all been tested end to end.

gmechali added a commit that referenced this pull request Jan 23, 2025
…n a global Var (#4869)

Uploaded feature_flags.json in datcom-website-[ENV]-resources GCS
buckets in format as:
`
[{
    "name": "autocomplete",
    "enabled": true
},
{
    "name": "dev_place_experiment",
    "enabled": false
},
{
    "name": "dev_place_ga",
    "enabled": false
}]
`
On server startup, it ingests this file, and exposes the feature status
through api/features.
Also adds an api/features/{feature_name} endpoint to expose whether it's
enabled.

Starts reading the feature flags for place autocomplete, place page
experiment rollout and place page GA rollout.

The feature flags were uploaded as:
- autocomplete: Enabled for all environments
- dev place experiment: Enabled for autopush
- dev place GA rollout: Enabled for autopush

This implementation is as outlined in
https://docs.google.com/document/d/19CqgKt6aIbFs5v2zhm3TagDfPJF-K_SpH-9VPP9FeRw/edit?resourcekey=0-qM2XvR7dYp4j0jXshva04g&tab=t.0

In a followup, I will add the fallback flag values, ingest them in the
load_feature_flags method, and write the script to auto update the GCS
buckets. See PR - #4871
@gmechali gmechali requested review from beets and dwnoble January 23, 2025 23:05
@gmechali gmechali marked this pull request as ready for review January 23, 2025 23:05
scripts/update_gcs_feature_flags.sh Outdated Show resolved Hide resolved
scripts/update_gcs_feature_flags.sh Outdated Show resolved Hide resolved
server/lib/util.py Show resolved Hide resolved
@gmechali gmechali requested a review from dwnoble January 23, 2025 23:42
@gmechali gmechali merged commit 1e667ee into datacommonsorg:master Jan 24, 2025
9 checks passed
@gmechali gmechali deleted the rollout2 branch January 24, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants