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

オープン 初心者向け
#331 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

pkg/rsqueue/utils/utils.goと、指定された4つのテストファイルagent_test.go、queue_test.go、runnerfactory_test.go、utils_test.goを読みます。SliceEquivalentの使い方と、testifyのElementsMatchが適しているかを確認します。productionの依存関係に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時間
マージ済み PR(30日)
8

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rstudio/platform-lib のほかの issue

rstudio/platform-lib の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。