feat: added stale comment for stale features in generate types#452
feat: added stale comment for stale features in generate types#452
Conversation
6b4e36d to
09cc8de
Compare
| readonly: z.boolean(), | ||
| settings: FeatureSettings.partial().optional(), | ||
| sdkVisibility: FeatureSDKVisibility.optional(), | ||
| staleness: z |
There was a problem hiding this comment.
we really shouldn't manually update this zodClient.ts file as it's generated from scripts/generate-zodios-client.sh. I have a background agent working on updating that script and fixing all the new type errors, but it will be a larger PR.
09cc8de to
0b33c52
Compare
| if (reason === 'unused') { | ||
| return variable.defaultValue | ||
| } else if (reason === 'released') { | ||
| if (feature.staleness?.metaData?.releaseVariation) { |
There was a problem hiding this comment.
if there is no released variation, maybe select the one with the highest distribution % or number of evaluations if we can fetch that?
There was a problem hiding this comment.
would maybe like to add that as metadata from the backend instead of figuring out here in the cli
0b33c52 to
3a6c4b0
Compare
3a6c4b0 to
9449e95
Compare
src/commands/generate/types.ts
Outdated
| ) | ||
|
|
||
| this.features = [ | ||
| ...(await fetchAllCompletedOrArchivedFeatures( |
There was a problem hiding this comment.
promise.all these two so we its not a waterfall
9449e95 to
185b25a
Compare
src/commands/generate/types.ts
Outdated
| this.authToken, | ||
| this.projectKey, | ||
| ) | ||
| this.features = await Promise.all([ |
There was a problem hiding this comment.
nit:
instead of the .then() you can just get the completedFeatures and staleFeatures as a return value and then have the this.features be a spread of both like you had before
185b25a to
b2eb873
Compare
b2eb873 to
3412ad1
Compare
3412ad1 to
d4ad87d
Compare
Changes