refactor: split daemon_handlers.go into per-domain files

Split the monolithic daemon_handlers.go into focused files:
  - daemon_handlers_account.go
  - daemon_handlers_console.go
  - daemon_handlers_igw.go
  - daemon_handlers_image.go
  - daemon_handlers_instance.go
  - daemon_handlers_key.go
  - daemon_handlers_snapshot.go
  - daemon_handlers_tag.go
  - daemon_handlers_volume.go
  - daemon_handlers_vpc.go

Add tests for ModifyVolume success, TerminateStoppedInstance with volumes,
DescribeInstanceTypes capacity filter, StartStoppedInstance type-not-available,
AttachVolume/DetachVolume validation paths, RunInstances error paths, and
DescribeInstances malformed ID.

Fix diff-coverage.sh to use git rename/copy detection (-M -C) so file
splits are not incorrectly flagged as all-new code.
This commit is contained in:
Julian Sommer
2026-02-24 14:28:24 +10:00
parent 8188707c91
commit deae613a75
17 changed files with 2680 additions and 1890 deletions
+4 -2
View File
@@ -64,8 +64,10 @@ TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
# --- Step 1: Extract added line numbers from diff ---
# Only non-test .go files that were added or modified
git diff "${BASE_REF}" HEAD --unified=0 --diff-filter=AM -- '*.go' ':!*_test.go' | awk '
# Only non-test .go files that were added or modified.
# -M enables rename detection so file splits/moves only count truly changed lines.
# -C enables copy detection for the same reason (file split = partial copy).
git diff "${BASE_REF}" HEAD --unified=0 -M -C --diff-filter=AM -- '*.go' ':!*_test.go' | awk '
/^\+\+\+ / {
file = substr($2, 3)
next