Skip to content

feat: Implement connection test support#22923

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
eng-1820-feat-support-connection-testing-for-all-source-plugins
Jun 9, 2026
Merged

feat: Implement connection test support#22923
kodiakhq[bot] merged 3 commits into
mainfrom
eng-1820-feat-support-connection-testing-for-all-source-plugins

Conversation

@murarustefaan

Copy link
Copy Markdown
Member

No description provided.

murarustefaan and others added 2 commits June 5, 2026 13:05
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.go implementations 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
@kodiakhq kodiakhq Bot merged commit 2b3a489 into main Jun 9, 2026
11 checks passed
@kodiakhq kodiakhq Bot deleted the eng-1820-feat-support-connection-testing-for-all-source-plugins branch June 9, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants