Skip to content

chore(deps): 升级 go-sdk 到 v7.26.15 修复 GetBucketInfo 空 ctime 解析错误#456

Merged
YangSen-qn merged 3 commits into
qiniu:masterfrom
YangSen-qn:master
Jul 10, 2026
Merged

chore(deps): 升级 go-sdk 到 v7.26.15 修复 GetBucketInfo 空 ctime 解析错误#456
YangSen-qn merged 3 commits into
qiniu:masterfrom
YangSen-qn:master

Conversation

@YangSen-qn

@YangSen-qn YangSen-qn commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

变更背景描述

服务端在部分情况下返回的 GetBucketInfo 响应中 ctime 字段为空字符串,go-sdk 旧版本对该字段直接调用 time.Parse(time.RFC3339, ""),触发 parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006" 报错。

qshell get / qdownload / qdownload2info.IsPublic == false 时会主动调用 bucket.GetBucketInfo 探测空间公私属性(iqshell/storage/object/download/operations/download.go:57),命中上述场景时下载直接失败并报 get bucket info error: ...

jira issue链接

主要变更点

  • fix bug
  • new feature
  • 不兼容变更

go-sdk v7.26.15 新增 parseBucketCreatedAt 助手对空字符串做容错(返回 time.Time{}),同时 BucketInfo.Ctime 字段类型由 int 改为 time.Time;qshell 仓库无任何代码直接使用该字段,运行时无感知。

影响范围

  • 所有调用 qshell get / qdownload / qdownload2info.IsPublic == false 探测空间属性的命令
  • 仅依赖升级间接生效,不修改 qshell 业务代码

Checklist

  • 已自测
  • 已更新Readme

@qiniu-prow

qiniu-prow Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YangSen-qn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the github.com/qiniu/go-sdk/v7 dependency to version v7.26.15 and documents the changes in the changelog. The reviewer pointed out that the changelog update was incorrectly made to a historical release section instead of the latest or upcoming release, which could lead to an inconsistent version history.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread CHANGELOG.md Outdated
fennoai[bot]

This comment was marked as outdated.

@YangSen-qn YangSen-qn changed the title 升级 go sdk 版本 chore(deps): 升级 go-sdk 到 v7.26.15 修复 GetBucketInfo 空 ctime 解析错误 Jul 9, 2026
BucketManager.GetBucketInfo 在服务端未返回 ctime 字段时
time.Parse(time.RFC3339, "") 会抛错(cannot parse "" as "2006"),
导致 qshell get / qdownload / qdownload2 在探测空间公私属性时失败。
v7.26.15 新增 parseBucketCreatedAt 助手对空字符串做容错,
同时 BucketInfo.Ctime 字段类型由 int 改为 time.Time,未返回时为零值。
@YangSen-qn

Copy link
Copy Markdown
Contributor Author

/review -claude

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: dependency bump go-sdk v7.26.14 → v7.26.15

No blocking issues found.

This is a clean, well-scoped patch-level dependency bump. Reviewed across correctness/quality, performance, security/supply-chain, and documentation:

  • Build & compatibility: go build ./... and go vet ./iqshell/storage/bucket/... pass. The SDK's storage.BucketInfo.Ctime changed from int to time.Time, and qshell aliases it via type BucketInfo storage.BucketInfo (iqshell/storage/bucket/bucket.go:30) with a pointer conversion. Since qshell never reads .Ctime (GetBucket in iqshell/storage/bucket/operations/bucket.go only prints other fields), the type change causes no source breakage or behavior change in qshell output.
  • Security / supply-chain: go.sum is consistent — both the module zip hash and the /go.mod hash for v7.26.15 are present, and stale intermediate entries (v7.26.11–v7.26.14) are correctly removed. The module-graph /go.mod hash is unchanged, as expected for a code-only patch.
  • Performance: No hot-path impact. GetBucketInfo is called once per command/batch, not per object.
  • Documentation: The CHANGELOG.md 2.19.10 entry is accurate — version follows 2.19.9, date 2026-07-09 is chronological, and the described SDK fix (empty ctime no longer failing time.Parse) is correctly characterized as an upstream SDK change.

Note: iqshell/storage/bucket/domain.go:43 (Ctime *data.Int) belongs to qshell's local DomainInfo struct and is unrelated to the SDK's BucketInfo; it is correctly untouched.

@YangSen-qn YangSen-qn merged commit 4d0d51b into qiniu:master Jul 10, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant