Skip to content

Ensure deterministic order for filtered public imports#3734

Merged
emcfarlane merged 3 commits intomainfrom
ed/fixPublicImportsOrder
Apr 2, 2025
Merged

Ensure deterministic order for filtered public imports#3734
emcfarlane merged 3 commits intomainfrom
ed/fixPublicImportsOrder

Conversation

@emcfarlane
Copy link
Contributor

This ensures that public imports are always added to the image in a deterministic way. It changes the current order by first seen to order by file name. First seen is not valid as when including options we range over them in an undefined order (although from testing it looks to always be in tag order).

Related to #3506 and #3725 . Both these issues link to the same error of adding unused imports. This was fixed in #3727 . This PR fixes an edge case where if 2 or more public imports are resolved for a file, they must be appended to the current imports in a deterministic way.

This ensures that public imports are always added to the image in a
deterministic way. It changes the current ordering by first seen to
ordered by file name. First seen is not valid as when including options
we range over them in a undeterministic way.
@emcfarlane emcfarlane requested a review from doriable April 1, 2025 23:44
@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 2, 2025, 8:51 AM

@emcfarlane emcfarlane merged commit 1c58d75 into main Apr 2, 2025
10 checks passed
@emcfarlane emcfarlane deleted the ed/fixPublicImportsOrder branch April 2, 2025 19:35
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