Skip to content

update naturalsort sorting with slice - #7269

Draft
thaJeztah wants to merge 13 commits into
docker:masterfrom
thaJeztah:slice_and_dice_step2
Draft

update naturalsort sorting with slice#7269
thaJeztah wants to merge 13 commits into
docker:masterfrom
thaJeztah:slice_and_dice_step2

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Sep 2, 2026

Copy link
Copy Markdown
Member

vendor: github.com/fvbommel/sortorder v1.2.0

full diff: fvbommel/sortorder@v1.1.0...v1.2.0

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.8.0 milestone Sep 2, 2026
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Sep 2, 2026
@codecov-commenter

codecov-commenter commented Sep 2, 2026

Copy link
Copy Markdown

@thaJeztah
thaJeztah force-pushed the slice_and_dice_step2 branch from 4044fe5 to 6dc2fa8 Compare September 2, 2026 01:00

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Review incomplete

chunk 1: Drafter did not complete
chunk 2: Drafter did not complete
chunk 3: Drafter did not complete

All three drafter delegations failed with a sub-agent schema validation error (output_config.format.schema: Unsupported regex feature). The automated hypothesis-generation pipeline could not run.

Manual inspection summary (orchestrator-level): The diff was reviewed directly. This PR is a clean mechanical migration from sort.Slice/sort.Sort to slices.SortFunc/slices.SortStableFunc in tandem with vendoring github.com/fvbommel/sortorder v1.2.0 (which adds NaturalCompare for three-way comparison). All comparator semantics were verified to be preserved correctly:

  • sort.Sliceslices.SortFunc conversions: comparator directions correct throughout.
  • sort.SliceStable / sort.Stableslices.SortStableFunc: stability preserved.
  • slices.SortedFunc(maps.Values(emptyMap), ...) returns nil in Go 1.24, so the updateUlimits "remove all" test expectation (nil) remains satisfied.
  • cmp.Or / cmp.Compare port-sort replacements match the original field ordering.
  • formatAdminRole key-ID sort now creates a copy instead of mutating the receiver — a bug fix.
  • toStringList %s%v format change is safer for non-string any values.
  • filepath.IsLocal path-escape check in cli/config/config.go is more robust than the old strings.HasPrefix approach.

No bugs were identified in the manual pass. However, since the automated pipeline did not complete, this review cannot be treated as a full automated review.

Findings so far: ⚠️ INCOMPLETE

@thaJeztah
thaJeztah force-pushed the slice_and_dice_step2 branch from 6dc2fa8 to b7a8460 Compare September 2, 2026 07:47
@thaJeztah thaJeztah changed the title vendor: github.com/fvbommel/sortorder v1.2.0 and update sort update naturalsort sorting with slice Sep 2, 2026
full diff: fvbommel/sortorder@v1.1.0...v1.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use filepath.Rel and filepath.IsLocal instead of comparing path prefixes
as strings when checking that a path stays within the config directory.

Also avoid calling Dir multiple times when constructing and validating
the path.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Extract construction of the cluster volume spec from runCreate, and use
struct literals for the individual cluster volume options.

Also simplify topology parsing by reusing ConvertKVStringsToMap, use
slices.SortFunc for deterministic secret ordering, and use max to clamp
negative capacity values to zero.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah force-pushed the slice_and_dice_step2 branch from b7a8460 to 904816a Compare September 2, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants