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: Improve versioned change requests to handle multiple open CRs for single feature #4245

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Jun 26, 2024

Changes

This PR is the 'Core' part of the resolution to #4145.

In this PR, I've added most of the business logic which hinges on the VersionChangeSet model. This model is created alongside a change request (as per the code in this workflows PR) and holds the information about the changes that should be applied when the change request is published (or goes live if it's scheduled).

The reason for this is to remove the need to duplicate the version when a change request is created, resulting in conflicts / clobbering of changes that happen between PR creation and publish.

As part of this work, however, we need to account for the fact that there could still be conflicts, they're just less likely and less destructive. The conflict behaviour here checks if changes have been made to the same component of a feature in a given environment (e.g. a specific segment override, or the environment default value). These conflicts are then surfaced by the FE to provide visibility.

How did you test this code?

I've added enough tests in this repository to satisfy the coverage requirements, but a lot of the testing has been done via full integration tests in the flagsmith-workflows PR here.

Copy link

vercel bot commented Jun 26, 2024

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 Jul 23, 2024 4:36pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jul 23, 2024 4:36pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jul 23, 2024 4:36pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jun 26, 2024
Copy link
Contributor

github-actions bot commented Jun 26, 2024

Uffizzi Preview deployment-53519 was deleted.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jun 26, 2024
@matthewelwell matthewelwell marked this pull request as ready for review June 26, 2024 11:44
@matthewelwell matthewelwell requested a review from a team as a code owner June 26, 2024 11:44
@matthewelwell matthewelwell requested review from zachaysan and removed request for a team June 26, 2024 11:44
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jun 26, 2024
@matthewelwell matthewelwell marked this pull request as draft June 26, 2024 11:45
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.81%. Comparing base (0390075) to head (f17678b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4245      +/-   ##
==========================================
+ Coverage   96.79%   96.81%   +0.02%     
==========================================
  Files        1162     1165       +3     
  Lines       38248    38508     +260     
==========================================
+ Hits        37021    37281     +260     
  Misses       1227     1227              

☔ 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 Jun 26, 2024
@matthewelwell matthewelwell removed the request for review from zachaysan June 26, 2024 11:55
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 8, 2024
@matthewelwell matthewelwell marked this pull request as ready for review July 8, 2024 10:16
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 8, 2024
Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-frontend image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-frontend:pr-4245 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-api image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api:pr-4245 Finished ✅ Results

@github-actions github-actions bot added the feature New feature or request label Jul 23, 2024
@matthewelwell matthewelwell force-pushed the feat(versioning)/handle-multiple-change-requests-for-single-feature branch from 17cabe9 to dc23c92 Compare July 23, 2024 10:48
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 23, 2024
@matthewelwell matthewelwell force-pushed the feat(versioning)/handle-multiple-change-requests-for-single-feature branch from dc23c92 to c74be59 Compare July 23, 2024 10:57
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 23, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 23, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 23, 2024
@matthewelwell matthewelwell force-pushed the feat(versioning)/handle-multiple-change-requests-for-single-feature branch from 6300a7f to f17678b Compare July 23, 2024 16:36
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jul 23, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Jul 23, 2024
Merged via the queue into main with commit f1cc8d8 Jul 23, 2024
34 checks passed
@matthewelwell matthewelwell deleted the feat(versioning)/handle-multiple-change-requests-for-single-feature branch July 23, 2024 16:54
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.

None yet

3 participants