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(ext): determinism in exporting and declarative formats #3509

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

devumesh
Copy link
Contributor

@devumesh devumesh commented Sep 30, 2024

Issue number FLI-937
resolves #2915

Approach:

  1. Added a new boolean flag --sort-by-key to the export command.
  2. If enabled, flags and segments are sorted by key. NOTE: Flag1 is lesser than flag1.

@devumesh devumesh requested a review from a team as a code owner September 30, 2024 14:04
@erka
Copy link
Collaborator

erka commented Sep 30, 2024

Hey @devumesh. Congrats with the first contribution!

I think using flag is a nice way to introduce this and it looks great! I have few suggestions:

  • could we use slices.SortStableFunc with strings.Compare instead of sort.SliceStable?
  • could we add sorting for namespaces if all-namespaces command flag is used ?
  • could we add sorting for flag.Variants as well ?

wdyt?

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 70.83333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 65.76%. Comparing base (490cc12) to head (34fc903).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/flipt/export.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3509      +/-   ##
==========================================
+ Coverage   65.74%   65.76%   +0.01%     
==========================================
  Files         169      169              
  Lines       13629    13651      +22     
==========================================
+ Hits         8961     8977      +16     
- Misses       3983     3989       +6     
  Partials      685      685              
Flag Coverage Δ
unittests 65.76% <70.83%> (+0.01%) ⬆️

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.

@devumesh
Copy link
Contributor Author

devumesh commented Oct 1, 2024

Sure will make changes as suggested @erka

Copy link
Collaborator

@erka erka left a comment

Choose a reason for hiding this comment

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

@devumesh Looks great!

Please change PR to "Ready for review" to move forward.

@devumesh
Copy link
Contributor Author

devumesh commented Oct 1, 2024

Hi @erka I have added Integration test. Please review that too

@devumesh devumesh marked this pull request as ready for review October 1, 2024 09:15
@erka
Copy link
Collaborator

erka commented Oct 1, 2024

@all-contributors please add @devumesh for code

Copy link
Contributor

@erka

I've put up a pull request to add @devumesh! 🎉

@erka
Copy link
Collaborator

erka commented Oct 1, 2024

Hi @erka I have added Integration test. Please review that too

@devumesh very nice!

@erka erka requested a review from markphelps October 1, 2024 12:22
Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks @devumesh ! We could probably make this the default in the future

@GeorgeMac GeorgeMac added the automerge Used by Kodiak bot to automerge PRs label Oct 1, 2024
@kodiakhq kodiakhq bot merged commit b3cd920 into flipt-io:main Oct 1, 2024
35 checks passed
@erka erka added the needs docs Requires documentation updates label Oct 1, 2024
markphelps added a commit that referenced this pull request Oct 1, 2024
…o gm/flipt-edge

* 'gm/flipt-edge' of https://github.com/flipt-io/flipt:
  docs: add devumesh as a contributor for code (#3512)
  feat(ext): determinism in exporting and declarative formats (#3509)
  fix: skip authz for clickhouse (#3511)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Used by Kodiak bot to automerge PRs needs docs Requires documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FLI-937] Ensure determinism in exporting and declarative formats
4 participants