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: Create change requests for segments #4265

Open
wants to merge 138 commits into
base: main
Choose a base branch
from

Conversation

zachaysan
Copy link
Contributor

@zachaysan zachaysan commented Jun 28, 2024

Changes

This PR works in concert with this other PR on the workflows repo.

This PR introduces many changes to support the addition of segments in change requests. The primary logic around transferring change request segment data into the target segment data involves re-using logic that was originally written for the segment versioning.

Due to the primary manager (.objects) now including versioned or change requested segments copies, some amount of work was necessary to get all the aspects of the existing code to pass. The .live_objects manager is used for segments that are not merely versions or change request segments but in some places manually filtering segments was the only solution.

How did you test this code?

Added tests across the test suite, including new tests for duplicate segments to test filtering, as well as tests located in with the other workflows PR to get coverage of edge cases.

@zachaysan zachaysan requested a review from a team as a code owner June 28, 2024 14:34
@zachaysan zachaysan requested review from khvn26 and removed request for a team June 28, 2024 14:34
Copy link

vercel bot commented Jun 28, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 7:49pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 7:49pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 7:49pm

@zachaysan zachaysan removed the request for review from khvn26 June 28, 2024 14:35
@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jun 28, 2024
Copy link
Contributor

github-actions bot commented Jun 28, 2024

Uffizzi Ephemeral Environment deployment-53620

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4265

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.35%. Comparing base (4a310b0) to head (ce7fca8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4265      +/-   ##
==========================================
+ Coverage   97.33%   97.35%   +0.02%     
==========================================
  Files        1182     1187       +5     
  Lines       41267    41245      -22     
==========================================
- Hits        40167    40156      -11     
+ Misses       1100     1089      -11     

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

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 1, 2024
@github-actions github-actions bot removed the feature New feature or request label Jul 17, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 23, 2024
@zachaysan
Copy link
Contributor Author

Added a couple of minor comments, but this looks good on the whole. I guess the only question I have is whether there should also be a bunch of removed code here based on the stuff we moved to the flagsmith-common repo?

Ok it took a while, but I've updated the repo with references to the flagsmith-common repo and of course removed the now unnecessary code.

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Added a few minor comments

api/permissions/migrations/0001_initial.py Outdated Show resolved Hide resolved
@@ -196,7 +196,7 @@ flagsmith-ldap = { git = "https://github.com/flagsmith/flagsmith-ldap", tag = "v
optional = true

[tool.poetry.group.workflows.dependencies]
workflows-logic = { git = "https://github.com/flagsmith/flagsmith-workflows", tag = "v2.5.0" }
workflows-logic = { git = "https://github.com/flagsmith/flagsmith-workflows", branch = "feat/add_change_requests_to_segments" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder that we'll need to update this before the merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup!

api/segments/views.py Show resolved Hide resolved
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

This all looks good to me now - there's just the (new?) conflicts to resolve, and the CI failures.

@zachaysan
Copy link
Contributor Author

This all looks good to me now - there's just the (new?) conflicts to resolve, and the CI failures.

Conflicts and CI failures have been resolved. Are we good to merge (other than the update to the workflows repo which needs to be merged itself)?

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

I'm approving this now, but we need to consider the release plan as this is quite a meaty change. It will need a fair amount of regression testing in staging.

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.

Change requests for segments
4 participants