AgenticCMSに対応#4433
Open
ryuring wants to merge 18 commits into
Open
Conversation
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
DB を全 drop して再マイグレーションするテスト/インストール処理の再作成対象に BcMcp が含まれず、oauth2 系テーブルが復活しないため OAuth2 系テストが 500 になっていた。 - bc-installer InstallationsAdminServiceTest::test_deleteAllTables の再作成リストに BcMcp を追加 - BcInstaller の testStep3(createDb) は defaultInstall のみ作り直すため、BcMcp の testsuite を BcInstaller より前(BcSeo の後)へ移動(phpunit.xml.dist) - コアプラグインコンバートスキルに知見を追記(複数のマイグレーション再作成リスト/testsuite 順序) - 外部依存取り込みに伴う composer.lock 更新 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
testIntegration / testIntegrationWithPKCE は実 MCP サーバー(SSE)が必要で、 CI(GitHub Actions)ではバックグラウンドサーバーを起動・到達できず 500 になる。 サーバー起動を該当2テストに限定し、起動できなければ markTestSkipped する (サーバーのある環境では実行、CI では安全にスキップ)。スキルにも知見を追記。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
isServerRunning() は pidファイル+プロセス生存のみで、ポート bind 完了を保証しない。
CI ではプロセス起動後にポート bind が間に合わず、プロキシが 127.0.0.1:{port} へ
接続できず 500 になっていた。requireMcpServer() を fsockopen による実接続待ち
(最大15秒ポーリング)に変更し、到達できればテスト実行、到達不可なら markTestSkipped。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
markTestSkipped はサーバー起動不具合を隠して CI を緑にしてしまうため、 実ポート到達待ち(最大15秒)後に到達できなければ assertTrue で明示的に失敗させる。 サーバーが立てばテストは実行・検証され、立たなければ赤で検知できる。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
外部プロセス(MCPサーバー等)を要するテストは、該当テスト側で起動し、 プロセス存在でなく実接続到達まで待ち、到達不可なら skip せず明示的に失敗させる方針を .github/instructions/basercms.instructions.md に記載。コアプラグイン変換スキルも同方針へ更新。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI で MCP サーバーが起動しない原因を切り分けるため、127.0.0.1:{port} へ到達できない
場合は bc_mcp_server.log の末尾を失敗メッセージに添える。コマンド未登録・DB未接続・
ポート競合などの起動失敗理由が CI 出力に現れるようにする。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
サーバー子プロセス bin/cake bc_mcp.server は default 接続の plugins テーブル (status=true)から有効プラグインをロードする。BcMcp は defaultInstall 外のため bin/cake install では有効化されず、CI で bc_mcp.server コマンドが未登録=起動失敗 →プロキシ500 になっていた。requireMcpServer() の冒頭で BcMcp を plugins へ 有効化(既存ならスキップ)してから起動する。test.yml は変更しないテスト完結の対応。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- oauth2-server 8.x の RedirectUriValidator が呼ぶ league/uri の 非推奨 Uri::createFromString() を回避するため、自前の RedirectUriValidator(Uri::new() 使用) と AuthCodeGrant override を追加し OAuth2Service で差し替え。依存ツリーは無変更(psr/http-message ^1.0 / php-mcp/server 据え置き、oauth2-server 9.x は psr ^2 必須で導入不可のため)。 - CustomContentsTool の暗黙nullable引数3箇所を明示化(?Type $x = null)。 - BaseMcpTool の $http_response_header を PHP8.5 互換の取得方法に修正。 フルスイート 4583 tests OK / createFromString・deprecated 出現 0 を確認。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- php-migration: vendor 由来の非推奨は継承 override で呼び出し自体を回避する 手法、自前コードとの切り分けを追記。 - basercms-unittest: 関連メモを更新。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bin/cake bc_mcp.server は PHPUnit とは別プロセスで起動し、bootstrap 時の getEnablePlugins() が参照する DB(既定 default)に BcMcp が無いと コマンドが未登録となり「Unknown command cake bc_mcp.server」で起動失敗する (ローカルは常駐プロセスが残っていたため偽陽性で通っていた)。 - baser-core/config/bootstrap.php: CLI かつ env BC_CONNECTION 指定時に その接続を default にエイリアスする汎用機構を追加(プラグインロード前)。 BcMcp 非依存。install.php が test 接続も定義済みのため子プロセスでも利用可能。 - McpServerManager::startMcpServer: connection 指定時、子プロセスへ BC_CONNECTION 環境変数と --connection オプションを付与。 - McpServerCommand: --connection オプション追加(実行時エイリアス+ログ)。 - OAuth2ControllerTest::requireMcpServer: connection=test を渡す。 クリーン状態(default/test とも BcMcp レコード無し)でフルスイート 4583 tests OK / Unknown command 出現 0 を確認。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
統合テストが起動した SSE 常駐サーバーを停止しておらず、孤児プロセスが CI ステップの継承 fd を掴んだまま残り、出力パイプが EOF にならずジョブが 次ステップへ進めず無限待機していた(GHA の PHP8.1 で5時間ハング→キャンセル)。 - OAuth2ControllerTest に tearDown を追加し、起動したサーバーを確実に停止。 - McpServerManager::startMcpServer: 子プロセスの stdin を /dev/null へ切り、 stdin/stdout/stderr すべてを親から切り離して継承 fd を掴ませない。 クリーン状態で統合テスト OK / テスト後にサーバープロセス・PIDファイルが 残らないことを確認。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.