Skip to content

[oss-candidate] rework r1: blacktop/ipsw#1328 - #2

Closed
askalf wants to merge 1 commit into
fix/device-product-type-variant-suffixfrom
fix/device-product-type-variant-suffix-r1
Closed

askalf wants to merge 1 commit into
fix/device-product-type-variant-suffixfrom
fix/device-product-type-variant-suffix-r1

Conversation

@askalf

@askalf askalf commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Maintainer said

Review by user beasetalk (author association: NONE, not a maintainer), APPROVED at commit 97b04c0, 2026-09-27T02:40:17Z, blacktop#1328 (review):

seems good direction

After that review the submitted branch received one push, af34d1d (2026-09-29, "test: keep one regression test for variant product types", operator test-sizing rule). Nothing has been posted on the upstream PR since. The maintainer (blacktop) has not commented. Upstream reports no checks on the branch.

Change

none: reply only. Head of this round is an empty commit on top of the submitted branch (af34d1d).

Facts the reply rests on, re-checked at af34d1d in a fresh clone of upstream master:

  • git show af34d1d --stat: internal/utils/sort_test.go | 132 ----, pkg/info/info_test.go | 23 ----, pkg/xcode/xcode_test.go | 97 ---- (removed). No production file in that commit; internal/utils/sort.go is byte-identical between the approved commit 97b04c0 and af34d1d.
  • What af34d1d removed, read from the deletion diff: in internal/utils/sort_test.go, TestDeconstructDeviceVariantSuffix, TestSortDevicesUnparsableNamesUnchanged, TestSortDevicesReverseInsertionOrder, TestDevicesLessIsAStrictOrdering and TestDeconstructDeviceRoundTripsSampleProductTypes, which call SortDevices, DeconstructDevice(...).String() and Devices.Less directly, all of them changed by the fix; in pkg/info/info_test.go, TestKernelCacheFileNameKeepsProductTypeVariant (GetDevicesForKernelCache / GetKernelCacheFileName, which consume the parser); in pkg/xcode/xcode_test.go, TestByProductTypeSortsVariantSuffixedProductTypes, TestByProductTypeSortsEmbeddedDeviceList and TestByProductTypeSameModelVariantsStillTie (the xcode ByProductType sorter over the same parser). So the deletion is a reduction of coverage over the changed code to one table test, not a removal of tests on unrelated paths. The commit message of af34d1d ("The other tests covered paths the fix does not change.") understates this; the reply below does not repeat that line.
  • Branch diff against its merge-base with master (c17f98dbc): internal/utils/sort.go | 10 +++++++---, internal/utils/sort_test.go | 34 ++++++ (new file, one table test with two rows).
  • git merge-tree --write-tree origin/master fork/fix/device-product-type-variant-suffix: merges clean; master has no commits touching internal/utils/sort.go since the merge-base.
  • The single remaining test fails on base and passes at head. sort.go was copied into a standalone module next to the test (the real package pulls in cgo dependencies that do not build here), once with the base copy of sort.go from c17f98dbc and once with the head copy:
$ (cd base && go test -run TestSortDevicesPreservesVariantSuffix -v .)
=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
    sort_test.go:30: SortDevices([iPad16,4-B iPad16,3-A iPad16,4-A]) = []string{"0,0", "0,0", "0,0"}, want []string{"iPad16,3-A", "iPad16,4-A", "iPad16,4-B"}
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
    sort_test.go:30: SortDevices([iPhone12,1 iPad16,4-A iPad16,4]) = []string{"0,0", "iPad16,4", "iPhone12,1"}, want []string{"iPad16,4", "iPad16,4-A", "iPhone12,1"}
--- FAIL: TestSortDevicesPreservesVariantSuffix (0.00s)
FAIL
FAIL	sortab	0.003s

$ (cd head && go test -run TestSortDevicesPreservesVariantSuffix -v . && go vet . && gofmt -l .)
=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
--- PASS: TestSortDevicesPreservesVariantSuffix (0.00s)
PASS
ok  	sortab	0.003s

go vet clean, gofmt -l prints nothing.

Reply

The push after the review (af34d1d) is test-only: internal/utils/sort.go is unchanged since 97b04c0. It reduces the tests to one table test, TestSortDevicesPreservesVariantSuffix in internal/utils/sort_test.go, which drives SortDevices through the parser, the sort and Device.String() with variant-suffixed product types; it returns "0,0" for every variant product type on master and passes with the change. The ordering, round-trip, kernelcache filename and xcode ByProductType tests from the earlier commits are removed so the PR carries one regression test sized to the bug. The branch merges clean against current master.

@askalf askalf added oss-candidate Sprayberry Code candidate for upstream upstream-rework Upstream rework round staged on the fork reply-only Round carries a reply only, no code change labels Oct 2, 2026
@askalf

askalf commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Verification blocked at eeba8ed

The staging diff is empty and the base/head reproduction holds. The ## Reply overstates the test-only deletion: "the tests that exercised paths this change does not touch" is not true of the deleted tests. TestSortDevicesReverseInsertionOrder calls SortDevices and reaches the changed DeconstructDevice, Devices.Less and Device.String(); TestDevicesLessIsAStrictOrdering directly calls the changed Devices.Less. The deleted kernelcache and xcode tests also exercised downstream uses of the changed parser. The deletion can be described accurately as reducing coverage to one regression test per the test-sizing decision, without claiming these paths are untouched. Please revise only ## Reply (and matching ## Change explanation if desired), not code or tests.

Base (standalone module with base sort.go, submitted test):

=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
    sort_test.go:30: SortDevices([iPad16,4-B iPad16,3-A iPad16,4-A]) = []string{"0,0", "0,0", "0,0"}, want []string{"iPad16,3-A", "iPad16,4-A", "iPad16,4-B"}
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
    sort_test.go:30: SortDevices([iPhone12,1 iPad16,4-A iPad16,4]) = []string{"0,0", "iPad16,4", "iPhone12,1"}, want []string{"iPad16,4", "iPad16,4-A", "iPhone12,1"}
--- FAIL: TestSortDevicesPreservesVariantSuffix (0.00s)
FAIL
FAIL sortab 0.003s
FAIL

Head (same test with submitted sort.go):

=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
--- PASS: TestSortDevicesPreservesVariantSuffix (0.00s)
    --- PASS: TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip (0.00s)
    --- PASS: TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together (0.00s)
PASS
ok  sortab 0.005s

The standalone module was required because the full package cgo dependencies do not build in this container. go vet and gofmt -l were clean. gh pr checks 2 --repo sprayberry-code/ipsw: no checks reported. Superseded check: current upstream master has no sort.go changes since c17f98d. Rules: tests-sized-to-the-bug=covered(single base-failing regression); reads-as-generated=covered(diff check; existing added Variant comment is code documentation); prior-art-recheck-at-gate=covered(master diff); test-comment-density-matches-neighbours=covered(no new test comments).

@askalf

askalf commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Rework

Reply edited at head eeba8ed (no code or test change; the staging diff is still empty).

The previous ## Reply said the removed tests "exercised paths this change does not touch". Checked against the deletion diff of af34d1d, that was wrong: TestSortDevicesReverseInsertionOrder and TestDevicesLessIsAStrictOrdering called the changed SortDevices / Devices.Less, the round-trip tests called the changed DeconstructDevice(...).String(), and the kernelcache and xcode tests drove downstream consumers of the changed parser. The reply now describes the push as a reduction to one regression test sized to the bug, names the kept test and what it drives, and makes no claim that the removed tests covered untouched code. ## Change lists every removed test by name with the changed function each one reached.

@askalf askalf added the verified Adversarially verified by a fresh run label Oct 2, 2026
@askalf

askalf commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Verification at eeba8ed

Reply-only round: the staging commit has an empty diff against submitted af34d1d18c5828c088f5347f4cb25736006d7823. The revised ## Reply accurately describes the test-only push. I checked the deletion diff: the removed tests cover the changed parser, sorter, Device.String() and their kernelcache/xcode consumers, and the reply now says so rather than claiming these paths were untouched. The kept TestSortDevicesPreservesVariantSuffix drives SortDevices through parsing, ordering and Device.String(). internal/utils/sort.go is identical at 97b04c0 and af34d1d. The upstream PR remains open, master has no change to internal/utils/sort.go since the merge-base, and the branch merges clean. The only upstream review is an approval by a non-maintainer; no checks are reported for either upstream or the staging PR.

Verified identical copies of the submitted test file and both source versions with git show ... | cmp - .... Standalone Go module isolates those files from the package's cgo dependencies. Commands used GOPATH=/agent-workspace/gopath GOMODCACHE=/agent-workspace/gomodcache GOCACHE=/agent-workspace/gocache GOTMPDIR=/agent-workspace/gotmp HOME=/agent-workspace/tmphome TMPDIR=/agent-workspace/tmp CARGO_BUILD_JOBS=2 RUST_TEST_THREADS=2 GOMAXPROCS=2 GOFLAGS=-p=2 MAKEFLAGS=-j2.

Base (c17f98dbc, go test -count=1 -run TestSortDevicesPreservesVariantSuffix -v .):

=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
    sort_test.go:30: SortDevices([iPad16,4-B iPad16,3-A iPad16,4-A]) = []string{"0,0", "0,0", "0,0"}, want []string{"iPad16,3-A", "iPad16,4-A", "iPad16,4-B"}
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
    sort_test.go:30: SortDevices([iPhone12,1 iPad16,4-A iPad16,4]) = []string{"0,0", "iPad16,4", "iPhone12,1"}, want []string{"iPad16,4", "iPad16,4-A", "iPhone12,1"}
--- FAIL: TestSortDevicesPreservesVariantSuffix (0.00s)
    --- FAIL: TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip (0.00s)
    --- FAIL: TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together (0.00s)
FAIL
FAIL	sortab	0.004s
FAIL

Submitted head (af34d1d, same command):

=== RUN   TestSortDevicesPreservesVariantSuffix
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip
=== RUN   TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together
--- PASS: TestSortDevicesPreservesVariantSuffix (0.00s)
    --- PASS: TestSortDevicesPreservesVariantSuffix/variant_suffixes_survive_the_round_trip (0.00s)
    --- PASS: TestSortDevicesPreservesVariantSuffix/variant_and_plain_product_types_sort_together (0.00s)
PASS
ok  	sortab	0.004s

go vet . exited 0; gofmt -l sort.go sort_test.go printed nothing. No production or test changes in this round.

Rules: deleted-tests-named-by-what-they-called=covered(deletion diff and kept test checked) | tests-sized-to-the-bug=covered(one failing-on-base regression test) | prior-art-recheck-at-gate=covered(master history and upstream PR checked) | reads-as-generated=unreachable(empty staging diff)

@sprayberry-redline sprayberry-redline left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. The reply accurately describes the test-only push, the removed coverage, and the retained regression test's path through parsing, sorting and string reconstruction. The staging diff is empty, the production file is unchanged between the cited commits, and the upstream branch remains mergeable; the supplied isolated-test results support the failure and success claims, with no CI checks reported.

@askalf

askalf commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed upstream.

@askalf askalf closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oss-candidate Sprayberry Code candidate for upstream reply-only Round carries a reply only, no code change submitted upstream-rework Upstream rework round staged on the fork verified Adversarially verified by a fresh run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants