Skip to content

refactor: Refactor segment cloning - #5898

Merged
emyller merged 12 commits into
mainfrom
refactor/segment-cloning
Aug 11, 2025
Merged

refactor: Refactor segment cloning#5898
emyller merged 12 commits into
mainfrom
refactor/segment-cloning

Conversation

@emyller

@emyller emyller commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Contributes to #5771.

Warning

Blocked by #5769.

  • 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

  • Refactor segment cloning.
  • Ensure committing a change request will apply its draft segments.

How did you test this code?

  • Updated existing unit tests.
  • New unit tests.

Note

The segment fixture was also creating a revision of the generated segment, for a reason I can't make peace with. That was removed. I'm sorry segment version numbers are shifted -1 in tests, but things should be clearer now I hope.

@emyller emyller self-assigned this Aug 6, 2025
@emyller
emyller requested a review from a team as a code owner August 6, 2025 00:02
@emyller
emyller requested review from matthewelwell and removed request for a team August 6, 2025 00:02
@vercel

vercel Bot commented Aug 6, 2025

Copy link
Copy Markdown

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2025 4:50pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2025 4:50pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2025 4:50pm

@github-actions github-actions Bot added api Issue related to the REST API refactor labels Aug 6, 2025
@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-5898 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-5898 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5898 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5898 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5898 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5898 Finished ✅ Results

@github-actions github-actions Bot added refactor and removed refactor labels Aug 6, 2025
@codecov

codecov Bot commented Aug 6, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (ad90f59) to head (acb8e76).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5898    +/-   ##
========================================
  Coverage   97.83%   97.83%            
========================================
  Files        1259     1258     -1     
  Lines       44904    44630   -274     
========================================
- Hits        43932    43664   -268     
+ Misses        972      966     -6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emyller
emyller force-pushed the refactor/segment-cloning branch from 3a11ead to 321d9aa Compare August 6, 2025 23:22
@github-actions github-actions Bot added refactor and removed refactor labels Aug 6, 2025
@emyller
emyller force-pushed the refactor/segment-cloning branch from 321d9aa to 1c140d5 Compare August 7, 2025 12:56
@github-actions github-actions Bot added refactor and removed refactor labels Aug 7, 2025
@matthewelwell
matthewelwell requested review from a team and Zaimwa9 and removed request for a team and matthewelwell August 7, 2025 13:23
@github-actions github-actions Bot removed the refactor label Aug 7, 2025

@Zaimwa9 Zaimwa9 left a comment

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.

Good job overall, too bad we didn't go this way earlier.

I have a couple of comments, mostly related to the order of setting version -> copying rules. The lifecycle related one is the most important to double check imo.

Comment thread api/conftest.py Outdated
Comment thread api/segments/models.py
Comment thread api/segments/models.py
Comment thread api/segments/models.py
Comment thread api/core/workflows_services.py
Comment thread api/tests/unit/segments/test_unit_segments_models.py Outdated
@github-actions github-actions Bot added refactor and removed refactor labels Aug 8, 2025
@github-actions github-actions Bot added refactor and removed refactor labels Aug 8, 2025
@emyller
emyller merged commit 7082001 into main Aug 11, 2025
29 checks passed
@emyller
emyller deleted the refactor/segment-cloning branch August 11, 2025 15:04
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 refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants