[build-tools] Add eas/posthog_flag_rollout workflow function#3944
Draft
gwdp wants to merge 1 commit into
Draft
Conversation
c50c7ce to
4f8d88f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## gwdp/eng-21551-posthog-capture-event #3944 +/- ##
========================================================================
+ Coverage 59.33% 59.33% +0.01%
========================================================================
Files 937 938 +1
Lines 41144 41223 +79
Branches 8671 8685 +14
========================================================================
+ Hits 24407 24454 +47
- Misses 16643 16674 +31
- Partials 94 95 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4f8d88f to
17c3b91
Compare
c08213f to
0d8006c
Compare
17c3b91 to
3745235
Compare
|
✅ Thank you for adding the changelog entry! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Manage a PostHog feature flag straight from an EAS workflow. Flip it on or ramp its rollout as part of a deploy, instead of doing it by hand in PostHog.
How
Adds
eas/posthog_flag_rollout. It uses the personal API key fromintegrations:posthog:connect(POSTHOG_CLI_API_KEY/POSTHOG_CLI_PROJECT_ID), or theapi_key/project_idinputs. There's nohostinput on purpose, so the personal key only ever goes toPOSTHOG_CLI_HOST.The
rollout_percentageinput updates the flag's catch-all release condition and leaves targeted groups alone. Failures fail the step. Setignore_error: trueto log a warning and continue instead. Bad inputs, unknown flags and 403 scope errors always fail. Lookup and update aren't atomic, so a parallel dashboard edit can be lost.Test Plan
CI passes. Enabled a real flag from a local run with this workflow. It needs a personal key with feature-flag scopes. The last job fails the lookup on purpose and just warns.
Test workflow
Examples
These are simple workflows just to exercise the step. More fun and useful ones, mixed with EAS Update and deploys, are coming in the docs.
Ship a feature behind a flag
Publish the update, then enable the flag at 10% once the code is out.
Kill switch
Disable the flag, record an audit event, and leave a note on the run.