fix: migrate config dir to ~/.greennode with legacy fallback - #61
Merged
Conversation
greennode-cli renamed its config dir from ~/.greenode to ~/.greennode (double-n) while keeping the old path as a read-only fallback. The MCP servers still hardcoded ~/.greenode, so a fresh `grn configure` (writing to ~/.greennode) would leave the server unable to find credentials. - mcp-core: add resolve_config_dir() — prefers ~/.greennode, falls back to legacy ~/.greenode only when it alone exists (mirrors the CLI's effectiveConfigDir). Export from the package; cover with unit tests. - vks-mcp-server: resolve CONFIG_PATH via resolve_config_dir(); update error message and drop the now-unused Path import. - new-server template: use resolve_config_dir() so new servers inherit the behavior. - docs: update READMEs, CLAUDE.md files, prompts, and smoke_test to ~/.greennode (noting the legacy fallback).
Merged
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.
QC Handoff: Migrate config dir to
~/.greennode(legacy~/.greenodefallback)Summary
greennode-cli đã đổi thư mục cấu hình từ
~/.greenodesang~/.greennode(double-n), giữ path cũ làm read-only fallback. Các MCP server vẫn hardcode~/.greenode, nên user mới chạygrn configure(ghi vào~/.greennode) sẽ khiến server không tìm thấy credentials → auth fail. Fix thêmresolve_config_dir()trong mcp-core (ưu tiên~/.greennode, fallback legacy~/.greenode) và áp cho vks-mcp-server + template, mirroreffectiveConfigDircủa CLI.Impact assessment
CONFIG_PATH; passthrough-token flow không đổi nhưng service-account load qua path mới~/.greenodecũ)Test checklist for QC
Golden path
~/.greennode/credentials+~/.greennode/config(chạygrn configurebản CLI mới) →uv run vks-mcp-server, gọi toolget_access_token→ trả về IAM token thành công.list_clusterschạy được với credentials từ~/.greennode(đúng region trong config).Edge cases
~/.greennode, chỉ còn~/.greenodecũ → server vẫn load được (fallback),get_access_tokenOK.~/.greennodevà~/.greenodetồn tại → server đọc~/.greennode(ưu tiên), bỏ qua legacy.GRN_CLIENT_ID/GRN_CLIENT_SECRET/GRN_DEFAULT_REGION, không có file dir nào → server vẫn chạy bằng env.--transport streamable-httpkhông credentials → boot OK, request không token trả 401.Regression risks
Authorization: Bearer) vẫn chạy như caller, cache cô lập per-caller — không bị ảnh hưởng bởi đổiCONFIG_PATH.mcp-coreunit tests +vks-mcp-servertests xanh (đã chạy local: 22 + 277 pass).Links
devbranchmain