Skip to content

Conversation

@amustaque97
Copy link
Contributor

@amustaque97 amustaque97 commented Dec 16, 2025

Summary

  • Replace HashSet with BTreeSet for deterministic ordering
  • Simplify diff_environments logic using set operations directly
  • Simplify EnvironmentDiff enum by using tuple variants
  • Remove unused patterns_equal function
  • Update test snapshots to match the new enum structure

Separate PR is asked in one of the comments #2168 (comment), and it makes sense. This is done as part of refactoring existing code; there are no functionality changes.

cc @marcoieni

- Replace HashSet with BTreeSet for deterministic ordering
- Simplify diff_environments logic using set operations directly
- Simplify EnvironmentDiff enum by using tuple variants
- Remove unused patterns_equal function
- Update test snapshots to match new enum structure

This refactoring makes the environment diffing code cleaner and more
maintainable while ensuring consistent output ordering.
@github-actions
Copy link

Dry-run check results

[WARN  sync_team] sync-team is running in dry mode, no changes will be applied.
[INFO  sync_team] synchronizing crates-io
[INFO  sync_team] synchronizing github

remove_branches: Vec<String>,
add_tags: Vec<String>,
remove_tags: Vec<String>,
new_branches: Vec<String>,
Copy link
Member

Choose a reason for hiding this comment

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

I think that it would be better if the sync code directly operated on branches/tags to add or remove, rather than having generic code that then tries to load the current state from GitHub again when doing the sync.

In other words, I would remove new_branches and new_tags, and keep only add/remove.

Copy link
Member

Choose a reason for hiding this comment

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

I approved this PR because it's an improvement with respect to the previous code.
This improvement can be done in another PR 👍

@marcoieni marcoieni added this pull request to the merge queue Dec 16, 2025
Merged via the queue into rust-lang:main with commit c316c8e Dec 16, 2025
6 checks passed
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.

3 participants