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(versioning): add logic to create version in single endpoint #3991

Merged

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented May 21, 2024

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

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This PR updates the endpoint to create a new version to add new attributes that allow you to create, update and delete feature states when creating the new version and optionally publish it immediately. This will avoid the FE having to create the version, retrieve the feature states, update any necessary feature states and then publish it.

I'm keen to get feedback on the naming of the new fields as I'm not 100% pleased with them. The endpoint looks like this:

image

How did you test this code?

Added tests to cover all the use cases.

Copy link

vercel bot commented May 21, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 10:45am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 10:45am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 10:45am

@github-actions github-actions bot added the api Issue related to the REST API label May 21, 2024
Copy link
Contributor

github-actions bot commented May 21, 2024

Uffizzi Preview deployment-52072 was deleted.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.54%. Comparing base (22d371b) to head (ce87fe0).
Report is 103 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3991      +/-   ##
==========================================
+ Coverage   96.44%   96.54%   +0.10%     
==========================================
  Files        1149     1177      +28     
  Lines       37575    38507     +932     
==========================================
+ Hits        36238    37176     +938     
+ Misses       1337     1331       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ate-in-single-endpoint

# Conflicts:
#	api/features/versioning/serializers.py
#	api/features/versioning/views.py
@matthewelwell
Copy link
Contributor Author

I've now tested this PR against the FE branch here and confirmed that everything seems to work well.

I used the Uffizzi deployment to do this too which was a good test latency-wise because the Uffizzi deployment runs somewhere in the US. It was noticeable that the latency was greatly improved when changing the state of the flag compared even to making a change in production SaaS from London.

Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

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

Changes look good!

@matthewelwell matthewelwell requested a review from a team as a code owner June 24, 2024 10:45
@matthewelwell matthewelwell requested review from gagantrivedi and removed request for a team June 24, 2024 10:45
@github-actions github-actions bot added the feature New feature or request label Jun 24, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit 57f8d68 Jun 24, 2024
31 checks passed
@matthewelwell matthewelwell deleted the feat(versioning)/add-logic-to-create-in-single-endpoint branch June 24, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants