Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Foundation] Make BuildContext's cancellation handlers testable

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp

調査の方向性

BuildContext.RegisterCancellationHandler と UnregisterCancellationHandler から始め、Console.CancelKeyPress のサブスクリプションと BuildManager.CancellationHandler ファサードを追跡します。実際の Ctrl+C を使わずに、登録、登録解除、コンテキスト分離が検証されるよう specs を追加または更新します。完了条件は、seam が内部に維持され、4 つの受け入れ基準をすべて満たすことです。

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

説明

enhancement target/vCurrent

Follow-up from #451 (FT-2, #307).

Problem

BuildContext.RegisterCancellationHandler / UnregisterCancellationHandler — the two methods BuildManager.CancellationHandler exists to delegate to — have no positive coverage. The only spec on the facade (Cancellation_handler_facade_is_a_no_op_without_an_active_context) exercises the null-context path.

They can't be tested as written: registered handlers only run from the Console.CancelKeyPress subscription, and ConsoleCancelEventArgs has no public constructor, so the event can't be raised from a spec.

Outcome

A registered handler can be shown to run, and an unregistered one shown not to, without depending on a real Ctrl+C.

Needs a seam — e.g. an internal void InvokeCancellationHandlers() on BuildContext that the CancelKeyPress subscription calls, so specs can drive the same path. Worth settling before FT-4/5/6 move more per-run services onto the context.

Acceptance criteria

  • Registering through BuildManager.CancellationHandler with an active context runs the handler when cancellation is signalled.
  • Unregistering stops it running.
  • Handlers registered against one context don't run for another.
  • The seam stays internal — no InternalsVisibleTo to non-test assemblies.
主要言語
C#
スター
172
フォーク
21
平均マージ
4日 38分
マージ済み PR(30日)
14

環境構築

はじめの一歩

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

Fallout-build/Fallout のほかの issue

Fallout-build/Fallout の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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