allow for "budgets" as a deprecation handler
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- tooling
調査の方向性
config/deprecation-workflow.js のワークフロー設定から始め、既存のハンドラーがどのように設定されているかを確認します。予算のカウントをどのように追跡するか、予算を超過したときにいつエラーをスローするか、現在のカウントをブラウザーから設定にコピーする方法を定義します。提案した予算の動作が、silence、log、throw ハンドラーを壊すことなく、制御された実行で機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Context
Currently, ember-cli-deprecation-workflow supports 3 handlers for deprecations:
| silence | Keeps this deprecation from spewing all over the console |
|---|---|
| log | Normal deprecation behavior runs for this deprecation and messages are logged to the console |
| throw | The error is thrown instead of allowing the deprecated behavior to run. WARNING: APPLICATION MAY GO 💥 |
While these work for their intended purposes really well, they don't necessarily help cases where you might not be able to address a deprecation right away, but a team wants to prevent the deprecation count from growing from things like copy-pasting code that will cause new deprecations to pile up.
Proposal
Users of this addon will be able to specify a budget option to the handler option for each deprecation. If the deprecation is triggered more than the allowed budget in certain scenarios (e.g. a test suite run where conditions are more controlled), then the handler will throw. This would allow a team to keep existing code that causes deprecations but fail builds in CI for any new code that increases deprecation use.
For example, take the following config/deprecation-workflow.js:
// config/deprecation-workflow.js
window.deprecationWorkflow = window.deprecationWorkflow || {};
window.deprecationWorkflow.config = {
workflow: [
{ matchId: 'ember-string-utils.fmt', handler: { budget: 10 } },
]
};
if a new pull request was opened with the following code:
Ember.String.format('some string %s', 'hi')
This would increase the number of deprecations invoked to 11, violating the budget, causing ember-cli-deprecation-workflow to throw, failing the build.
We would likely also need some facility to make copy/pasting the existing deprecation count (to set the initial budget) to config/deprecation-workflow.js from the browser easier as well.
I'd be happy to PR this, just wanted to get thoughts on the idea before going through the effort of writing code.
- 主要言語
- JavaScript
- スター
- 166
- フォーク
- 44
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ember-cli/ember-cli-deprecation-workflow のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
ember-cli/ember-cli-deprecation-workflow#216 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
ember-cli/ember-cli-deprecation-workflow#208 · コメント 3 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
ember-cli/ember-cli-deprecation-workflow#195 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
documentation
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
ember-cli/ember-cli-deprecation-workflow#153 · コメント 1 件 ·
ember-cli/ember-cli-deprecation-workflow の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
521xueweihan/HelloGitHub#4115 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
outline/outline#14348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
area:install bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信