Skip to content

Migrate issue triage workflow from Docker to ToolHive Actions#1

Draft
kofort9 wants to merge 11 commits intomainfrom
feature/use-toolhive-actions-for-mcp-servers-1469
Draft

Migrate issue triage workflow from Docker to ToolHive Actions#1
kofort9 wants to merge 11 commits intomainfrom
feature/use-toolhive-actions-for-mcp-servers-1469

Conversation

@kofort9
Copy link
Copy Markdown
Owner

@kofort9 kofort9 commented Oct 15, 2025

Migrates the claude issue triage action from Docker-based MCP server setup to ToolHive Actions. Fixes stacklok#1469

@kofort9
Copy link
Copy Markdown
Owner Author

kofort9 commented Oct 16, 2025

Just a heads up, when trying out the ToolHive Actions workflow, I hit an issue with the secrets manager in pkg/runner/env.go. Found it was a nil pointer problem, added a nil check, and now it works fine locally. Actions are still failing though since they’re picking up the older CLI without the fix. Would a quick pre-release with this patch make sense, or do you want to verify a different way, or just merge the patch as-is?
Also, I left in some comparison tests since I wanted to make sure the new code matches the old behavior, but happy to clean that up later. @ChrisJBurns

@kofort9
Copy link
Copy Markdown
Owner Author

kofort9 commented Oct 18, 2025

Moved the fix to another PR. #2252

@ChrisJBurns
Copy link
Copy Markdown

@kofort9 We recently released a new version of ToolHive that should have your PR merged included 👍

- Replace Docker-based MCP server setup with ToolHive Actions
- Add comparative integration test (Docker vs ToolHive Actions)
- Add ToolHive Actions validation test

This is a draft to test the migration. Legacy Docker code is kept
in the comparison test for validation purposes.

Addresses stacklok#1469
This ensures we use the latest ToolHive release that includes the bug fix
for nil pointer dereference in environment variable validation.

The toolhive-actions/install@v0 action supports a version parameter
that allows us to specify the exact ToolHive version to install.
The Install ToolHive step was incorrectly indented under the checkout
step's 'with' section instead of being at the same level as other steps.

This fixes the workflow file syntax errors that were preventing the
ToolHive Actions workflows from running.
@kofort9 kofort9 force-pushed the feature/use-toolhive-actions-for-mcp-servers-1469 branch from af38c93 to f50ed3c Compare October 19, 2025 20:17
This fixes a panic that occurs when running MCP servers via GitHub Actions
with environment variables when no secrets manager is configured.

The code now gracefully handles the case where secretsManager is nil,
allowing both Actions-based (env vars) and Docker-based (secrets manager)
workflows to coexist.

Fixes stacklok#1469
gofmt fixed a formatting issue with an extra blank line in the nil check code.
- Add 'thv secret provider none' step after ToolHive installation
- Prevents blocking on missing secrets/provider configuration
- Applied to all workflows that use ToolHive MCP servers:
  - toolhive-actions-validation-test.yml
  - issue-triage.yml
  - toolhive-migration-comparison-test.yml

This change ensures CI workflows can proceed without interactive
secrets setup, based on successful local testing.
- Add GITHUB_PERSONAL_ACCESS_TOKEN env var to all steps that run thv commands
- Use secrets.GITHUB_TOKEN consistently across all workflows
- Ensures GitHub authentication is available for ToolHive MCP operations
@kofort9
Copy link
Copy Markdown
Owner Author

kofort9 commented Oct 19, 2025

For the CI workflow is the missing GITHUB_PERSONAL_ACCESS_TOKEN environment variable, which the MCP server requires. Is there an existing GitHub personal access token that could be added to this repository's secrets (or is it possible to create one for this purpose)? @ChrisJBurns

@ChrisJBurns
Copy link
Copy Markdown

@kofort9 Would the GITHUB_TOKEN be sufficient? As that's what we used before

The mcp-config action requires GitHub token to generate proper MCP server
configuration for the GitHub MCP server. This step was missing the env variable
mapping in all three workflows.

- toolhive-actions-validation-test.yml
- issue-triage.yml
- toolhive-migration-comparison-test.yml
…w steps

Only steps that actually interact with GitHub MCP server need the token:
- Run GitHub MCP Server (needs token to authenticate)
- Generate MCP Config (needs token to configure GitHub server)

Removed from steps that don't need GitHub authentication:
- Initialize ToolHive Secrets Provider (local config only)
- Test MCP Tools Availability (thv list queries local state)
- Test Config Compatibility (JSON validation only)
- Cleanup (thv stop manages local containers)

This reduces unnecessary environment variable declarations while keeping
authentication where it's actually required.
@kofort9 kofort9 force-pushed the feature/use-toolhive-actions-for-mcp-servers-1469 branch from 6bab2cd to f893f79 Compare November 1, 2025 05:51
@kofort9
Copy link
Copy Markdown
Owner Author

kofort9 commented Nov 1, 2025

@ChrisJBurns I think it should but I can't tell because this is a forked repo. Custom secret failed also.

@ChrisJBurns
Copy link
Copy Markdown

@JAORMX You've got a bit more knowledge than me on the toolhive action side of things, would you be able to give this PR a look over?

- name: Install ToolHive
uses: StacklokLabs/toolhive-actions/install@v0
with:
version: v0.3.11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should we use the latest toolhive version? you could do so by removing this version key.

Remove version: v0.3.11 specification from all workflow files
to allow ToolHive Actions to use the latest available version.

Addresses reviewer feedback in PR #1
Copy link
Copy Markdown
Owner Author

kofort9 commented Nov 23, 2025

I built a comparison workflow (.github/workflows/toolhive-migration-comparison-test.yml) that runs the legacy Docker and new ToolHive Actions side‑by‑side to validate MCP config parity (structure, servers, commands, args).

In this fork, Docker can’t authenticate to generate the baseline, so the comparison job is skipped.

The +build syntax has been deprecated in favor of //go:build.
All affected files already have the modern //go:build directive,
so removing the redundant +build lines fixes golangci-lint warnings.

Signed-off-by: kofort9 <kofort9@gmail.com>
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.

Use ToolHive Actions for MCP Servers in Pipeline

3 participants