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
fixed segments not being copied #2105
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
# Conflicts: # src/lib/__snapshots__/create-config.test.ts.snap
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like a test to see that we return the expected data on the features call
@@ -70,6 +71,8 @@ export class PublicInviteController extends Controller { | |||
openApiService.validPath({ | |||
tags: ['Public signup tokens'], | |||
operationId: 'addPublicSignupTokenUser', | |||
summary: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure if the schema updates for public-invite belongs in this PR. Fine for now, but we should aim to separate PR concerns in the future
if (segments && segments.length > 0) { | ||
result = { | ||
...result, | ||
segments: segments.map((segment) => segment.id), | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test that validates that this gives the correct result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if there are no segments defined, should we return an empty array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added one here https://github.com/ivarconr/unleash-enterprise/pull/138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreas-unleash It seems this is not reflected in the specification, at least I can't see a spec update for this data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
* fixed segments not being copied * fix fmt * bug fix * return segmentId[] when getting a feature strategy * do not return segments if they are not there * Update src/lib/services/feature-toggle-service.ts Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com> * fix lint * fix: more explicit column sorting and bug fix * update snapshot * rollback * add segment ids to feature strategies * bug fix Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
Currently when you tried to copy a strategy (or all strategies) from one env to another, the segments where not being copied as expected.
This PR fixes the bug by adding an optional
copyOf
parameter in the CreateFeatureStrategy schema, so that the handling of copying the segments over is moved to the backendThe need for handling this this way was created by the desired functionality of copying all strategies from one env to another
About the changes
Closes # .
Important files
Discussion points