Skip to content

refactor: introduce add, update and delete operations to sync providers - #307

Merged
beeme1mr merged 9 commits into
open-feature:mainfrom
Kavindu-Dodan:refactor/sync-merge-strategy
Jan 30, 2023
Merged

beeme1mr merged 9 commits into
open-feature:mainfrom
Kavindu-Dodan:refactor/sync-merge-strategy

Conversation

@Kavindu-Dodan

@Kavindu-Dodan Kavindu-Dodan commented Jan 23, 2023 •

Copy link
Copy Markdown
Contributor

This PR

Introduce and wire new strategies to sync provider state updates.

Following new mechanisms were added to be used by sync providers (ex:- file based flag configuration provider),

  • ADD: Add new flag(s) to internal state
  • UPDATE: Update existing flag(s) to internal state
  • DELETE: Remove flag(s) from internal state

These operations provide extra flexibility compared to the existing "merge" operation, which is now mapped to "ALL" (i.e - Add and replace all).

Test coverage of 100% for newly added methods.

NOTE - recommends commit by commit review to minimize confusion

Related Issues

Related to #249

Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator.go Resolved
@Kavindu-Dodan
Kavindu-Dodan requested review from beeme1mr and toddbaert and removed request for beeme1mr, skyerus, thomaspoignant and toddbaert January 24, 2023 18:19

@toddbaert toddbaert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Though I'm not sure we will anytime soon implement a sync that would take advantage of this... we might need one at some point to avoid large payloads for only small flag changes.

I think it's worth merging this to be able to easily add that support, but I would like @skyerus, @james-milligan or @AlexsJones 's opinion.

Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator_model.go Resolved
Comment thread pkg/eval/json_evaluator.go Resolved
Comment thread pkg/eval/json_evaluator_model.go Resolved
@Kavindu-Dodan
Kavindu-Dodan requested review from james-milligan and toddbaert and removed request for beeme1mr and james-milligan January 25, 2023 21:10
@Kavindu-Dodan
Kavindu-Dodan force-pushed the refactor/sync-merge-strategy branch 2 times, most recently from 99a7976 to 5648dc4 Compare January 30, 2023 17:03
Kavindu-Dodan and others added 9 commits January 30, 2023 12:50
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
@Kavindu-Dodan
Kavindu-Dodan force-pushed the refactor/sync-merge-strategy branch from 2e620a8 to 722db95 Compare January 30, 2023 20:50
@beeme1mr
beeme1mr self-requested a review January 30, 2023 21:34
@beeme1mr
beeme1mr merged commit 0c9a6c3 into open-feature:main Jan 30, 2023
beeme1mr pushed a commit that referenced this pull request Feb 7, 2023
@Kavindu-Dodan has contributed multiple significant changes and
proposals to flagd:

- multiple refactors: #291,
#307
- ci/security improvements:
#338,
#337
- architectural proposals (some of which got some attention from outside
parties!): open-feature/ofep#45,
open-feature/flagd-schemas#78,
#249 (comment)
- load testing: #225
- documentation improvements

For these reasons, I believe he should be made a CODEOWNER in this
repository.

NOTE: before this is merged, @Kavindu-Dodan should be added with at
least `maintainer` permissions to the repo.

Signed-off-by: Todd Baert <[email protected]>
raphael-wigoutschnigg-dt pushed a commit to open-feature-forking/flagd that referenced this pull request Mar 11, 2025
…open-feature#307)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jonathannorris added a commit that referenced this pull request Sep 21, 2026
- google.golang.org/grpc 1.83.1 -> 1.83.2 (high, alerts #308/#309/#310)
- github.com/containerd/containerd/v2 2.2.5 -> 2.2.8 (medium, alert #307)
- js-yaml 4.3.1 -> 4.3.2 (high, alert #306)
- go.opentelemetry.io/otel/sdk 1.44.0 -> 1.46.0 (low, alerts #317/#322)
- go.opentelemetry.io/otel/exporters/otlp/otlptrace(+grpc/+http) -> 1.46.0 (low, alerts #314/#315/#316/#319/#320/#321/#323/#324/#325)
- go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc 0.18.0 -> 0.22.0 (medium, alerts #311/#312)

Companion otel packages (otel, metric, trace, log, otlploghttp, stdoutlog) bumped
alongside in flagd/core to keep the module graph consistent, since the older
otlploghttp/stdoutlog releases do not compile against the newer otel/log API.

Unresolvable: github.com/docker/docker alerts #151/#184/#185/#186 in
test/integration/go.mod have no first_patched_version upstream yet.

Signed-off-by: Jonathan Norris <[email protected]>
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.

5 participants