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

fix: found an edge case exporting variants #2900

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

gastonfournier
Copy link
Contributor

About the changes

When exporting v3, for variants backward compatibility, we need to find one featureEnvironment and fetch variants from there.
In cases where the default environment is disabled (therefore does not get variants per environment when added), it can be still be selected for the export process. Therefore variants don't appear in the feature when they should be there.

An e2e test that fails with the previous implementation was added to validate the behavior

This comes from our support ticket 404

@vercel
Copy link

vercel bot commented Jan 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
unleash-docs ⬜️ Ignored (Inspect) Jan 13, 2023 at 11:26AM (UTC)
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Jan 13, 2023 at 11:26AM (UTC)

@gastonfournier gastonfournier self-assigned this Jan 13, 2023
(fe) => fe.featureName === f.name,
)?.variants;
const variants = featureAndEnvs
.sort((e1, e2) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sorting of the environments is not absolute, it depends on whether the feature in a particular project has that environment active or not plus the other conditions.

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G

@gastonfournier gastonfournier merged commit 005e5b1 into main Jan 13, 2023
@gastonfournier gastonfournier deleted the fix-export-when-default-project-is-disabled branch January 13, 2023 13:56
gastonfournier pushed a commit that referenced this pull request Jan 13, 2023
## About the changes
When exporting v3, for variants backward compatibility, we need to find
one featureEnvironment and fetch variants from there.
In cases where the default environment is disabled (therefore does not
get variants per environment when added), it can be still be selected
for the export process. Therefore variants don't appear in the feature
when they should be there.

An e2e test that fails with the previous implementation was added to
validate the behavior

This comes from our support ticket 404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants