Skip to content

variations update should now properly accept feature keys as an arg#199

Merged
elliotCamblor merged 2 commits into
mainfrom
DVC-8074-variations-update-feature-key
Jul 4, 2023
Merged

variations update should now properly accept feature keys as an arg#199
elliotCamblor merged 2 commits into
mainfrom
DVC-8074-variations-update-feature-key

Conversation

@elliotCamblor
Copy link
Copy Markdown
Contributor

No description provided.

@elliotCamblor elliotCamblor requested a review from a team June 30, 2023 20:01
Comment thread src/commands/variations/update.ts Outdated
selectedVariation = await fetchVariationByKey(this.authToken, this.projectKey, featureKey, args.key)
}

const feature = await fetchFeatureByKey(this.authToken, this.projectKey, featureKey)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we just do this if we're not using the feature prompt? otherwise we're fetching the feature from the api twice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I still need to fetch even if were not using the feature prompt, since the feature prompt doesnt return the full feature. I made a ticket to refactor that because the prompt is being used in several different places

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Won't the request to fetch the variables associated with the feature already return an error like this if the key is invalid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I think youre right. Pretty sure I got baited by typescript here

@elliotCamblor elliotCamblor force-pushed the DVC-8074-variations-update-feature-key branch from 98aabfc to 9c6a7cd Compare July 4, 2023 14:14
@elliotCamblor elliotCamblor requested a review from laurawarr July 4, 2023 14:31
this.authToken,
this.projectKey,
featureKey,
feature._id,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems like it would be an API bug, all the endpoints should accept either a key or an ID 🤔

Copy link
Copy Markdown
Contributor

@laurawarr laurawarr Jul 4, 2023

Choose a reason for hiding this comment

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

ohhh, I see the error is coming from the variables request, not the variations request

Copy link
Copy Markdown
Contributor Author

@elliotCamblor elliotCamblor Jul 4, 2023

Choose a reason for hiding this comment

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

Even for query params? This field in the query params class has a decorater called isObjectIDorFalse which makes it seem intentional

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Im just not sure why 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally all values could be accepted as keys, I'm assuming we made this choice to avoid querying the feature by key just to build the variable query params. We could consider updating the API, but that's out of scope of this work 😛

@elliotCamblor elliotCamblor force-pushed the DVC-8074-variations-update-feature-key branch from 9c6a7cd to 20bcb5e Compare July 4, 2023 14:46
@elliotCamblor elliotCamblor merged commit aeef0db into main Jul 4, 2023
@elliotCamblor elliotCamblor deleted the DVC-8074-variations-update-feature-key branch July 4, 2023 15:03
jonathannorris added a commit that referenced this pull request May 6, 2026
- postcss <8.5.10 -> ^8.5.10 (resolves to 8.5.14) (medium, alert #199)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants