-
Notifications
You must be signed in to change notification settings - Fork 28
feat: Make flagd defaultVariant optional #347
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +16 −14 | .github/workflows/release-please.yml | |
| +2 −0 | .gitignore | |
| +94 −0 | .release-please-config.json | |
| +2 −2 | .release-please-manifest.json | |
| +123 −0 | CHANGELOG.md | |
| +6 −0 | CODEOWNERS | |
| +40 −0 | README.md | |
| +176 −0 | docker-compose.yaml | |
| +5 −2 | flagd/Dockerfile | |
| +89 −35 | gherkin/config.feature | |
| +58 −17 | gherkin/connection.feature | |
| +20 −1 | gherkin/evaluation.feature | |
| +2 −0 | gherkin/metadata.feature | |
| +6 −84 | launchpad/handlers/http.go | |
| +2 −2 | launchpad/main.go | |
| +160 −0 | launchpad/pkg/file.go | |
| +0 −92 | launchpad/pkg/filewatcher.go | |
| +45 −54 | launchpad/pkg/flagd.go | |
| +30 −3 | launchpad/pkg/json.go | |
| +0 −65 | release-please-config.json | |
| +1 −1 | version.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ class CacheType(Enum): | |
| DEFAULT_PORT_RPC = 8013 | ||
| DEFAULT_RESOLVER_TYPE = ResolverType.RPC | ||
| DEFAULT_RETRY_BACKOFF = 1000 | ||
| DEFAULT_RETRY_BACKOFF_MAX = 120000 | ||
| DEFAULT_RETRY_BACKOFF_MAX = 12000 | ||
| DEFAULT_RETRY_GRACE_PERIOD_SECONDS = 5 | ||
| DEFAULT_STREAM_DEADLINE = 600000 | ||
| DEFAULT_TLS = False | ||
|
|
@@ -42,6 +42,8 @@ class CacheType(Enum): | |
| ENV_VAR_OFFLINE_FLAG_SOURCE_PATH = "FLAGD_OFFLINE_FLAG_SOURCE_PATH" | ||
| ENV_VAR_OFFLINE_POLL_MS = "FLAGD_OFFLINE_POLL_MS" | ||
| ENV_VAR_PORT = "FLAGD_PORT" | ||
| ENV_VAR_SYNC_PORT = "FLAGD_SYNC_PORT" | ||
| ENV_VAR_FATAL_STATUS_CODES = "FLAGD_FATAL_STATUS_CODES" | ||
| ENV_VAR_RESOLVER_TYPE = "FLAGD_RESOLVER" | ||
| ENV_VAR_RETRY_BACKOFF_MS = "FLAGD_RETRY_BACKOFF_MS" | ||
| ENV_VAR_RETRY_BACKOFF_MAX_MS = "FLAGD_RETRY_BACKOFF_MAX_MS" | ||
|
|
@@ -83,6 +85,7 @@ def __init__( # noqa: PLR0913 | |
| self, | ||
| host: typing.Optional[str] = None, | ||
| port: typing.Optional[int] = None, | ||
| sync_port: typing.Optional[int] = None, | ||
| tls: typing.Optional[bool] = None, | ||
| selector: typing.Optional[str] = None, | ||
| provider_id: typing.Optional[str] = None, | ||
|
|
@@ -101,6 +104,7 @@ def __init__( # noqa: PLR0913 | |
| default_authority: typing.Optional[str] = None, | ||
| channel_credentials: typing.Optional[grpc.ChannelCredentials] = None, | ||
| sync_metadata_disabled: typing.Optional[bool] = None, | ||
| fatal_status_codes: typing.Optional[typing.List[str]] = None, | ||
| ): | ||
| self.host = env_or_default(ENV_VAR_HOST, DEFAULT_HOST) if host is None else host | ||
|
|
||
|
|
@@ -110,6 +114,12 @@ def __init__( # noqa: PLR0913 | |
| else tls | ||
| ) | ||
|
|
||
| self.fatal_status_codes: typing.List[str] = ( | ||
| env_or_default(ENV_VAR_FATAL_STATUS_CODES, [], cast=lambda s: [item.strip() for item in s.split(",")]) | ||
| if fatal_status_codes is None | ||
| else fatal_status_codes | ||
| ) | ||
|
|
||
| self.retry_backoff_ms: int = ( | ||
| int( | ||
| env_or_default( | ||
|
|
@@ -161,6 +171,12 @@ def __init__( # noqa: PLR0913 | |
| else port | ||
| ) | ||
|
|
||
| self.port: int = ( | ||
| int(env_or_default(ENV_VAR_SYNC_PORT, self.port, cast=int)) | ||
| if sync_port is None and port is None | ||
| else sync_port if sync_port is not None else self.port | ||
| ) | ||
|
Comment on lines
+174
to
+178
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| self.offline_flag_source_path = ( | ||
| env_or_default( | ||
| ENV_VAR_OFFLINE_FLAG_SOURCE_PATH, DEFAULT_OFFLINE_SOURCE_PATH | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| "~caching", | ||
| "~grace", | ||
| "~contextEnrichment", | ||
| "~deprecated", | ||
| } | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of
DEFAULT_RETRY_BACKOFF_MAXhas been reduced from 120000ms (2 minutes) to 12000ms (12 seconds). This is a significant change. Could you please confirm if this is intentional or a typo?