fix(labels): support older Ruby hash iteration#431
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_mapcall sites witheach_with_object([])to preserve output shape while restoring compatibility. - Kept the resulting
updatesandlegacy_presentarrays identical in structure for downstream sorting and summaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the label sync audit script used by the
#411label-taxonomy rollout.On the local Ruby available in this maintainer environment,
Hash#filter_mapis unavailable, so the documented dry-run command failed before it could audit labels. This changes the two hashfilter_mapcall sites toeach_with_object([])while preserving the same output shape.Verification
ruby -c scripts/labels-sync.rbruby -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-cleanz-shell/.githubclean.Related
Refs #411.
Agent handoff
No handoff needed.