Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
63a1e16 to
490464c
Compare
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/experiment-complete-rollout-decision #9021 +/- ##
==========================================================================
Coverage 98.93% 98.93%
==========================================================================
Files 1714 1714
Lines 72685 72685
==========================================================================
Hits 71908 71908
Misses 777 777 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
5 issues found across 18 files
Confidence score: 3/5
- In
CompleteExperimentModal.tsx, a failed Bayesian-results request can be treated as no results and silently roll out control during irreversible completion. Handle the results error separately and block completion. - In
CompleteExperimentModal.tsx, an environment request failure leaves the modal loading forever with no error or retry path. Render an error state when the environment cannot load. - In
VariantChoiceRow.tsx, long or unbroken variant values can widen the completion UI instead of wrapping. Add a wrapping or min-width constraint to the value element. - In
SelectableCard.tsx, a disabled card’s footer control can still receive keyboard focus. Make the footer inert when the card is disabled.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/web/components/base/SelectableCard/SelectableCard.tsx">
<violation number="1" location="frontend/web/components/base/SelectableCard/SelectableCard.tsx:80">
P3: The footer slot drops numeric zero because `footer` is checked for truthiness. Preserve valid ReactNode values such as `0` when deciding whether to render the footer wrapper.</violation>
<violation number="2" location="frontend/web/components/base/SelectableCard/SelectableCard.tsx:80">
P2: A disabled card can still expose an interactive footer control to keyboard users because `disabled` only reaches the body button and `pointer-events: none` does not prevent sequential focus. Mark the footer inert when `disabled` is true.</violation>
</file>
<file name="frontend/web/components/experiments/CompleteExperimentModal/VariantChoiceRow.tsx">
<violation number="1" location="frontend/web/components/experiments/CompleteExperimentModal/VariantChoiceRow.tsx:13">
P2: Long or unbroken variant values can overflow this flex row and widen the completion UI instead of wrapping. Add a wrapping/min-width constraint to the value element.</violation>
</file>
<file name="frontend/web/components/experiments/CompleteExperimentModal/CompleteExperimentModal.tsx">
<violation number="1" location="frontend/web/components/experiments/CompleteExperimentModal/CompleteExperimentModal.tsx:34">
P1: A failed Bayesian-results request is treated as a successful no-results response, so the modal can silently roll out control during an irreversible completion. Handle the results error separately and block completion with an error state.</violation>
<violation number="2" location="frontend/web/components/experiments/CompleteExperimentModal/CompleteExperimentModal.tsx:36">
P2: A failed environment request leaves this modal showing a loader forever with no error or retry path. Destructure the query error state and render an error state when the environment cannot load.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
| }) => { | ||
| const params = { environmentId, experimentId } | ||
| const { data: experiment, isError } = useGetExperimentQuery(params) | ||
| const { data: bayesianResults, isLoading: isLoadingResults } = |
There was a problem hiding this comment.
P1: A failed Bayesian-results request is treated as a successful no-results response, so the modal can silently roll out control during an irreversible completion. Handle the results error separately and block completion with an error state.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/experiments/CompleteExperimentModal/CompleteExperimentModal.tsx, line 34:
<comment>A failed Bayesian-results request is treated as a successful no-results response, so the modal can silently roll out control during an irreversible completion. Handle the results error separately and block completion with an error state.</comment>
<file context>
@@ -0,0 +1,144 @@
+}) => {
+ const params = { environmentId, experimentId }
+ const { data: experiment, isError } = useGetExperimentQuery(params)
+ const { data: bayesianResults, isLoading: isLoadingResults } =
+ useGetExperimentBayesianResultsQuery(params)
+ const { data: environment } = useGetEnvironmentQuery({ id: environmentId })
</file context>
| const VariantChoiceRow: FC<VariantChoiceRowProps> = ({ choice }) => ( | ||
| <div className='d-flex align-items-center gap-2'> | ||
| <VariantName colour={choice.colour} name={choice.name} /> | ||
| <code>{choice.value}</code> |
There was a problem hiding this comment.
P2: Long or unbroken variant values can overflow this flex row and widen the completion UI instead of wrapping. Add a wrapping/min-width constraint to the value element.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/experiments/CompleteExperimentModal/VariantChoiceRow.tsx, line 13:
<comment>Long or unbroken variant values can overflow this flex row and widen the completion UI instead of wrapping. Add a wrapping/min-width constraint to the value element.</comment>
<file context>
@@ -0,0 +1,22 @@
+const VariantChoiceRow: FC<VariantChoiceRowProps> = ({ choice }) => (
+ <div className='d-flex align-items-center gap-2'>
+ <VariantName colour={choice.colour} name={choice.name} />
+ <code>{choice.value}</code>
+ {choice.chanceToWin !== null && (
+ <span className='ms-auto text-secondary fs-caption'>
</file context>
| const { data: experiment, isError } = useGetExperimentQuery(params) | ||
| const { data: bayesianResults, isLoading: isLoadingResults } = | ||
| useGetExperimentBayesianResultsQuery(params) | ||
| const { data: environment } = useGetEnvironmentQuery({ id: environmentId }) |
There was a problem hiding this comment.
P2: A failed environment request leaves this modal showing a loader forever with no error or retry path. Destructure the query error state and render an error state when the environment cannot load.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/experiments/CompleteExperimentModal/CompleteExperimentModal.tsx, line 36:
<comment>A failed environment request leaves this modal showing a loader forever with no error or retry path. Destructure the query error state and render an error state when the environment cannot load.</comment>
<file context>
@@ -0,0 +1,144 @@
+ const { data: experiment, isError } = useGetExperimentQuery(params)
+ const { data: bayesianResults, isLoading: isLoadingResults } =
+ useGetExperimentBayesianResultsQuery(params)
+ const { data: environment } = useGetEnvironmentQuery({ id: environmentId })
+ const [completeExperiment, { isLoading: isCompleting }] =
+ useCompleteExperimentMutation()
</file context>
| )} | ||
| </BareButton> | ||
| </BareButton> | ||
| {footer && <div className='px-3 pb-3'>{footer}</div>} |
There was a problem hiding this comment.
P2: A disabled card can still expose an interactive footer control to keyboard users because disabled only reaches the body button and pointer-events: none does not prevent sequential focus. Mark the footer inert when disabled is true.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/base/SelectableCard/SelectableCard.tsx, line 80:
<comment>A disabled card can still expose an interactive footer control to keyboard users because `disabled` only reaches the body button and `pointer-events: none` does not prevent sequential focus. Mark the footer inert when `disabled` is true.</comment>
<file context>
@@ -43,34 +46,39 @@ const SelectableCard: FC<SelectableCardProps> = ({
- )}
- </BareButton>
+ </BareButton>
+ {footer && <div className='px-3 pb-3'>{footer}</div>}
+ </div>
)
</file context>
| {footer && <div className='px-3 pb-3'>{footer}</div>} | |
| {footer && ( | |
| <div className='px-3 pb-3' inert={disabled || undefined}> | |
| {footer} | |
| </div> | |
| )} |
| )} | ||
| </BareButton> | ||
| </BareButton> | ||
| {footer && <div className='px-3 pb-3'>{footer}</div>} |
There was a problem hiding this comment.
P3: The footer slot drops numeric zero because footer is checked for truthiness. Preserve valid ReactNode values such as 0 when deciding whether to render the footer wrapper.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/base/SelectableCard/SelectableCard.tsx, line 80:
<comment>The footer slot drops numeric zero because `footer` is checked for truthiness. Preserve valid ReactNode values such as `0` when deciding whether to render the footer wrapper.</comment>
<file context>
@@ -43,34 +46,39 @@ const SelectableCard: FC<SelectableCardProps> = ({
- )}
- </BareButton>
+ </BareButton>
+ {footer && <div className='px-3 pb-3'>{footer}</div>}
+ </div>
)
</file context>
| {footer && <div className='px-3 pb-3'>{footer}</div>} | |
| {(footer || footer === 0) && <div className='px-3 pb-3'>{footer}</div>} |
❌ private-cloud · depot-ubuntu-latest-16 — run #23481 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Failed testsfirefox › tests/environment-permission-test.pw.ts › Environment Permission Tests › Environment-level permissions control access to features, identities, and segments @enterprise 🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23481 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #23481 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Skipped testsfirefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss ✅ oss · depot-ubuntu-latest-arm-16 — run #23481 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23477 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #23477 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #23477 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #23477 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
|
There was a problem hiding this comment.
1 issue found across 18 files
Confidence score: 5/5
utils.test.tsdoes not cover the turn-flag-off completion path, so regressions in its payload could go unnoticed. Add adisablecase.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/web/components/experiments/CompleteExperimentModal/__tests__/utils.test.ts">
<violation number="1" location="frontend/web/components/experiments/CompleteExperimentModal/__tests__/utils.test.ts:77">
P2: The “turn flag off” completion path has no test here. Add a `disable` case so regressions in the payload for this user-visible decision are caught.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
| it.each<[RolloutSelection, object]>([ | ||
| [{ decision: 'control', variantId: 10 }, { rollout_decision: 'control' }], | ||
| [ | ||
| { decision: 'variant', variantId: 10 }, | ||
| { rollout_decision: 'variant', rollout_variant: 10 }, | ||
| ], | ||
| ])('%o', (selection, expected) => { | ||
| expect(buildCompleteExperimentBody(selection)).toEqual(expected) |
There was a problem hiding this comment.
P2: The “turn flag off” completion path has no test here. Add a disable case so regressions in the payload for this user-visible decision are caught.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/experiments/CompleteExperimentModal/__tests__/utils.test.ts, line 77:
<comment>The “turn flag off” completion path has no test here. Add a `disable` case so regressions in the payload for this user-visible decision are caught.</comment>
<file context>
@@ -0,0 +1,86 @@
+})
+
+describe('buildCompleteExperimentBody', () => {
+ it.each<[RolloutSelection, object]>([
+ [{ decision: 'control', variantId: 10 }, { rollout_decision: 'control' }],
+ [
</file context>
| it.each<[RolloutSelection, object]>([ | |
| [{ decision: 'control', variantId: 10 }, { rollout_decision: 'control' }], | |
| [ | |
| { decision: 'variant', variantId: 10 }, | |
| { rollout_decision: 'variant', rollout_variant: 10 }, | |
| ], | |
| ])('%o', (selection, expected) => { | |
| expect(buildCompleteExperimentBody(selection)).toEqual(expected) | |
| it.each<[RolloutSelection, object]>([ | |
| [{ decision: 'control', variantId: 10 }, { rollout_decision: 'control' }], | |
| [ | |
| { decision: 'variant', variantId: 10 }, | |
| { rollout_decision: 'variant', rollout_variant: 10 }, | |
| ], | |
| [{ decision: 'disable', variantId: 10 }, { rollout_decision: 'disable' }], | |
| ])('%o', (selection, expected) => | |
| expect(buildCompleteExperimentBody(selection)).toEqual(expected), | |
| ) |
Visual Regression24 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to https://linear.app/flagsmith/issue/ENG-663/what-happens-to-rollout-when-an-experiment-ends
SelectableCardgets afooterslot so the variant dropdown sits inside the card. Stacked on feat(experimentation): decide the rollout when completing an experiment #9018.How did you test this code?
Unit tests, plus a local end-to-end run against #9018 in light and dark mode (each decision, one and several variants).