Repository navigation
fix(workbuddy): 修 camelCase 并支持 workbuddy-accounts 批量导入 - #393
Merged
Merged
Conversation
Fix DecodeCredential camelCase branch (err == nil), accept workbuddy-accounts hub exports, and import every accounts[] entry with partial-success reporting. Console keeps the single-account response shape; multi-account imports return an import_result summary.
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.
结论
修复 WorkBuddy 凭证导入:camelCase 解码 bug、识别 hub 整包
workbuddy-accounts、支持批量导入(partial success)。请 review 后自行 merge,本 PR 不自动合入。根因
DecodeCredential的 flat camelCase 分支写成了err != nil,单条 hubaccounts[i](camelCase)会报requires access_token。workbuddy-oauth-v1,workbuddy-accounts→unsupported_format。runImport一次只打一条,且有 format 时不会改写成可识别格式。改动
err != nil→err == nil;新增AccountsFormat。SplitImport解开accounts[];PrepareImportDecode→Encode 规范为 snake_case,Ready 正确。CredentialFormats增加workbuddy-accountsalias。ImportAll逐条 Prepare+建账号;失败策略 partial success(能过的留下,汇总成功/失败,不静默丢条);存储格式仍为workbuddy-oauth-v1。import_result。失败策略
选择 partial success + 清晰汇总:非法/失败条目记入
errors[],已成功账号不回滚。与账号池「尽量可用」语义一致。测试
go test ./internal/providers/workbuddy/ ./internal/control/ ./internal/console/accounts[i];控制层 alias / 批量 / 跳过坏条。手动验证
{account,auth}仍可导入。不做