gitlink-cli/docs/issue-batch-test-report.md

56 lines
1.6 KiB
Markdown

# Issue Batch Maintenance Test Report
## Scope
The tests cover the Issue batch maintenance shortcuts:
- `issue +batch-list`
- `issue +batch-close`
- `issue +batch-label`
They focus on filtering, dry-run safety, output structure, and API behavior.
## Test Commands
```bash
gofmt -w shortcuts/issue/*.go shortcuts/common/*.go
go test ./shortcuts/issue
go test ./...
```
## Unit Coverage
Implemented coverage includes:
- batch-list filtering by state, label, and inactive days
- `older-than-days` filtering
- `limit` truncation behavior
- missing `updated_at` tolerance
- batch-close safety validation
- batch-close default dry-run behavior
- batch-close dry-run does not call `PATCH`
- batch-label requires `--add-label`
- JSON output can be unmarshaled
- table output is non-empty and includes dry-run or execution summary
- per-item write failures are recorded in `errors`
- httptest issue list response normalization
## Safety Verification
`issue +batch-close` refuses unsafe execution when:
- `--older-than-days` is missing
- `--older-than-days` is lower than `7`
- `--limit` is greater than `100`
`issue +batch-label` refuses missing `--add-label` and does not fake remote
label writes when the add-label endpoint is not implemented.
## Known Limitations
- `issue +batch-label --yes` reports an endpoint-unavailable error until a
stable label mutation endpoint is confirmed.
- The batch commands currently fetch the first page using the configured limit.
Larger multi-page workflows can be added later using the existing pagination
helper if maintainers want that behavior.