Skip to content

Conversation

@mostlygeek
Copy link
Owner

@mostlygeek mostlygeek commented Sep 14, 2025

Summary by CodeRabbit

  • New Features

    • Added support for configuring multiple peers in the app settings, including name, description, base URL, API key, and priority.
    • Introduced configurable peer priorities.
  • Tests

    • Added tests to verify loading and parsing of the new peer configuration.

@mostlygeek mostlygeek self-assigned this Sep 14, 2025
@mostlygeek mostlygeek marked this pull request as draft September 14, 2025 19:19
@coderabbitai
Copy link

coderabbitai bot commented Sep 14, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a new PeerConfig type and a Peers map field to Config for YAML-based peer definitions; updates POSIX config test and fixtures to include and validate a desktop peer entry.

Changes

Cohort / File(s) Summary of changes
Config model update
proxy/config.go
Added exported type PeerConfig {Name, Description, BaseURL, ApiKey, Priority} with YAML tags; extended Config with Peers map[string]PeerConfig (yaml:"peers").
Tests and sample YAML
proxy/config_posix_test.go
Updated test YAML to include peers.desktop with fields; assertions extended to verify Config.Peers content and YAML-to-struct field mapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add Peering Support (#296)" succinctly and accurately summarizes the primary change in the diff — adding peering via a PeerConfig type and a Peers map on Config — and is specific and relevant to the modified files and tests.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
proxy/config.go (1)

165-165: Make peers field omit-empty on marshal.

Keeps serialized configs tidy when no peers are set.

-	Peers              map[string]PeerConfig  `yaml:"peers"`  /* key is peer ID */
+	Peers              map[string]PeerConfig  `yaml:"peers,omitempty"`  /* key is peer ID */
proxy/config_posix_test.go (1)

242-250: Align expected struct with APIKey rename (if adopted).

Update field name in the expected value.

-				ApiKey:      "secret-key",
+				APIKey:      "secret-key",

Optionally, add a redaction assertion once Stringer is in place:

t.Run("peers redact API keys in fmt output", func(t *testing.T) {
	s := fmt.Sprintf("%v", config.Peers["desktop"])
	assert.NotContains(t, s, "secret-key")
	assert.Contains(t, s, "REDACTED")
})
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c36986f and 2fddd2f.

📒 Files selected for processing (2)
  • proxy/config.go (2 hunks)
  • proxy/config_posix_test.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
proxy/config_posix_test.go (1)
proxy/config.go (1)
  • PeerConfig (149-155)
🔇 Additional comments (1)
proxy/config_posix_test.go (1)

151-157: LGTM: Fixture exercises the new peers mapping.

@mostlygeek
Copy link
Owner Author

mostlygeek commented Sep 28, 2025

Closing this PR as I don't have time to work on it for now. The config changes were cherry-picked into #329 .

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.

2 participants