Skip to content

refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)>#1445

Open
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/share-styledglyph-across-queue-show-status--8ed9bb5ffrom
devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29
Open

refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)>#1445
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/share-styledglyph-across-queue-show-status--8ed9bb5ffrom
devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 19, 2026

group_by_scope in queue status returned IndexMap<String, Vec<&Batch>> because the human renderer needs first-seen
insertion order (mirrors Python dict iteration). That's one
hashmap-shaped use of the only IndexMap in the codebase — and
the typical input size is 1–3 scopes per repo.

At that N, the hashing/bucketing overhead of IndexMap is dead
weight versus a Vec<(K, V)> with a linear iter_mut().find()
on insert. Same wire shape from the caller's side (still iterable
by (scope, batches)), one fewer crate in Cargo.lock.

indexmap survives transitively (it's an internal dep of
jsonschema), so the lockfile loses one direct line but keeps the
package — that's fine, the goal here is to shed a direct
dependency we control, not to fight upstream graphs.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

Depends-On: #1444

@jd
Copy link
Copy Markdown
Member Author

jd commented May 19, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(cli): make mergify --help list Python-shimmed commands too #1452
2 test(freeze): add live smoke test for freeze create/update/delete #1436
3 feat(rust): port freeze create/update/delete to native Rust #1437
4 refactor(rust): dedupe emit-helper boilerplate across command crates #1438
5 refactor(rust): share test scaffolding via mergify-test-support crate #1439
6 refactor(core): introduce CommandContext for the queue+freeze prelude #1441
7 refactor(ci): consolidate the CI-env scrubber into a shared testing module #1442
8 refactor: drop stale Phase X.Y doc markers and one inline color branch #1443
9 refactor(tui): share StyledGlyph across queue show/status renderers #1444
10 refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)> #1445 👈
11 refactor(ci): swap uuid for getrandom in the GHA heredoc delimiter #1446
12 refactor(config): standardize the workspace on serde_yaml_ng for YAML parsing #1447

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 19, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify Bot requested a review from a team May 19, 2026 15:31
@jd jd marked this pull request as ready for review May 20, 2026 07:11
sileht
sileht previously approved these changes May 20, 2026
@mergify mergify Bot requested a review from a team May 20, 2026 07:42
@jd jd force-pushed the devs/jd/worktree-rust-port/share-styledglyph-across-queue-show-status--8ed9bb5f branch from d729c8f to 66bd10c Compare May 20, 2026 08:42
@jd jd force-pushed the devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29 branch from e31730b to 57559b2 Compare May 20, 2026 08:42
@jd jd temporarily deployed to func-tests-live May 20, 2026 08:42 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 20, 2026

Revision history

# Type Changes Reason Date
1 initial e31730b 2026-05-20 08:42 UTC
2 rebase e31730b → 57559b2 (rebase only) 2026-05-20 08:42 UTC
3 rebase 57559b2 → 1d374a9 (rebase only) 2026-05-20 09:05 UTC
4 rebase 1d374a9 → a5fc066 (rebase only) 2026-05-21 07:25 UTC
5 rebase a5fc066 → a6e2beb (rebase only) 2026-05-21 07:56 UTC

@mergify mergify Bot dismissed sileht’s stale review May 20, 2026 08:43

Pull request has been modified.

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 08:43 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/share-styledglyph-across-queue-show-status--8ed9bb5f branch from 66bd10c to c6ab109 Compare May 20, 2026 09:05
@jd jd force-pushed the devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29 branch from 57559b2 to 1d374a9 Compare May 20, 2026 09:05
@jd jd temporarily deployed to func-tests-live May 20, 2026 09:05 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 09:06 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29 branch from 1d374a9 to a5fc066 Compare May 21, 2026 07:24
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:25 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 21, 2026 07:25 Failure
`group_by_scope` in `queue status` returned `IndexMap<String,
Vec<&Batch>>` because the human renderer needs first-seen
insertion order (mirrors Python dict iteration). That's one
hashmap-shaped use of the only `IndexMap` in the codebase — and
the typical input size is 1–3 scopes per repo.

At that N, the hashing/bucketing overhead of `IndexMap` is dead
weight versus a `Vec<(K, V)>` with a linear `iter_mut().find()`
on insert. Same wire shape from the caller's side (still iterable
by `(scope, batches)`), one fewer crate in `Cargo.lock`.

`indexmap` survives transitively (it's an internal dep of
`jsonschema`), so the lockfile loses one direct line but keeps the
package — that's fine, the goal here is to shed a *direct*
dependency we control, not to fight upstream graphs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I7085cf297a6a294217b0a6656a4bc224a1dd2c58
@jd jd force-pushed the devs/jd/worktree-rust-port/drop-indexmap-group-scope-returns-vec-k-v--7085cf29 branch from a5fc066 to a6e2beb Compare May 21, 2026 07:55
@jd jd force-pushed the devs/jd/worktree-rust-port/share-styledglyph-across-queue-show-status--8ed9bb5f branch from 62b1222 to 52176dc Compare May 21, 2026 07:56
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:56 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:56 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:56 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 21, 2026 07:56 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants