pipectl ignores a malformed --label or --labels value and acts on every application

オープン
#7,599 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

Start with the pipectl handlers for application list, deployment list, transfer backup, and transfer restore application, then trace where their --label or --labels values are parsed. Check the existing tests for those commands and add coverage for values without a colon, including env=prod. Done means each malformed value produces an error naming the value and does not run the command across every application; the issue author says a fix with tests is already ready.

索引モデルが issue の本文から書いたものです。

説明

What happened:

Four pipectl commands take label filters in the form KEY:VALUE, and they skip any value without a colon:

  • pipectl application list --label
  • pipectl deployment list --label
  • pipectl transfer backup --labels
  • pipectl transfer restore application --labels

So --labels=env=prod, or a typo such as --labels=env, silently removes the filter. The command then works on every application, with no warning. For transfer restore application this means restoring all applications in the backup instead of the ones the user selected.

What you expected to happen:

The command fails with an error that says which value is wrong.

How to reproduce it:

pipectl transfer restore application --labels=env=prod \
  --input-file=backup.json --piped-id-mapping-file=mapping.json \
  --address=... --api-key=...

Every application in backup.json is restored.

Environment:

  • piped version: not relevant
  • control-plane version: not relevant
  • Others: pipectl at master (cd72c196)

I'd like to work on this. I have a fix with tests ready: https://github.com/pipe-cd/pipecd/compare/master...itsnjstyle27:pipecd:fix/pipectl-malformed-labels

主要言語
Go
スター
1.4k
フォーク
391
平均マージ
4日 1時間
マージ済み PR(30日)
58

環境構築

はじめの一歩

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

pipe-cd/pipecd のほかの issue

pipe-cd/pipecd の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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