From 9c0acdcae5cca4585eaafe39fc1291c41c128614 Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 11 May 2026 13:42:08 -0700 Subject: [PATCH 1/5] Initial implementation Signed-off-by: currantw --- .markdownlint-cli2.yaml | 12 +++++ AGENTS.md | 6 +-- DEVELOPER.md | 13 +++-- Taskfile.yml | 59 +++++++++++++-------- docs/configuration-architecture-analysis.md | 13 ++++- 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 .markdownlint-cli2.yaml diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 000000000..7778c8366 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,12 @@ +config: + MD013: false + MD024: false + MD041: false + MD060: false + +ignores: + - "valkey-glide/**" + - "THIRD_PARTY_LICENSES" + - "reports/**" + - "rust/target/**" + - ".kiro/specs/**" diff --git a/AGENTS.md b/AGENTS.md index c7eb31b20..35454df3d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,9 +45,9 @@ Common commands: - Prefer `task` commands for linting and formatting. - Lint checks (read-only, fail on issues): - - `task lint` (all checks), `task lint:rust`, `task lint:csharp`, `task lint:yaml`, `task lint:actions` + - `task lint` (all checks), `task lint:rust`, `task lint:csharp`, `task lint:yaml`, `task lint:actions`, `task lint:markdown` - Auto-fix formatting: - - `task format` (all languages), `task format:rust`, `task format:csharp`, `task format:yaml` + - `task format` (all languages), `task format:rust`, `task format:csharp`, `task format:yaml`, `task format:markdown` - Link checking (separate from lint, slower): - `task check-links` @@ -163,7 +163,7 @@ Note: Conventional Commits apply to commit messages only. Do not enforce this fo ## Quality Gates (Agent Checklist) - Build passes on `net8.0`. -- Lint passes: `task lint` (or individual `task lint:rust`, `task lint:csharp`, `task lint:yaml`). +- Lint passes: `task lint` (or individual `task lint:rust`, `task lint:csharp`, `task lint:yaml`, `task lint:markdown`). - Tests pass; targeted via filters instead of per-file execution. - Generated outputs not committed. - Public API changes respect StackExchange.Redis compatibility. diff --git a/DEVELOPER.md b/DEVELOPER.md index ad83894ae..acb31eb4c 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -309,7 +309,8 @@ You can combine this with test filter as well: ```bash cluster-endpoints=localhost:7000 standalone-endpoints=localhost:6379 tls=true dotnet test --logger "console;verbosity=detailed" --filter "FullyQualifiedName~GetReturnsNull" ``` -#### IAM Authentication Tests + +### IAM Authentication Tests To run [IAM authentication tests](tests/Valkey.Glide.IntegrationTests/IamAuthTests.cs) locally, set the following environment variables: @@ -355,10 +356,11 @@ Before making a contribution, ensure that all new user APIs and non-obvious code task lint # Run linters for specific languages: -task lint:rust # Run Rust linting -task lint:csharp # Run C# linting -task lint:yaml # Run YAML linting -task lint:actions # Run GitHub Actions linting +task lint:rust # Run Rust linting +task lint:csharp # Run C# linting +task lint:yaml # Run YAML linting +task lint:actions # Run GitHub Actions linting +task lint:markdown # Run Markdown linting # Run all formatters: task format @@ -367,6 +369,7 @@ task format task format:rust task format:csharp task format:yaml +task format:markdown # Check for broken links task check-links diff --git a/Taskfile.yml b/Taskfile.yml index 615d6bad4..7c28ea137 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -146,8 +146,7 @@ tasks: build: desc: Build the solution - cmds: - - dotnet build {{.TARGET_PATH}} --configuration Release + cmd: dotnet build {{.TARGET_PATH}} --configuration Release test: desc: Build and run all tests @@ -155,9 +154,17 @@ tasks: cmds: - task: test:coverage:all + # Lint + # -------------------------------------------------------------------------------- + lint: desc: "Run all linters" - deps: [lint:rust, lint:csharp, lint:yaml, lint:actions] + deps: + - lint:rust + - lint:csharp + - lint:yaml + - lint:actions + - lint:markdown lint:rust: desc: "Run Rust linting" @@ -178,43 +185,51 @@ tasks: lint:yaml: desc: "Run YAML linting" - cmds: - - npx prettier --check "**/*.yml" + cmd: npx prettier --check "**/*.yml" lint:actions: desc: "Run GitHub Actions linting" - cmds: - - actionlint + cmd: actionlint + + lint:markdown: + desc: "Run Markdown linting" + cmd: npx markdownlint-cli2 "**/*.md" + + # Format + # -------------------------------------------------------------------------------- format: desc: "Run all formatters" - cmds: - - task: format:rust - - task: format:csharp - - task: format:yaml + deps: + - format:rust + - format:csharp + - format:yaml + - format:markdown format:rust: desc: "Run Rust formatting" dir: rust - cmds: - - cargo fmt --all + cmd: cargo fmt --all format:csharp: desc: "Run C# formatting" - cmds: - - dotnet format + cmd: dotnet format format:yaml: desc: "Run YAML formatting" - cmds: - - npx prettier --write "**/*.yml" + cmd: npx prettier --write "**/*.yml" + + format:markdown: + desc: "Run Markdown formatting" + cmd: npx markdownlint-cli2 --fix "**/*.md" + + # Additional checks + # -------------------------------------------------------------------------------- check-links: desc: "Check for broken links" - cmds: - - lychee --config lychee.toml . + cmd: lychee --config lychee.toml . check-examples: - desc: "Extract and validate C# code examples in doc comments" - cmds: - - python3 scripts/check_examples.py + desc: "Check C# examples in doc comments" + cmd: python3 scripts/check_examples.py diff --git a/docs/configuration-architecture-analysis.md b/docs/configuration-architecture-analysis.md index 6431cfede..f2dc0249a 100644 --- a/docs/configuration-architecture-analysis.md +++ b/docs/configuration-architecture-analysis.md @@ -7,18 +7,20 @@ This document analyzes the configuration architecture in the Valkey.Glide C# cli ## Configuration Classes Relationship ### ConfigurationOptions + - **Purpose**: External API configuration class that follows StackExchange.Redis compatibility patterns - **Location**: `sources/Valkey.Glide/Abstract/ConfigurationOptions.cs` - **Role**: User-facing configuration interface ### ConnectionConfiguration + - **Purpose**: Internal configuration classes that map to the underlying FFI layer - **Location**: `sources/Valkey.Glide/ConnectionConfiguration.cs` - **Role**: Internal configuration representation and builder pattern implementation ## Configuration Flow -``` +```text ConfigurationOptions → ClientConfigurationBuilder → ConnectionConfig → FFI.ConnectionConfig ``` @@ -53,10 +55,12 @@ internal static T CreateClientConfigBuilder(ConfigurationOptions configuratio ### Configuration Builders The builder pattern is implemented through: + - `StandaloneClientConfigurationBuilder` (line 525) - `ClusterClientConfigurationBuilder` (line 550) Both inherit from `ClientConfigurationBuilder` which provides: + - Fluent API methods (`WithXxx()`) - Property setters - Internal `ConnectionConfig Build()` method @@ -92,6 +96,7 @@ internal ConfigurationOptions RawConfig { private set; get; } ## Potential Configuration Change Approaches ### 1. Connection Recreation (Current Pattern) + ```csharp // Current approach - requires new connection var newConfig = oldConfig.Clone(); @@ -136,12 +141,15 @@ public async Task TryUpdateConfigurationAsync(Action configure) ## ReadFrom Configuration Specifics ### Current Implementation + - `ReadFrom` is a struct (line 74) with `ReadFromStrategy` enum and optional AZ string - Mapped in `CreateClientConfigBuilder()` at line 199 - Flows through to FFI layer via `ConnectionConfig.ToFfi()` method ### ReadFrom Change Requirements + To change `ReadFrom` configuration at runtime would require: + 1. **API Design**: Method to accept new `ReadFrom` configuration 2. **Validation**: Ensure new configuration is compatible with current connection type 3. **FFI Updates**: Update the underlying client configuration @@ -150,8 +158,10 @@ To change `ReadFrom` configuration at runtime would require: ## Recommendations ### Short Term + 1. **Document Current Limitations**: Clearly document that configuration changes require connection recreation 2. **Helper Methods**: Provide utility methods for common reconfiguration scenarios: + ```csharp public static async Task RecreateWithReadFromAsync( ConnectionMultiplexer current, @@ -159,6 +169,7 @@ To change `ReadFrom` configuration at runtime would require: ``` ### Long Term + 1. **Runtime Reconfiguration API**: Implement selective runtime configuration updates for non-disruptive changes 2. **Configuration Validation**: Add validation to determine which changes require reconnection vs. runtime updates 3. **Connection Pool Management**: Consider connection pooling to minimize disruption during reconfiguration From ab1d95df2332690d8c6f3b59ea0a7b53603d57e0 Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 11 May 2026 14:14:27 -0700 Subject: [PATCH 2/5] Use gitignore Signed-off-by: currantw --- .markdownlint-cli2.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index 7778c8366..af75bd354 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -1,3 +1,5 @@ +gitignore: true + config: MD013: false MD024: false @@ -7,6 +9,3 @@ config: ignores: - "valkey-glide/**" - "THIRD_PARTY_LICENSES" - - "reports/**" - - "rust/target/**" - - ".kiro/specs/**" From d571254591766c549cfac29973fb26dbac8424b1 Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 11 May 2026 14:16:11 -0700 Subject: [PATCH 3/5] Enabled and fix `MD060` Signed-off-by: currantw --- .markdownlint-cli2.yaml | 1 - docs/ci-cd.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index af75bd354..bc086a53e 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -4,7 +4,6 @@ config: MD013: false MD024: false MD041: false - MD060: false ignores: - "valkey-glide/**" diff --git a/docs/ci-cd.md b/docs/ci-cd.md index 1decf0a01..ef8823704 100644 --- a/docs/ci-cd.md +++ b/docs/ci-cd.md @@ -7,7 +7,7 @@ a set of platforms, versions, and tests to be run. The json files list our avail ## Files | File | Purpose | -|------|---------| +| ---- | ------- | | `os-matrix.json` | OS/runner platforms (VMs and containers) | | `server-matrix.json` | Valkey and Redis server versions | | `version-matrix.json` | .NET SDK versions | From 9a96f729c2831d382b56ca2fb66bd7206e1f5cae Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 11 May 2026 14:37:38 -0700 Subject: [PATCH 4/5] More config updates, fix violations in PR template Signed-off-by: currantw --- .github/pull_request_template.md | 25 ++++++++++++++++--------- .markdownlint-cli2.yaml | 6 ++++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 74c3ca3af..f59cd0679 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,50 +1,57 @@ +# Pull Request + -### Summary +## Summary -### Issue Link +## Issue Link + + -This pull request is linked to issue: [REPLACE ME] +Closes #[GITHUB-ISSUE-ID]. -### Features and Behaviour Changes +## Features and Behaviour Changes -### Implementation +## Implementation -### Limitations +## Limitations -### Testing +## Testing -### Related Issues +## Related Issues -### Checklist +## Checklist