Skip to content

fix(labels): support older Ruby hash iteration#431

Merged
ss-o merged 1 commit into
mainfrom
fix-411-label-sync-ruby-compat
May 27, 2026
Merged

fix(labels): support older Ruby hash iteration#431
ss-o merged 1 commit into
mainfrom
fix-411-label-sync-ruby-compat

Conversation

@ss-o
Copy link
Copy Markdown
Member

@ss-o ss-o commented May 27, 2026

Summary

Fixes the label sync audit script used by the #411 label-taxonomy rollout.

On the local Ruby available in this maintainer environment, Hash#filter_map is unavailable, so the documented dry-run command failed before it could audit labels. This changes the two hash filter_map call sites to each_with_object([]) while preserving the same output shape.

Verification

  • ruby -c scripts/labels-sync.rb
  • ruby -e 'require "yaml"; data=YAML.safe_load(File.read("lib/labels.yml"), aliases: false); names=data.fetch("labels").map{|l| l.fetch("name")}; abort "duplicate labels" unless names.uniq == names; puts "labels=#{names.size} legacy=#{data.fetch("legacy_migrations").size}"'
  • scripts/labels-sync.rb --repo z-shell/.github --include-clean
    • Read-only dry run.
    • Canonical labels: 31.
    • Legacy migrations: 30.
    • Repos scanned: 1.
    • Repos with drift: 0.
    • z-shell/.github clean.

Related

Refs #411.

Agent handoff

No handoff needed.

Copilot AI review requested due to automatic review settings May 27, 2026 01:51
@ss-o ss-o requested a review from a team as a code owner May 27, 2026 01:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the label sync audit script used during the label taxonomy rollout to run on older Ruby versions by removing usage of Hash#filter_map, which is unavailable in the maintainer environment.

Changes:

  • Replaced two Hash#filter_map call sites with each_with_object([]) to preserve output shape while restoring compatibility.
  • Kept the resulting updates and legacy_present arrays identical in structure for downstream sorting and summaries.

@ss-o ss-o merged commit 87a4cf5 into main May 27, 2026
4 checks passed
@ss-o ss-o deleted the fix-411-label-sync-ruby-compat branch May 27, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants