| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 个月前 | |
fix(release): download clobber/skip, named-asset strictness, streaming upload, view/delete polish download: an existing file was silently overwritten (temp+rename with no existence check), and a mistyped asset name exited 0 with "No assets to download" — scripts could not tell a typo from an empty release. Existing files now refuse by default with --clobber to overwrite and --skip-existing to skip (mutually exclusive, gh-aligned). Named downloads are strict: any miss is an error listing the available asset names, and the named set bypasses the source-archive filter — naming an archive explicitly is intent and must download it even without --all. upload: the whole file was buffered in memory (io.ReadAll then a []byte PUT — double the asset size, OOM territory for large binaries); UploadToURL and UploadReleaseAssetByTag now take an io.Reader with an explicit ContentLength (presigned URLs reject chunked PUTs) and uploadFile streams from the file handle with a 512-byte sniff-and-rewind for content type. The platform's overwrite behavior for duplicate asset names is undefined, so a GetRelease precheck refuses the whole batch (zero PUTs) when any name collides, pointing at delete-asset or a rename. A mid-batch failure now names what already landed. The --label example that errors when copied is gone (the flag stays, with its explicit rejection). delete: the confirmation prompt showed the release Name but expected the tag — when they differ, typing what the screen says was rejected. confirmTitle shows "Name (tag: tag)" so the expected input is always visible; Expected stays the tag (the API key). view: gained its first run-level tests (web/TTY/non-TTY browser fallback via an injected opener matching the pr create seam, JSON, human render, not-found wrapping). list: the body-first-line truncate was byte-based and corrupted CJK text at the 60-byte boundary; a shared rune-aware output.Truncate now serves release list, issue templates (same latent bug), and the plugin list (which had its own correct copy). COMMANDS.md documents the new download/upload semantics and fixes the extension-name wording for source archives (detection is by URL, not extension). Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix(release): WrapNotFound + help asset-id source Refs #528 | 2 个月前 | |
fix(review): address multi-role review findings for the 609 batch Four independent reviewers (code/security/test/docs) over the 6-commit batch: one P1, five P2s, and a set of P3s — all fixed here. P1 (code review, reproduced end-to-end): the shadow-skip broke the PRIMARY install path. npx/npm exec prepends the package's own npx-cache node_modules/.bin to PATH, so firstProviderOnPath resolved the package's own shims and every completion was skipped with a misleading warning — on a clean machine too. A provider now counts as self when it resolves into the same package tree that is running the installer (providerIsRunningPackage, realpath against the running package root); a different persistent install of our coordinate still shadows. The npx shape is reproduced in a sandbox fixture: 6/6 completions install, zero skips or warnings. Docs P2s: the PowerShell completion example wrote to $PROFILE.Completions, a nonexistent property — the redirect drops the script silently; now appends to $PROFILE. The zsh notice pointed at a README section that does not exist (both pointers now name the Uninstall section). spec and .devcontainer still taught the deleted make release-snapshot; AGENTS.md still called 'make release' the official publish after it became --skip=publish. AI-GUIDE and INTRODUCTION carried half-migrated repository slugs (clone commands and -R demo targets that hit the retired coordinate); dev-facing test rules and links unified too. Code P3s: BASH_COMPLETION_USER_DIR now requires absolute entries like the XDG vars (a relative value produced a CWD-relative write target); the upload precheck also refuses batch-internal duplicate basenames; --clobber against a directory says so instead of a raw is-a-directory error; the main npm job's post-publish verification loop normalizes failed lookups into retries like every other dist-tag check. Test P3s: the Go PATHEXT helper gains the table test mirroring its JS twin (the parity this batch is about had no Go-side pin); the mutually-exclusive-flags test asserts the cobra flag-group error text (a bare err != nil stayed green if the check were dropped); the workflow contract requires BOTH dist-tag-guard invocations (strings.Count == 2); the doctor human-output test pins the header order; upload gains the wrapped not-found (exit 3) and directory/batch-duplicate tests; providerIsRunningPackage and the relative BCUD entries get unit tests. Recorded without changes: api-doc/ is a separate repository (its slug stays), sparse-checkout for the npm job and the pre-existing dual download-artifact pin are noted for later, shadow run-level positive coverage rides the sandbox fixture above. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix: stop wrapping ErrSecretDetected as 'failed to read file' + add 401 guidance (#428, #432) #428: When a --body-file/--notes-file/--description-file contains the current token value, ReadTextFile/ReadTextFromFlag correctly return ErrSecretDetected, but callers wrapped it as 'failed to read file', misleading users into thinking it was an IO error. Now checks errors.Is(err, ErrSecretDetected) before wrapping. Affected paths: - cmdutil.ReadBody (covers issue/pr comment, comment edit, issue edit via getBody delegation from #427) - pr edit --body-file - milestone edit --description-file - release create --notes-file - release edit --notes-file #432: APIError.Error() now adds actionable guidance for 401, matching the existing 403 pattern: 'Your token may be invalid or expired. Try: - Run Tip: Authenticate with GitCode ? Paste your authentication token: to re-authenticate - Check that GC_TOKEN or GITCODE_TOKEN is set correctly' Refs #428 Refs #432 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 个月前 | |
fix(ci): remove unused truncate leftover; JSON-encode paths in doctor test manifests Two CI failures on the first run of this batch: - Lint: the C7 rewiring replaced the call site but the local truncate body in release/list survived (a scripted replacement missed silently); golangci-lint's unused check caught it. Removed. The full-repo lint run is now part of this batch's verification (it was previously only run per-directory). - Test (windows): the npm-prefix conflict fixture interpolated the temp-dir path into the manifest JSON raw — on Windows those paths carry backslashes, which are invalid JSON escape sequences, so json.Unmarshal failed, npmPrefix returned empty, and the conflict branch under test silently never ran (green on Linux, where paths have no backslashes). Both path-carrying manifests in the file now use json.Marshal, which cannot emit invalid JSON. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix(review): address multi-role review findings for the 609 batch Four independent reviewers (code/security/test/docs) over the 6-commit batch: one P1, five P2s, and a set of P3s — all fixed here. P1 (code review, reproduced end-to-end): the shadow-skip broke the PRIMARY install path. npx/npm exec prepends the package's own npx-cache node_modules/.bin to PATH, so firstProviderOnPath resolved the package's own shims and every completion was skipped with a misleading warning — on a clean machine too. A provider now counts as self when it resolves into the same package tree that is running the installer (providerIsRunningPackage, realpath against the running package root); a different persistent install of our coordinate still shadows. The npx shape is reproduced in a sandbox fixture: 6/6 completions install, zero skips or warnings. Docs P2s: the PowerShell completion example wrote to $PROFILE.Completions, a nonexistent property — the redirect drops the script silently; now appends to $PROFILE. The zsh notice pointed at a README section that does not exist (both pointers now name the Uninstall section). spec and .devcontainer still taught the deleted make release-snapshot; AGENTS.md still called 'make release' the official publish after it became --skip=publish. AI-GUIDE and INTRODUCTION carried half-migrated repository slugs (clone commands and -R demo targets that hit the retired coordinate); dev-facing test rules and links unified too. Code P3s: BASH_COMPLETION_USER_DIR now requires absolute entries like the XDG vars (a relative value produced a CWD-relative write target); the upload precheck also refuses batch-internal duplicate basenames; --clobber against a directory says so instead of a raw is-a-directory error; the main npm job's post-publish verification loop normalizes failed lookups into retries like every other dist-tag check. Test P3s: the Go PATHEXT helper gains the table test mirroring its JS twin (the parity this batch is about had no Go-side pin); the mutually-exclusive-flags test asserts the cobra flag-group error text (a bare err != nil stayed green if the check were dropped); the workflow contract requires BOTH dist-tag-guard invocations (strings.Count == 2); the doctor human-output test pins the header order; upload gains the wrapped not-found (exit 3) and directory/batch-duplicate tests; providerIsRunningPackage and the relative BCUD entries get unit tests. Recorded without changes: api-doc/ is a separate repository (its slug stays), sparse-checkout for the npm job and the pre-existing dual download-artifact pin are noted for later, shadow run-level positive coverage rides the sandbox fixture above. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix(release): download clobber/skip, named-asset strictness, streaming upload, view/delete polish download: an existing file was silently overwritten (temp+rename with no existence check), and a mistyped asset name exited 0 with "No assets to download" — scripts could not tell a typo from an empty release. Existing files now refuse by default with --clobber to overwrite and --skip-existing to skip (mutually exclusive, gh-aligned). Named downloads are strict: any miss is an error listing the available asset names, and the named set bypasses the source-archive filter — naming an archive explicitly is intent and must download it even without --all. upload: the whole file was buffered in memory (io.ReadAll then a []byte PUT — double the asset size, OOM territory for large binaries); UploadToURL and UploadReleaseAssetByTag now take an io.Reader with an explicit ContentLength (presigned URLs reject chunked PUTs) and uploadFile streams from the file handle with a 512-byte sniff-and-rewind for content type. The platform's overwrite behavior for duplicate asset names is undefined, so a GetRelease precheck refuses the whole batch (zero PUTs) when any name collides, pointing at delete-asset or a rename. A mid-batch failure now names what already landed. The --label example that errors when copied is gone (the flag stays, with its explicit rejection). delete: the confirmation prompt showed the release Name but expected the tag — when they differ, typing what the screen says was rejected. confirmTitle shows "Name (tag: tag)" so the expected input is always visible; Expected stays the tag (the API key). view: gained its first run-level tests (web/TTY/non-TTY browser fallback via an injected opener matching the pr create seam, JSON, human render, not-found wrapping). list: the body-first-line truncate was byte-based and corrupted CJK text at the 60-byte boundary; a shared rune-aware output.Truncate now serves release list, issue templates (same latent bug), and the plugin list (which had its own correct copy). COMMANDS.md documents the new download/upload semantics and fixes the extension-name wording for source archives (detection is by URL, not extension). Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
feat(release): add gc release delete-asset command Refs #528 | 2 个月前 |