feat: Add support for opt-in and opt-out in Workflow History V2 feature flag#1132
Merged
adhityamamallan merged 8 commits intocadence-workflow:masterfrom Jan 14, 2026
Merged
Conversation
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
4cff4ef to
2c5894e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Workflow History V2 feature flag from a simple boolean to an enum with four states (DISABLED, OPT_IN, OPT_OUT, ENABLED), enabling a gradual rollout strategy with user opt-in/opt-out capabilities. The implementation introduces a new custom hook that combines the config value with localStorage to track user preferences, and refactors the component structure to separate concerns.
Key changes:
- Feature flag now supports DISABLED, OPT_IN, OPT_OUT, and ENABLED modes
- New
useIsWorkflowHistoryV2Enabledhook manages state based on config and localStorage - Component architecture refactored to move version-switching logic to a dedicated
WorkflowHistoryComponent
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/config/dynamic/resolvers/history-page-v2-enabled-values.config.ts |
Defines the four valid enum values for the feature flag |
src/config/dynamic/resolvers/history-page-v2-enabled.types.ts |
Exports TypeScript type for the enum values |
src/config/dynamic/resolvers/history-page-v2-enabled.ts |
Updates resolver to return enum instead of boolean, with env var validation |
src/config/dynamic/resolvers/schemas/resolver-schemas.ts |
Updates Zod schema to validate enum instead of boolean |
src/config/dynamic/dynamic.config.ts |
Updates type definition for the config value |
src/utils/config/__fixtures__/resolved-config-values.ts |
Updates mock fixture from false to 'DISABLED' |
src/views/workflow-history-v2/hooks/use-is-workflow-history-v2-enabled.ts |
New hook that determines enabled state based on config and localStorage |
src/views/workflow-history-v2/hooks/__tests__/use-is-workflow-history-v2-enabled.test.tsx |
Comprehensive test coverage for the new hook |
src/views/workflow-history/workflow-history-context-provider/workflow-history-context-provider.types.ts |
Adds v2 enabled state fields to context type |
src/views/workflow-history/workflow-history-context-provider/workflow-history-context-provider.tsx |
Integrates the new hook into the context provider |
src/views/workflow-history/workflow-history-context-provider/__tests__/workflow-history-context-provider.test.tsx |
Mocks the new hook in existing tests |
src/views/workflow-history/workflow-history-wrapper/workflow-history-wrapper.tsx |
Simplified to delegate version-switching logic to child component |
src/views/workflow-history/workflow-history-wrapper/__tests__/workflow-history-wrapper.test.tsx |
Deleted - tests moved to new component |
src/views/workflow-history/workflow-history-component/workflow-history-component.tsx |
New component that handles version switching based on context |
src/views/workflow-history/workflow-history-component/__tests__/workflow-history-component.test.tsx |
Tests for the new component's conditional rendering |
src/views/workflow-history/config/workflow-history-user-preferences.config.ts |
Adds localStorage config for v2 enabled preference |
src/views/workflow-history/__tests__/workflow-history.test.tsx |
Updates test mocks to include new context fields |
src/views/workflow-history-v2/__tests__/workflow-history-v2.test.tsx |
Updates test mocks to include new context fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/views/workflow-history-v2/hooks/use-is-workflow-history-v2-enabled.ts
Outdated
Show resolved
Hide resolved
src/views/workflow-history-v2/hooks/use-is-workflow-history-v2-enabled.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Assem-Uber
reviewed
Jan 14, 2026
src/views/workflow-history-v2/__tests__/workflow-history-v2.test.tsx
Outdated
Show resolved
Hide resolved
src/views/workflow-history-v2/hooks/use-is-workflow-history-v2-enabled.ts
Outdated
Show resolved
Hide resolved
...orkflow-history/workflow-history-context-provider/workflow-history-context-provider.types.ts
Outdated
Show resolved
Hide resolved
Assem-Uber
approved these changes
Jan 14, 2026
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
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.
Summary
HISTORY_PAGE_V2_ENABLEDfeature flag from simple boolean to enum, to support special behaviour for opting in to and opting out from Workflow History V2useIsWorkflowHistoryV2Selectedthat uses the feature flag value and combines it with local storage to decide if History V2 is selectedisWorkflowHistoryV2Selectedinto Workflow History ContextTest plan
Updated unit tests + tested in follow-up #1133