Skip to content

1 remove need for extension backup#5

Closed
leogdion wants to merge 3 commits into
mainfrom
1-remove-need-for-extension-backup
Closed

1 remove need for extension backup#5
leogdion wants to merge 3 commits into
mainfrom
1-remove-need-for-extension-backup

Conversation

@leogdion

@leogdion leogdion commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configuration value reading with type-safe support for String, Int, Double, Bool, and Date types
    • Implemented precedence-based resolution across multiple configuration sources
    • Added support for both required and optional configuration values
  • Chores

    • Updated GitHub Actions workflow configurations

leogdion added 3 commits June 17, 2026 19:40
Move the CLI->ENV->default source-precedence resolution that downstream
consumers hand-wrote as `extension ConfigReader { read(_:) }` into the
Foundation-only core behind a `ConfigValueReading` protocol. An associated
`Key` type mirrors swift-configuration's ConfigReader read surface so a
consumer conforms in one line (`makeConfigKey`), and the read(_:) overloads
(String/Bool/Double required; String/Int/Double/Date optional) are shared
and unit-tested via a mock conformer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n_per_file)

Split MockConfigValueReader into its own file and replace force-unwraps with
try #require, so swift-format + SwiftLint --strict pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* "Update Claude PR Assistant workflow"

* "Update Claude Code Review workflow"
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Introduces a new ConfigValueReading Foundation protocol in ConfigKeyKit with precedence-based resolution across ConfigKeySources, adding required reads for String/Double/Bool and optional reads including ISO8601 Date parsing. Adds a MockConfigValueReader and a full test suite. Also updates Claude Code Review GitHub Actions workflows to use a plugin-based configuration.

Changes

ConfigValueReading Protocol and Tests

Layer / File(s) Summary
Protocol definition and resolution helpers
Sources/ConfigKeyKit/ConfigValueReading.swift
Defines public protocol ConfigValueReading with associated Key type and primitive read requirements (string, int, double). Adds private resolvedString/Int/Double helpers that iterate ConfigKeySource.allCases, derive per-source key strings via key.key(for:), and return the first non-nil typed result.
Required and optional read overloads
Sources/ConfigKeyKit/ConfigValueReading.swift
Extension methods for required reads: read(ConfigKey<String/Double>) returns resolved value or defaultValue; read(ConfigKey<Bool>) maps CLI presence to true, parses ENV true/1/yes with case/whitespace normalization, and falls back to defaultValue. Optional overloads: read(OptionalConfigKey<String/Int/Double>) returns first resolved value or nil; read(OptionalConfigKey<Date>) parses ISO8601 or returns nil.
Mock reader and test suite
Tests/ConfigKeyKitTests/MockConfigValueReader.swift, Tests/ConfigKeyKitTests/ConfigValueReadingTests.swift
MockConfigValueReader implements ConfigValueReading via [String: T] dictionaries with an identity makeConfigKey. Test suite covers CLI-over-ENV precedence, default fallback, required Bool truthy/falsy variants, optional Int/Double/String parsing and nil-on-absence, and optional Date ISO8601 parsing.

GitHub Actions Workflow Updates

Layer / File(s) Summary
Claude workflow configuration updates
.github/workflows/claude-code-review.yml, .github/workflows/claude.yml
Replaces multi-line review prompt and allowed_bots/claude_args inputs with plugin_marketplaces, plugins, and a /code-review:code-review command scoped to the current repo and PR number; reformats the permissions block; corrects a commented --allowed-tools example from Bash(gh pr:*) to Bash(gh pr *).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • brightdigit/ConfigKeyKit#3: Adds ConfigValueReading and its tests with an explicit sourcePriority contract — directly overlaps with this PR's new protocol and test files.
  • brightdigit/ConfigKeyKit#4: Modifies the same claude-code-review.yml and claude.yml Claude Code GitHub Actions configuration files changed in this PR.

Poem

🐇 A protocol hops into the scene,
Reading keys wherever they've been!
CLI first, then ENV with care,
Defaults await if nothing's there.
ISO dates parsed with a hop and a bound —
ConfigValueReading is thoroughly sound! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references removing the need for 'extension backup', but the changeset introduces a new ConfigValueReading protocol and related implementations—it doesn't describe removing or backing up extensions. Revise the title to accurately reflect the main change, such as 'Add ConfigValueReading protocol for precedence-based config value resolution' or 'Introduce ConfigKeyKit config value reading with multiple source precedence'.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1-remove-need-for-extension-backup
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch 1-remove-need-for-extension-backup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@leogdion leogdion closed this Jun 20, 2026
@leogdion leogdion deleted the 1-remove-need-for-extension-backup branch June 20, 2026 16:08
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.

1 participant