Move the SliceEquivalent gocheck checker out of rsqueue/utils production code

未关闭 适合新手
#331 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
backend

调研方向

阅读 pkg/rsqueue/utils/utils.go 和提到的四个测试文件:agent_test.go、queue_test.go、runnerfactory_test.go 和 utils_test.go。检查它们如何使用 SliceEquivalent,以及 testify 的 ElementsMatch 是否合适。移动或替换检查器,使生产依赖不再包含 gopkg.in/check.v1;使用提供的 go list -deps 命令验证。

由索引模型根据 Issue 内容生成。

描述

Problem

pkg/rsqueue/utils/utils.go is production code, but it defines the gocheck checker SliceEquivalent and imports gopkg.in/check.v1. The production packages rsqueue/agent and rsqueue/impls/database import rsqueue/utils for IsSqliteLockError. As a result, every program that uses the rsqueue agent or the database queue links gopkg.in/check.v1.

Only tests use SliceEquivalent: agent_test.go, queue_test.go, runnerfactory_test.go and utils_test.go.

Package Manager is removing gopkg.in/check.v1 (rstudio/package-manager#22451). After that work, this package is the only path that links gopkg.in/check.v1 into the Package Manager server binary.

Fix

Move SliceEquivalent out of utils.go, for example into the _test.go files that use it or into a test-only helper package. Or replace it with testify's ElementsMatch. Then make a new release.

How to reproduce

With platform-lib v4.5.0:

go list -deps github.com/rstudio/platform-lib/v4/pkg/rsqueue/agent | grep check.v1

The command prints gopkg.in/check.v1.

主要语言
Go
星标
12
派生
0
平均合并
1 天 2 小时
30 天内合并 PR
8

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rstudio/platform-lib 的其他 Issue

查看 rstudio/platform-lib 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。