Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ labels: quality improvement
.\2_RunAllTests.ps1
.\3_SmokeTest.ps1

合格の目安は 全ステップ OK / 8-8 差分 0 / 25-25
合格の目安は 全ステップ OK / 8-8 差分 0 / 29-29
-->

## 利用者への影響
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.\2_RunAllTests.ps1
.\3_SmokeTest.ps1

合格の目安は 全ステップ OK / 8-8 差分 0 / 25-25
合格の目安は 全ステップ OK / 8-8 差分 0 / 29-29
文書だけの変更なら「不要」と書いてください。
-->

Expand Down
100 changes: 18 additions & 82 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,105 +180,41 @@ Copyright ブロックの扱い、`ArgumentException` 系の引数の順、`.bat
| 単体テストの実行と判定 | [`TESTING.md`](root/programs/TESTING.md) |
| サンプルの疎通確認 | [`SMOKETEST.md`](root/programs/SMOKETEST.md) |

検証は次の 3 本で、いずれも終了コードで合否が分かる。**この順で実行すること。**
検証は `1_BuildAll.ps1`(ビルド)→ `2_RunAllTests.ps1`(単体テスト)→
`3_SmokeTest.ps1`(疎通)の 3 本で、いずれも終了コードで合否が分かる。
**順序は固定**(1 のクリーンとアセンブリ配置が 2・3 の前提)。

```powershell
cd root\programs
.\1_BuildAll.ps1 # 全ビルド
.\2_RunAllTests.ps1 # 単体テスト
.\3_SmokeTest.ps1 # サンプルの疎通
```
**本書にコマンドは書かない。** 引数(`-IgnoreErrors` / `-Only` / `-List` / `-Lang`)と
合格の目安は [`CHEATSHEET.md`](root/programs/CHEATSHEET.md) 1 節が一次情報である。
**転記すると、両方を直さないかぎりズレる。**

`2_RunAllTests.ps1` はワーキング ツリーの `Result*.txt` を書き換える(従来のバッチ運用と同じ)。
**コミットの要否は人が判断する**ため、エージェントは差分を報告するに留める。
**`-Only` で絞れば、書き換わるのも絞った分だけになる。**

**エージェントは、この 3 本を個別に実行することを検討する。**(#576)
`0_RunAll.ps1` は 3 本をまとめて回す**利用者向けの入口**であり、
**必要な 1 本だけを選ぶ、という判断が入らない。**
どれを回すかは、次節の対応表で決める。

```powershell
.\1_BuildAll.ps1 -Only "Framework_Tool" # ビルドするものだけ
.\2_RunAllTests.ps1 -Only "TestBatch" # テスト結果 Result*.txt が絞られる
.\3_SmokeTest.ps1 -Only "DeployZip" # 確かめるものだけ
```

**`-Only` に何を指定できるかは `-List` で出す。**
**文書には一覧を書かない。** 対象が増減したときに古くなるため、
スクリプト自身を一次情報にする(ツールの `/HELP` と同じ考え方)。

```powershell
.\1_BuildAll.ps1 -List -Lang Both # 45 ステップ
.\2_RunAllTests.ps1 -List # 8 件
.\3_SmokeTest.ps1 -List -Lang VB # 6 件(-Lang が効く)
```

**3 本とも `-Only` が空振りしたら終了コード 1 で止まる。**
打ち間違いが「全ステップ OK」になることはない。

#### 通しで回す前に、依存関係を見る(#576)
#### 回す範囲は、依存関係で決める(#576)

**全部回すのは「安全」ではない。遅いだけのことがある。**

依存の向きは一方向で、段は 2 つしかない。

```
基盤 NuGet / Business / Business.RichClient / CopyAssemblies
↓ (ここが変われば、下は全部やり直し)
末端 Tools / 各サンプル / Tests
```

**ツールと個別サンプルは末端である。** そこを変えても、基盤も他のサンプルも変わらない。

| 変更した場所 | `1_BuildAll` | `2_RunAllTests` | `3_SmokeTest` |
|---|---|---|---|
| `Infrastructure/`(基盤) | **通し** | **通し** | **通し** |
| `Tools/`(ツール) | `-Only Framework_Tool` | **不要** | `-Only <そのツール>` |
| 個別サンプル | `-Only <サンプル>` | **不要** | `-Only <サンプル>` |
| `Tests/` | `-Only <対象>` | `-Only <対象>` | **不要** |
| `.ps1` / `.md` のみ | **不要** | **不要** | **不要** |

**`2_RunAllTests.ps1` の対象はフレームワークのテストだけ**である。
`Tools/` や個別サンプルを変えても、ここは動かない。回す理由が無い。

実測(`0_RunAll.ps1 -Lang Both` は 24.6 分)。

```
基盤のビルド 122.8 秒
Framework_Tool 系だけ 74.8 秒 ← ツールの変更で必要なのはこちら
2_RunAllTests 通し 111.6 秒
2_RunAllTests -Only 35 秒ほど
```

**ツールだけの変更なら、1/16 ほどで終わる。**

#### 時間だけの問題ではない
`0_RunAll.ps1` は 3 本をまとめて回す**利用者向けの入口**であり、
**必要な 1 本だけを選ぶ、という判断が入らない。**
エージェントは**3 本を個別に実行することを検討する。**

`2_RunAllTests.ps1` は**ワーキング ツリーの `Result*.txt` を書き換える。**
関係の無い対象まで回すと、**人が確認してコミットする差分が増える。**
ツールと個別サンプルは**依存の末端**で、そこを変えても基盤も他のサンプルも変わらない。
`2_RunAllTests.ps1` の対象は**フレームワークのテストだけ**で、
ツールやサンプルを変えても動かない。**回す理由が無い。**

`-Only` で絞れば、書き換わるのは絞った対象の分だけになる。
**どこまで回すかは [`CHEATSHEET.md`](root/programs/CHEATSHEET.md) 1 節の対応表で決める。**

#### それでも通しを回す場面
通しを回すのは次の場合。

- **基盤(`Infrastructure/`)に触れたとき**
- **リリース前**(`RELEASE.md`)
- **絞り込みで妙なエラーが出たとき**(再現するかを見る)

3 本目は制約による誤検知が実際にある。
`-Only` は前段が用意した状態に依存するステップを落とすことがあり、
**変更と無関係なエラーに見える。** 詳細は
[`CHEATSHEET.md`](root/programs/CHEATSHEET.md) 1 節の
「`-Only` + `-SkipClean` は万能ではない」。
- **リリース前**([`RELEASE.md`](root/programs/RELEASE.md))
- **絞り込みで妙なエラーが出たとき**(再現するかを見る。制約による誤検知が実際にある)

**判断に迷ったら通しでよい。** ただし**迷っていないのに通すのは、ただの浪費である。**

**上記の既定は C# 側である。VB 側に手を入れたときは `-Lang` で回す。**

```powershell
.\0_RunAll.ps1 -Lang VB # 1 と 3 を VB で通す(2 は VB に対象が無い)
```

理由と対象は [`BUILDING.md`](root/programs/BUILDING.md) 10 節・
[`SMOKETEST.md`](root/programs/SMOKETEST.md) 10 節。

Expand Down
2 changes: 1 addition & 1 deletion root/programs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ VS 18 のある環境では従来どおり `18.0` になるため、**挙動は
### 実測(run 30984111639 : 全ステップ成功)

> **当時の件数での記録。** その後、単体テストは 8 ケース(#520)、
> 疎通は 25 件(#528、#546、#566、#570、#571)である。**時間の目安として読むこと。**
> 疎通は 29 件(#528、#546、#566、#570、#571、#578)である。**時間の目安として読むこと。**

### 警告の内訳を見る(`-WarnDetail`、#571)

Expand Down
44 changes: 36 additions & 8 deletions root/programs/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cd root\programs
|---|---|---|
| ビルド | 全ステップ OK | [`BUILDING.md`](BUILDING.md) |
| 単体テスト | 8/8 OK、差分 0 | [`TESTING.md`](TESTING.md) |
| 疎通 | 25/25 OK | [`SMOKETEST.md`](SMOKETEST.md) |
| 疎通 | 29/29 OK | [`SMOKETEST.md`](SMOKETEST.md) |

**既定は C# 側。VB 側は `-Lang` で回す**(3 節)。

Expand All @@ -41,14 +41,16 @@ cd root\programs

### 通しは長い。反復では絞り込む(#571)

実測(`-Lang Both`)は **合計 21.7 分**で、内訳はこうなっている。
実測(`-Lang Both`)は **合計 24.6 分**で、内訳はこうなっている。

```
1_BuildAll.ps1 12.6 分 ← 58%。ここが主因
2_RunAllTests.ps1 1.7
3_SmokeTest.ps1 7.4
1_BuildAll.ps1 15.5 分 ← 63%。ここが主因
2_RunAllTests.ps1 1.9
3_SmokeTest.ps1 7.3
```

**環境と状態で振れる。** 桁を掴むための目安として見ること。

**変更した箇所だけを回す。** 通しは最後に 1 回でよい。

```powershell
Expand All @@ -64,10 +66,36 @@ cd root\programs
```

**どこまで回すかは依存関係で決まる。**(#576)
ツールと個別サンプルは末端なので、基盤のビルドも他のサンプルの疎通も要らない。

依存の向きは一方向で、段は 2 つしかない。

```
基盤 NuGet / Business / Business.RichClient / CopyAssemblies
↓ (ここが変われば、下は全部やり直し)
末端 Tools / 各サンプル / Tests
```

| 変更した場所 | `1_BuildAll` | `2_RunAllTests` | `3_SmokeTest` |
|---|---|---|---|
| `Infrastructure/`(基盤) | **通し** | **通し** | **通し** |
| `Tools/`(ツール) | `-Only Framework_Tool` | **不要** | `-Only <そのツール>` |
| 個別サンプル | `-Only <サンプル>` | **不要** | `-Only <サンプル>` |
| `Tests/` | `-Only <対象>` | `-Only <対象>` | **不要** |
| `.ps1` / `.md` のみ | **不要** | **不要** | **不要** |

**`2_RunAllTests.ps1` の対象はフレームワークのテストだけ**で、
ツールやサンプルを変えても動かないため、回す理由が無い。
対応表は [`AGENTS.md`](../../AGENTS.md)「通しで回す前に、依存関係を見る」。
ツールやサンプルを変えても動かない。**回す理由が無い。**

**ツールだけの変更なら、通しの 1/16 ほどで終わる。**

```
基盤のビルド 122.8 秒
Framework_Tool 系だけ 74.8 秒 ← ツールの変更で必要なのはこちら
2_RunAllTests 通し 111.6 秒
2_RunAllTests -Only 35 秒ほど
```

**通しを回す場面の判断は [`AGENTS.md`](../../AGENTS.md)「回す範囲は、依存関係で決める」。**

**警告が多いステップの内訳を見る。**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2018/08/08 西野 大介 新規作成
//* 2026/08/21 玄人 幸道 CS4014対応(GetUserInfoAsyncを待つ。ログのUserInfoが空になっていた)
//* 2026/08/21 玄人 幸道 CS4014対応(GetUserInfoAsyncを待つ。ログのUserInfoが空になっていた)(#575)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
//* 2014/10/03 Rituparna Added constants for RadioButtonList,CheckBoxList events and prefix.
//* 2015/04/16 Supragyan Added constants for Textbox events and prefix.
//* 2017/08/28 西野 大介 非同期メソッドのリテラルを追加した。
//* 2026/08/14 玄人 幸道 ConnectionGroupNameが現在は効果を持たない旨をremarksに明記(#546)
//**********************************************************************************

namespace Touryo.Infrastructure.Framework.Util
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/08 玄人 幸道 新規作成(#524)
//* 2026/08/08 玄人 幸道 解凍したファイルのパスを保持するExtractedFilesを追加(#528)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/08 玄人 幸道 新規作成(#524)
//* 2026/08/08 玄人 幸道 ZippedFiles・ExtractedFilesの追加に伴う共通部の調整(#528)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/08 玄人 幸道 新規作成(#524)
//* 2026/08/08 玄人 幸道 ZippedFiles・ExtractedFilesの追加に伴う定義の調整(#528)
//**********************************************************************************

namespace Touryo.Infrastructure.Public.IO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/08 玄人 幸道 新規作成(#524)
//* 2026/08/08 玄人 幸道 圧縮したファイルのパスを保持するZippedFilesを追加(#528)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//* 2019/06/25 西野 大介 インスタンス・メソッド化(ES256, 384, 512対応)
//* 2026/08/01 玄人 幸道 jose-jwtへの依存を解消(JwkToCngをBCLのみで実装)
//* ※ 楕円曲線の決定にcrvを使用するため、jose-jwt非互換。
//* 2026/08/21 玄人 幸道 CA1416対応(JwkToCngにSupportedOSPlatformを付与)
//* 2026/08/21 玄人 幸道 CA1416対応(JwkToCngにSupportedOSPlatformを付与)(#575)
//**********************************************************************************

using System;
Expand Down
1 change: 1 addition & 0 deletions root/programs/CS/Frameworks/Tests/TestCode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//* 2019/02/06 西野 大介 新規作成
//* 2026/08/18 玄人 幸道 各テストを個別に try で囲むようにした(#564)。
//* 1 つが例外を投げると、以降が実行されなかった。
//* 2026/08/08 玄人 幸道 TestZipV2の呼び出しを追加(#524)
//**********************************************************************************

using System;
Expand Down
2 changes: 2 additions & 0 deletions root/programs/CS/Frameworks/Tests/TestCode/TestDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/06 玄人 幸道 新規作成(#522)
//* 2026/08/14 玄人 幸道 JSONの往復と、行ステータスの往復を追加(#544)
//* 2026/08/18 玄人 幸道 keepOriginalとバッチ更新の使い方のテストを追加(#567)
//* 2026/08/17 玄人 幸道 DTTablesの中間形式のテストを追加(#552)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2020/07/31 西野 大介 新規作成
//* 2026/08/17 玄人 幸道 ログレベルの有効・無効(IsDebugEnabledほか)のテストを追加(#552)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/06 玄人 幸道 新規作成(#522)
//* 2026/08/17 玄人 幸道 LoadAsStreamのテストを追加(#552)
//**********************************************************************************

using System;
Expand Down
1 change: 1 addition & 0 deletions root/programs/CS/Frameworks/Tests/TestCode/TestUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/06 玄人 幸道 新規作成(#522)
//* 2026/08/17 玄人 幸道 設定取得・環境変数展開・コマンド引数のテストを追加(#552)
//**********************************************************************************

using System;
Expand Down
1 change: 1 addition & 0 deletions root/programs/CS/Frameworks/Tests/TestCode/TestXmlLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2019/05/30 西野 大介 新規作成
//* 2026/08/18 玄人 幸道 GetAttributeByTagNameのindex指定と範囲外の挙動のテストを追加(#563)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
//* 2020/08/03 西野 大介 NETCOREAPP対応
//* 2026/08/01 玄人 幸道 ZIP部品をV2へ差し替え(#524)。
//* CUI化のためマニフェスト生成と圧縮をstaticメソッドへ抽出(#528)
//* 2026/08/11 玄人 幸道 文言の直書きをやめ、Resource.resxとResourceMgrへ移した(#528)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
//* 2011/09/12 西野 大介 画面表示せず、ログ出力のみする例外処理方式を追加
//* 2014/04/26 Sai Replaced all the Japanese language in both UI and code with ResorceManager.GetString() method call
//* 2020/08/03 西野 大介 NETCOREAPP対応
//* 2026/08/08 玄人 幸道 ZippedFiles・ExtractedFilesの利用に合わせた調整(#528)
//* 2026/08/21 玄人 幸道 SYSLIB0003対応(CASを#if !NETCOREAPPで囲む。net48では生きているため)(#575)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
//* 2016/01/07 Sandeep Comment out the DefaultWebProxy property, because there is no use of this property in the component
//* 2026/08/01 玄人 幸道 CUI化(/MFTGEN, /ZIPGEN, /TOPONLY)と、引数不正時のGUI起動抑止(#528)。
//* 設定・履歴の保存をBinarySerializeからJSONへ変更
//* 2026/08/21 玄人 幸道 SYSLIB0021/0014対応(MD5.CreateとHttpClientへ移行)(#575)
//**********************************************************************************

using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 2026/08/20 玄人 幸道 新規作成(#570)
//* 2026/08/21 玄人 幸道 CSRFが成立しない前提をコメントに明記(CodeQL誤検知)
//**********************************************************************************

using System;
Expand Down Expand Up @@ -56,6 +57,16 @@ namespace ASPNETWebService.Controllers
/// 更新 : JSON → DTTables → ToDataTable() → RowState と Original が戻った DataTable
///
/// **keepOriginal を立てないと、楽観排他が組めない。**(#567)
///
/// **OAuth2 の Resource Server であり、CSRF は成立しない。**
/// Cookie 認証を使わず(Startup.cs で UseAuthentication を無効化)、
/// 認証は Authorization: Bearer ヘッダ。**ブラウザは自動付与しない。**
/// CORS も AllowCredentials を外してあり、資格情報を送らない構成。
///
/// **ValidateAntiForgeryToken は付けないこと。**
/// 非ブラウザのクライアント(Frameworks/Tests/TestWebAPIClient)は
/// トークンを持たないため、付けると疎通が壊れる。
/// CodeQL の cs/web/missing-token-validation は false positive として dismiss 済み。
/// </remarks>
[EnableCors]
[ApiController]
Expand Down
Loading