Skip to content

refactor: refactor sync providers - #291

Merged
james-milligan merged 9 commits into
open-feature:mainfrom
Kavindu-Dodan:refactor/refactor-sync-providers
Jan 23, 2023
Merged

james-milligan merged 9 commits into
open-feature:mainfrom
Kavindu-Dodan:refactor/refactor-sync-providers

Conversation

@Kavindu-Dodan

Copy link
Copy Markdown
Contributor

This PR

Revisits sync providers and refactor them.

  • unify event handling
  • packaging improvements
  • removal of unused codes (cleanup)
  • clean contracts between Runtime and Sync implementations

With this change, we get a clear isolation between runtime and sync providers (ex:- file, k8s, ....). For example, the runtime is not aware of any sync implementation details such as events. It simply coordinates sync impls, store (evaluator) and notifications. This should bring more extensibility when adding future extensions.

Below is the overview of the internals and interactions,

image

@james-milligan

Copy link
Copy Markdown
Contributor

This looks like a great improvement to the current sync / eval implementation.

Ill test this properly once it is ready for review

Comment thread pkg/runtime/runtime.go Resolved
Comment thread pkg/sync/file/filepath_sync.go Resolved
Comment thread pkg/sync/file/filepath_sync.go Resolved
Comment thread pkg/sync/http/http_sync.go Resolved
Comment thread pkg/sync/http/http_sync.go Resolved
Comment thread pkg/sync/http/http_sync.go Resolved
Comment thread pkg/sync/http/http_sync.go Resolved
@Kavindu-Dodan
Kavindu-Dodan marked this pull request as ready for review January 18, 2023 20:14
@Kavindu-Dodan
Kavindu-Dodan requested a review from skyerus January 18, 2023 20:14
Comment thread pkg/sync/kubernetes/ffclientset.go Resolved
Comment thread pkg/runtime/runtime.go Resolved
Comment thread pkg/sync/http/http_sync_test.go Resolved
Comment thread pkg/sync/file/filepath_sync.go Resolved
@toddbaert

Copy link
Copy Markdown
Member

go mod tidy leaves some deltas for me.

@toddbaert
toddbaert self-requested a review January 20, 2023 16:07

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

This looks really good to me. We've added to flagd a number of times, and whenever that happens it usually creates need for a refactor to clean things up. I find the new interfaces much clearer! Thanks!

I also tested this locally a bit and found no issues.

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]>
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/refactor-sync-providers branch from fb85b8d to 764255f Compare January 23, 2023 15:50
@james-milligan
james-milligan merged commit 46c5bf8 into open-feature:main Jan 23, 2023
@Kavindu-Dodan
Kavindu-Dodan deleted the refactor/refactor-sync-providers branch January 23, 2023 16:07
toddbaert pushed a commit that referenced this pull request Jan 30, 2023
## This PR

Adds a component diagram for flag configuration providers and their
interactions with the runtime and other systems.

Related PR #291

---------

Signed-off-by: Kavindu Dodanduwa <[email protected]>
Co-authored-by: Michael Beemer <[email protected]>
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]>
jonathannorris added a commit that referenced this pull request Sep 8, 2026
- google.golang.org/grpc 1.82.1 -> 1.83.1 in core, flagd, flagd-proxy, flagd-proxy/tests/loadtest, test/zero-downtime-flagd-proxy, test/integration (high, alerts #283-#288)
- github.com/moby/buildkit 0.29.0 -> 0.31.1 in test/integration (medium/low, alerts #281, #282)
- mkdocs-material 9.7.1 -> 9.7.7 in requirements.txt (medium, alert #292)
- browserslist 4.28.4 -> 4.28.9 in playground-app (high, alert #289)
- @humanfs/node 0.16.6 -> 0.16.8 in playground-app (medium, alert #291)

Signed-off-by: Jonathan Norris <[email protected]>
toddbaert pushed a commit that referenced this pull request Sep 10, 2026
- google.golang.org/grpc 1.82.1 -> 1.83.1 in core, flagd, flagd-proxy, flagd-proxy/tests/loadtest, test/zero-downtime-flagd-proxy, test/integration (high, alerts #283-#288)
- github.com/moby/buildkit 0.29.0 -> 0.31.1 in test/integration (medium/low, alerts #281, #282)
- mkdocs-material 9.7.1 -> 9.7.7 in requirements.txt (medium, alert #292)
- browserslist 4.28.4 -> 4.28.9 in playground-app (high, alert #289)
- @humanfs/node 0.16.6 -> 0.16.8 in playground-app (medium, alert #291)

Signed-off-by: Jonathan Norris <[email protected]>
toddbaert added a commit that referenced this pull request Sep 10, 2026
## Summary

- Resolved 11 of 15 open Dependabot security alerts by bumping
vulnerable dependencies

## Dependabot Alerts Resolved

| Alert | Package | Severity | Fix |
|-------|---------|----------|-----|
| #283 | `google.golang.org/grpc` (flagd/go.mod) | **high** | Bumped to
v1.83.1 |
| #284 | `google.golang.org/grpc` (core/go.mod) | **high** | Bumped to
v1.83.1 |
| #285 | `google.golang.org/grpc` (flagd-proxy/go.mod) | **high** |
Bumped to v1.83.1 |
| #286 | `google.golang.org/grpc` (flagd-proxy/tests/loadtest/go.mod) |
**high** | Bumped to v1.83.1 |
| #287 | `google.golang.org/grpc`
(test/zero-downtime-flagd-proxy/go.mod) | **high** | Bumped to v1.83.1 |
| #288 | `google.golang.org/grpc` (test/integration/go.mod) | **high** |
Bumped to v1.83.1 |
| #281 | `github.com/moby/buildkit` (test/integration/go.mod) |
**medium** | Bumped to v0.31.1 |
| #282 | `github.com/moby/buildkit` (test/integration/go.mod) | **low**
| Bumped to v0.31.1 |
| #292 | `mkdocs-material` (requirements.txt) | **medium** | Bumped to
9.7.7 |
| #289 | `browserslist` (playground-app, transitive via
@vitejs/plugin-react) | **high** | Updated to 4.28.9 (within existing
semver range, no override needed) |
| #291 | `@humanfs/node` (playground-app, transitive via eslint) |
**medium** | Updated to 0.16.8 (within existing semver range, no
override needed) |

## Unresolvable Alerts (no patched version available)

The remaining 4 open alerts are all for `github.com/docker/docker`
(test/integration/go.mod) and have no patched version for that import
path — the fix requires migrating to `github.com/moby/moby/v2`, a
breaking major-version rename, not a simple bump:

| Alert | Severity | Summary |
|-------|----------|---------|
| #184 | high | `PUT /containers/{id}/archive` executes container binary
on the host |
| #186 | high | Race condition in `docker cp` allows bind mount
redirection to host path |
| #185 | medium | Race condition in `docker cp` allows creation of
arbitrary empty files via symlink swap |
| #151 | medium | Off-by-one error in plugin privilege validation |

These are left open pending a coordinated migration to `moby/moby/v2`.

---------

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

4 participants