Skip to content

Add configure connection test subcommand#26

Merged
ewega merged 3 commits into
mainfrom
copilot/add-configure-connection-test
Feb 19, 2026
Merged

Add configure connection test subcommand#26
ewega merged 3 commits into
mainfrom
copilot/add-configure-connection-test

Conversation

Copilot AI commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Adds gh devlake configure connection test to re-test an existing connection by plugin + ID — useful after token rotation or network changes.

Changes

  • cmd/configure_connection_test_cmd.go — New test subcommand registered under configureConnectionsCmd:
    • Flag mode: both --plugin and --id provided → validates plugin, calls TestSavedConnection directly
    • Interactive mode: either flag missing → discovers DevLake, lists all connections across plugins, prompts selection
    • Returns non-zero exit code when result.Success == false
  • cmd/configure_connection_test_cmd_test.go — Tests for subcommand registration, plugin validation, and flag defaults
  • README.md — Documents the new command between the connection list and configure scope sections

Usage

# Non-interactive
gh devlake configure connection test --plugin gh-copilot --id 2

# Interactive: pick from all discovered connections
gh devlake configure connection test

Uses the existing client.TestSavedConnection(plugin, connID) method — no new API surface added.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add configure connection test command</issue_title>
<issue_description>## Summary
Add a configure connection test subcommand to re-test an existing connection by ID. Useful for verifying a connection after token rotation or network changes.

Design

gh devlake configure connection test --plugin gh-copilot --id 2 gh devlake configure connection test # interactive: pick from discovered connections

Changes

  • Add test subcommand under configure connection
  • Call POST /plugins/{plugin}/connections/{id}/test
  • Display detailed test result (success/failure message)
  • Client already has TestSavedConnection method

Acceptance Criteria

  • Tests existing connection by plugin + ID
  • Interactive mode lists connections and lets user pick
  • Shows clear success/failure message
  • Returns non-zero exit code on failure
    </issue_description>

<agent_instructions>v0.3.4 just shipped — commands are now singular (connection, scope, project), --plugin flag exists, and configure connection list is a subcommand of configureConnectionsCmd. Work off the latest main.

Key implementation points:

  1. Create a new file cmd/configure_connection_test_cmd.go (NOT _test.go — that's a Go test file) with a test subcommand under configureConnectionsCmd
  2. The API method TestSavedConnection(plugin, connID) ALREADY EXISTS in internal/devlake/client.go — use it directly, do NOT add a duplicate
  3. Flag mode: --plugin + --id required
  4. Interactive mode: list connections (reuse pattern from configure_connection_list.go), let user pick one
  5. Display clear success/failure message with connection details
  6. Return non-zero exit code on test failure (return an error from RunE)
  7. Follow terminal output rules in .github/instructions/terminal-output.instructions.md
  8. Update README.md with the new command documentation
  9. Add tests in configure_connection_test_cmd_test.go
  10. Run go build ./... and go test ./... to verify</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ewega <26189114+ewega@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configure connection test subcommand Add configure connection test subcommand Feb 19, 2026
Copilot AI requested a review from ewega February 19, 2026 17:22
@ewega ewega requested a review from Copilot February 19, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a gh devlake configure connection test subcommand to verify existing DevLake connections after token rotation or network changes. The implementation follows established patterns from the connection list subcommand, supporting both flag-based (non-interactive) and interactive modes.

Changes:

  • New test subcommand under configure connection with dual-mode operation (flag mode requires both --plugin and --id, otherwise enters interactive selection)
  • Reuses existing client.TestSavedConnection() API method, no new API surface added
  • Comprehensive documentation in README.md positioned between connection list and configure scope sections

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cmd/configure_connection_test_cmd.go New test subcommand with flag validation, interactive connection selection, and clear success/failure output following terminal output standards
cmd/configure_connection_test_cmd_test.go Unit tests covering command registration, plugin validation via FindConnectionDef, and flag defaults
README.md Documentation for the new command including usage examples, flag descriptions, and output samples

@ewega ewega marked this pull request as ready for review February 19, 2026 17:59
@ewega ewega merged commit b1352e6 into main Feb 19, 2026
@ewega ewega deleted the copilot/add-configure-connection-test branch March 2, 2026 12:51
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.

Add configure connection test command

3 participants