feat: Implement connection test support#22923
Merged
kodiakhq[bot] merged 3 commits intoJun 9, 2026
Merged
Conversation
Add a TestConnection implementation that validates the spec and checks reachability of the public XKCD API (GetLatestComic). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a TestConnection implementation that validates the spec and checks reachability of the public Hacker News API (MaxItemID). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds connection test capability to the xkcd and hackernews source plugins by wiring plugin.WithConnectionTester(...) and implementing per-plugin probe logic plus unit tests.
Changes:
- Register connection testers in both source plugins’
Plugin()constructors. - Add
connection_tester.goimplementations that validate specs and perform a lightweight API probe. - Add unit tests covering success, invalid spec, and connection-failure scenarios.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/source/xkcd/resources/plugin/plugin.go | Registers an xkcd connection tester via plugin.WithConnectionTester. |
| plugins/source/xkcd/resources/plugin/connection_tester.go | Implements xkcd spec parsing/validation and a probe call to the xkcd API. |
| plugins/source/xkcd/resources/plugin/connection_tester_test.go | Adds httptest-based coverage for xkcd connection testing outcomes. |
| plugins/source/hackernews/resources/plugin/plugin.go | Registers a Hacker News connection tester via plugin.WithConnectionTester. |
| plugins/source/hackernews/resources/plugin/connection_tester.go | Implements Hacker News spec parsing/validation and a MaxItemID probe. |
| plugins/source/hackernews/resources/plugin/connection_tester_test.go | Adds gomock-based coverage for Hacker News connection testing outcomes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+19
to
+21
| func connectionTester(newClient func() (*xkcd.Client, error)) plugin.ConnectionTester { | ||
| return func(_ context.Context, _ zerolog.Logger, specBytes []byte) error { | ||
| var s client.Spec |
Comment on lines
+35
to
+38
| if _, err := c.GetLatestComic(0); err != nil { | ||
| return plugin.NewTestConnError(codeConnectionFailed, err) | ||
| } | ||
| return nil |
erezrokah
approved these changes
Jun 9, 2026
…-all-source-plugins
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.