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

feat(feature-states/segments): Add get_by_uuid, and id #1718

Merged
merged 5 commits into from
Dec 5, 2022

Conversation

gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Nov 30, 2022

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?

Changes

Add api to fetch feature_state with uuid
Add api to fetch feture segment with id

How did you test this code?

adds unit test case to cover the change

@gagantrivedi gagantrivedi changed the title feat(feature-states): Add get_by_uuid feat(feature-states/segments): Add get_by_uuid, and id Nov 30, 2022
base_url = reverse(
"api-v1:features:get-feature-state-by-uuid", args=[feature_state.uuid]
)
url = f"{base_url}?environment={environment}"
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're getting the feature state by uuid I'm a bit unclear why we need the environment query parameter here?

qs = (
FeatureState.objects.filter(feature__project__in=accessible_projects)
.select_related("feature_state_value")
.prefetch_related("multivariate_feature_state_values")
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is a request for a single object, I don't think the prefetch related actually adds anything does it?

@gagantrivedi gagantrivedi force-pushed the feat/feature-state/get-by--uuid branch from a8018ea to 9de56d4 Compare December 1, 2022 08:55
@gagantrivedi gagantrivedi merged commit daefe13 into main Dec 5, 2022
@gagantrivedi gagantrivedi deleted the feat/feature-state/get-by--uuid branch December 5, 2022 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants