Loading
Commits on Source 9
-
Florian Forster authored
Add a new `infrastructure` package that centralises loading of the infrastructure config and instantiation of the secrets provider, replacing the per-package loading logic that previously lived in `postgres`. `infrastructure.DefaultConfig()` lazily loads `/etc/labkit/infrastructure.yaml` and a file-backed secret provider rooted at `/secrets/infrastructure`, caching the result for subsequent callers. Refactor the PostgreSQL client to consume `*infrastructure.Config` via a new `WithInfrastructure` option, which is primarily useful for testing. When no config is provided, `postgres.New(ctx)` falls back to `DefaultConfig()`, so the developer-friendly zero-argument API is preserved and LabKit will do the right thing. As part of the refactor: - Replace `ErrUndefinedDependency` with the more specific `ErrMissingConfig` and `ErrMissingSecrets`. - Move secret lookups from a postgres-specific mount (`/secrets/infrastructure/postgresql`) to keyed lookups (`postgresql/username`, `postgresql/password`) against the shared provider rooted at `/secrets/infrastructure`. - Rewrite `postgres` tests to construct `*infrastructure.Config` directly with a `secret.MemoryProvider`, avoiding filesystem fixtures and adding coverage for missing-secret error paths. Issue: gitlab-com/gl-infra/platform/runway/team#884
-
Florian Forster authored
-
Florian Forster authored
Infrastructure clients should return this error if the client was not configured, giving callers a consistent way to check for this condition.
-
Florian Forster authored
-
-
Matias Alvarez authored
Document error propagation behaviour and update Config godoc See merge request !487 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Luke Hollinda <lhollinda@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Elliot Forbes <eforbes@gitlab.com> -
Elliot Forbes authored
Adds two integration tests using a hung httptest.Server to verify that evaluation completes within the configured timeout, returns the default flag value, propagates an observable error, and records the failure on the OTel span. Closes criterion 5 of team-tasks#4382. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Matias Alvarez authored
test(v2/featureflag): add integration tests for timeout fallback behaviour See merge request !495 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Reviewed-by:
GitLab Duo <gitlab-duo@gitlab.com> Co-authored-by:
e_forbes <eforbes@gitlab.com> -
Elliot Forbes authored
feat(infrastructure): Introduce shared infrastructure config package. See merge request !467 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Reviewed-by: GitLab Duo <gitlab-duo@gitlab.com> Co-authored-by:
Florian Forster <fforster@gitlab.com>