Skip to content

V2 track dependencies #4210

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

Draft
wants to merge 6 commits into
base: v2
Choose a base branch
from
Draft

V2 track dependencies #4210

wants to merge 6 commits into from

Conversation

markphelps
Copy link
Collaborator

re: #4183

This adds a per env DependencyGraph that is build on each snapshot build. This allows us to track what is dependent on what, ie segments that are in use in rules/rollouts.

Then we can check when the user goes to delete if they are allowed to or not:

CleanShot 2025-05-15 at 13 19 22@2x

This is just a POC, I will likely clean this up and make the API a bit better for creating dependencies, but wanted to put it out there to get feedback

/cc @erka

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 78.26087% with 35 lines in your changes missing coverage. Please review.

Please upload report for BASE (v2@9707b80). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/storage/fs/snapshot.go 68.29% 11 Missing and 2 partials ⚠️
internal/storage/environments/fs/flipt/flags.go 70.00% 5 Missing and 1 partial ⚠️
internal/storage/environments/graph/dependency.go 93.05% 4 Missing and 1 partial ⚠️
cmd/flipt/validate.go 0.00% 4 Missing ⚠️
internal/storage/environments/environments.go 0.00% 4 Missing ⚠️
internal/storage/environments/git/store.go 0.00% 2 Missing ⚠️
internal/storage/environments/fs/flipt/segments.go 94.44% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #4210   +/-   ##
=====================================
  Coverage      ?   49.95%           
=====================================
  Files         ?      120           
  Lines         ?    12014           
  Branches      ?        0           
=====================================
  Hits          ?     6001           
  Misses        ?     5557           
  Partials      ?      456           
Flag Coverage Δ
unittests 49.95% <78.26%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@@ -594,6 +629,12 @@ func (s *Snapshot) addDoc(doc *ext.Document) error {
}

ns.evalRollouts[f.Key] = evalRollouts
if opts.dependencyGraph != nil {
opts.dependencyGraph.SetDependencies(&rpcenvironments.Resource{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i need to rethink this as there wont be a TypeURL here

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.

1 participant