Loading
Commits on Source 92
-
GitLab Renovate Bot authored
chore(deps): update registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/golang-fips docker tag to v1.26.2
-
GitLab Renovate Bot authored
-
Matias Alvarez authored
fix(deps): update module gitlab.com/gitlab-com/gl-infra/platform/runway/fairway to v1.15.2 See merge request !475 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
Restructures the Health endpoints section into Liveness, Readiness, and a new Writing safe readiness checks block. The new section explains the readiness semantic (can-I-serve-traffic, not are-my-deps-healthy), what to include and exclude, the cascading failure pattern, and Kubernetes probe configuration guidance.
-
Elliot Forbes authored
-
Elliot Forbes authored
-
Elliot Forbes authored
Adds a ### Startup section explaining when to use a startup probe, why /-/readiness is the right endpoint to reuse, how to size failureThreshold for worst-case startup time, and when a custom startup endpoint makes sense. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Health endpoints (/-/liveness, /-/readiness) and /-/metrics are now served exclusively on Config.ProbeAddr (default :9090). The main port serves application traffic only. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Go 1.22+ loop variables are scoped per iteration; the name := name copy is unnecessary and flagged by golangci-lint. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Tests that call Start without ProbeAddr defaulted to :9090, causing port conflicts when tests ran concurrently. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Reflow long single-line paragraphs to one sentence per line, apply M_Alvarez's wording suggestions for the startup probe section, improve active voice on the readiness what-to-check bullet, align YAML comment spacing, and remove the unrelated docs/ gitignore entry. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
TestLiveness_IncludesBuildInfo, TestLiveness_OmitsBuildInfoWhenEmpty, and TestReadiness_IncludesBuildInfo were written against srv.ServeHTTP which no longer routes /-/liveness or /-/readiness now that those endpoints moved to the dedicated probe server. Rewrite them to use startProbeServer and hit the probe address via HTTP, consistent with every other health endpoint test in the file. Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
-
Luke Hollinda authored
We're currently in a position where we incorrectly have `v2/X.X.X` tags. Our major version subdirectory set up requries us to use tags in the form `v2.X.X`. These tags previously existed and were deleted. While recreating these old tags, deleting incorrect formats, and fixing the release script; we should temporarily disable the release process by calling the script in dry-run mode.
-
Luke Hollinda authored
This release script was built out with the incorrect assumption that v2 module tags should be in the form `v2/v2.X.X`. This is incorrect and we should instead be using the format `v2.X.X`
-
Matias Alvarez authored
ci: set release jobs to dry run while fixing release tags See merge request !477 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
Elliot Forbes authored
Co-authored-by:Matias Alvarez <malvarez@gitlab.com>
-
Luke Hollinda authored
ci: release script to use correct v2 tag format See merge request !478 Merged-by:
Luke Hollinda <lhollinda@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com>
-
GitLab Renovate Bot authored
-
GitLab Renovate Bot authored
-
Luke Hollinda authored
Adjusts release script comments to account for recent changes. - V2 module tags in format v2.X.X - Patch releases are only created for `fix` commits
-
Luke Hollinda authored
Updates docs to align with our removal of Semantic Release
-
Luke Hollinda authored
-
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
chore: correct release script misnomers See merge request !482 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>
-
Matias Alvarez authored
ci: remove dry-run, enabling release CI jobs See merge request !483 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>
-
Bob Van Landuyt authored
chore(deps): update pre-commit hook gitlab-com/gl-infra/common-ci-tasks to v4.1 See merge request !481 Merged-by:
Bob Van Landuyt <bob@gitlab.com>
Approved-by:
Bob Van Landuyt <bob@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
fix(deps): update module gitlab.com/gitlab-com/gl-infra/platform/runway/fairway to v1.15.3 See merge request !480 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
Merge branch 'renovate/registry.gitlab.com-gitlab-com-gl-infra-common-ci-tasks-images-golang-fips-1.x' into 'master' chore(deps): update registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/golang-fips docker tag to v1.26.2 See merge request !451 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
docs(v2/httpserver): add readiness check best practices Closes gitlab-org/quality/quality-engineering/team-tasks#4381 See merge request !402 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by: Matias Alvarez <malvarez@gitlab.com> Reviewed-by:
GitLab Duo <gitlab-duo@gitlab.com> Reviewed-by:
Matias Alvarez <malvarez@gitlab.com>
-
Elliot Forbes authored
-
Luke Hollinda authored
Add httptest slow-server timeout test to featureflag client See merge request !485 Merged-by:
Luke Hollinda <lhollinda@gitlab.com> Approved-by:
Luke Hollinda <lhollinda@gitlab.com> Reviewed-by:
GitLab Duo <gitlab-duo@gitlab.com> Co-authored-by:
Elliot Forbes <eforbes@gitlab.com> -
GitLab Renovate Bot authored
chore(deps): update registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/golang-fips docker tag to v1.26.3
-
GitLab Renovate Bot authored
-
GitLab Renovate Bot authored
-
Luke Hollinda authored
This commit adds the string equivilant of TestBooleanValueDetails_DefaultTimeoutReturnsDefault, introduced in: !485
-
Luke Hollinda authored
Refactors the slowServerForTimeout function to accept an optional timeout duration. When no timeout is configured, this timer channel blocks indefinitely. This allows us to use the helper function for all tests requiring a "slow" server.
-
Bob Van Landuyt authored
Merge branch 'renovate/registry.gitlab.com-gitlab-com-gl-infra-common-ci-tasks-images-golang-fips-1.x' into 'master' chore(deps): update registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/golang-fips docker tag to v1.26.3 See merge request !490 Merged-by:
Bob Van Landuyt <bob@gitlab.com>
Approved-by:
Bob Van Landuyt <bob@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
test(v2/featureflag): test improvements following !485 See merge request !493 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: Luke Hollinda <lhollinda@gitlab.com>
-
-
Elliot Forbes authored
- Use log.Error(err) instead of slog.Any("error_message", err) to align with the standardised fields.ErrorMessage field from LabKit - Replace bytes.Buffer/slog.NewTextHandler with logtest.NewWithRecorder in logging tests for structured record assertions Co-Authored-By:Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
-
-
Steve Xuereb authored
chore(deps): update pre-commit hook gitlab-com/gl-infra/common-ci-tasks to v4.2 See merge request !491 Merged-by:
Steve Xuereb <sxuereb@gitlab.com>
Approved-by:
Steve Xuereb <sxuereb@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Elliot Forbes authored
fix(deps): update module gitlab.com/gitlab-com/gl-infra/platform/runway/fairway to v1.16.0 See merge request !492 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
GitLab Renovate Bot authored
chore(deps): update dependency https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git to v1.49.1
-
Bob Van Landuyt authored
Co-authored-by:Duo Fix CI/CD Pipeline <service_account_group_9970_fe9437f62858fed38f53a853f2d1d219@noreply.gitlab.com>
-
Bob Van Landuyt authored
chore(deps): update dependency https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git to v1.49.1 See merge request !288 Merged-by:
Bob Van Landuyt <bob@gitlab.com>
Approved-by:
Bob Van Landuyt <bob@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Matias Alvarez authored
Add slog.Logger support for feature flag eval failure observability See merge request !486 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Elliot Forbes <eforbes@gitlab.com> -
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> -
Luke Hollinda authored
-
Luke Hollinda authored
Heavily diven by Claude code. To be cut down and refactored in following commits.
-
Luke Hollinda authored
-
Luke Hollinda authored
Aligns with the postgres package on how we handle non-valid server address. Removes the New constructor; which we can reintroduce if and when we need to set up automatic client construction from Fairway / known config locations
-
Luke Hollinda authored
Initial registration and collection of pool metrics. Will require refactoring to more cleanly register these metrics along with attaching the hook required for the command metrics.
-
Luke Hollinda authored
All metrics now use prometheus.BuildFQName with configurable Namespace (default "gitlab") and Subsystem (default "redis"), producing names like gitlab_redis_command_duration_seconds. A "name" constant label is added to all metrics to identify the client instance. Replaces registerOrReuse with registerCollector, which errors on duplicate descriptors rather than silently reusing an existing collector. The previous approach dropped pool stats and merged command metrics across distinct clients. Merges newMetricsHook and registerPoolMetrics into a single newMetrics entry point. Unexports StatGetter and NewPoolCollector as internal implementation details.
-
Luke Hollinda authored
- Updates metric name strings (redis_command_* → gitlab_redis_command_*) - Splits TestMetrics_MultipleClientsSharedRegisterer into two tests: - TestMetrics_DistinctNamesSharedRegisterer — distinct names share a registerer without error - TestMetrics_DuplicateNameSharedRegistererErrors — same name returns an error with the expected message
-
Luke Hollinda authored
Adds 14 fields covering the connection, timeout, pool, and retry parameters that teams commonly need to tune. ClientName is auto-set to cfg.Name so every client is identifiable in CLIENT LIST output without additional configuration.
-
Luke Hollinda authored
-
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> -
Florian Forster authored
Rework the DSN construction in `clientOptions.newFromProto` to support secrets produced by a variety of PostgreSQL operators. Presets are shipped for CNPG, Crunchy Data, and Zalando; users can also supply a custom field projection via `PostgreSQLSecret.Projection`. Each DSN field is resolved either from inline config (`Host`, `Port`, `DatabaseName`, `Username`) or from a secret field looked up via the projection. `Password` is always resolved from a secret. Errors across all fields are joined so callers see every misconfiguration at once, not just the first. As defense in depth, `resolveSecret` rejects secret references containing a slash to prevent path traversal into other secret namespaces. The schema already constrains secret names to valid Kubernetes resource names. Depends on the matching Fairway schema change in gitlab-com/gl-infra/platform/runway/fairway!63, which introduces `PostgreSQLSecret`, `PostgreSQLFormat`, and `PostgreSQLProjection` and turns `PostgreSQL.Host` into a `*string`. The `go.mod` entry points at a pre-release commit until that MR is merged and tagged. Issue: gitlab-com/gl-infra/platform/runway/team#873
-
Florian Forster authored
-
Luke Hollinda authored
Adds a Logger *slog.Logger field to Config. When set, a loggingHook is registered that emits a structured log entry for every command and pipeline: redis_command, redis_key, redis_duration_ms, and error_message on failures. redis.Nil is not treated as an error. Pipeline executions are logged as a single entry with redis_command="pipeline" and redis_pipeline_size. Errors trigger Warn level; normal completions use Debug. Start and Shutdown log at Info. The client name is baked into a child logger via .With() at construction time so all entries carry it automatically without repeating it at each call site. When Logger is nil, the logging hook is not registered (no per-command overhead). A discard logger is stored on the client so Start and Shutdown can log unconditionally without nil guards.
-
Luke Hollinda authored
-
Luke Hollinda authored
-
Luke Hollinda authored
This avoids logging `redis_key=""` for pipelines and other commands which do not have a redis_key.
-
Luke Hollinda authored
db.system -> db.system.name db.statement -> db.operation.name From: https://opentelemetry.io/docs/specs/semconv/db/redis/
-
Luke Hollinda authored
From https://opentelemetry.io/docs/specs/semconv/db/redis/: > For transactions and pipelined calls, if the individual operations are known to have the same command then that command SHOULD be used prepended by MULTI or PIPELINE . Otherwise db.operation.name SHOULD be MULTI or PIPELINE.
-
Luke Hollinda authored
From https://opentelemetry.io/docs/specs/semconv/db/redis/: > db.operation.batch.size: Operations are only considered batches when they contain two or more operations, and so db.operation.batch.size SHOULD never be 1.
-
Luke Hollinda authored
This commit splits the logic for setting up and registering the pool metrics into their own file. This better shows that the pool metrics are pull metrics which do not depend on the metrics_hook, which is entirely responsible for the per-command metrics.
-
Luke Hollinda authored
Small corrections to documentation and comments
-
Luke Hollinda authored
Adds three integration jobs covering supported Redis topologies: - integration:redis (single-node) - integration:redis:cluster - integration:redis:sentinel Topology setup is handled by small bash scripts under v2/redis/testdata/ci/. I would have prefered to re-use out docker-compose files, which can be used to run these tests locally. However, setting the Cluster and Sentinal instance via scripts allows us to avoid messing with `network_mode: host` / DIND networking complexities.
-
Luke Hollinda authored
Use `set -euo pipefail` per Duo review feedback
-
Luke Hollinda authored
Uses -skip 'Cluster|Sentinel' to exclude topology-specific tests from the single-node job, preventing future tests starting with C or S from being silently excluded.
-
Elliot Forbes authored
feat(postgres): Support multiple PostgreSQL operator secret formats. See merge request !484 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by:
Florian Forster <fforster@gitlab.com> -
Alessio Caiazza authored
When PostgreSQLFormat is set to CUSTOM but no projection is supplied, projection() returned (nil, nil). The subsequent field accesses in dsn() (proj.Host, proj.Port, ...) then panic with a nil pointer dereference instead of surfacing the misconfiguration. Return ErrSecretProjectionMissing in that case, and switch the CUSTOM branch to use the nil-safe getter chain for consistency with the UNSPECIFIED handling above it. AI-assisted: Claude Code (claude-opus-4-7)
-
Alessio Caiazza authored
Errors returned by dsn() (and the projection() helper it calls) had no package prefix, so they reached the caller as bare strings like "unknown secret format: -1" or a multi-line errors.Join output. The sibling error paths in newFromProto wrap with "postgres:", so the dsn() path was the only one without it. Wrap the dsn() result once at the call site to keep newFromProto's error surface uniform. errors.Is on the underlying sentinels keeps working since fmt.Errorf with %w preserves the chain. AI-assisted: Claude Code (claude-opus-4-7)
-
Alessio Caiazza authored
Three small typos in client_test.go: - "requies" -> "requires" - "withou" -> "without" - "clientOptions.dns()" -> "clientOptions.dsn()" in the t.Fatalf format string AI-assisted: Claude Code (claude-opus-4-7)
-
Resolved conflict in v2/go.sum: - Kept fairway v1.18.0 hashes (from master, matching go.mod) - Kept gopher-lua v1.1.1 hashes (indirect dep still in go.mod) - Dropped zeebo/xxh3 v1.1.0 (no longer referenced in go.mod) Run go mod tidy
-
Elliot Forbes authored
fix(v2/postgres): reject CUSTOM format without projection See merge request !503 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: Alessio Caiazza <code.git@caiazza.info>
-
Elliot Forbes authored
feat(v2/redis): add instrumented Redis client See merge request !497 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by: Alessio Caiazza <code.git@caiazza.info> Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: Duo Developer <service_account_group_9970_1976e9ecde3c53c783b64edb9ae993eb@noreply.gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>
-
Matias Alvarez authored
ci: wire v2/redis integration tests into CI pipeline See merge request !502 Merged-by:
Matias Alvarez <malvarez@gitlab.com> Approved-by:
Matias Alvarez <malvarez@gitlab.com> Reviewed-by:
GitLab Duo <gitlab-duo@gitlab.com> Reviewed-by:
Matias Alvarez <malvarez@gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>