Skip syncing refs if files are unchanged - #1296
Merged
Merged
Conversation
Historically for modules set to sync by commits (instead of tags), we've synced every upstream commit even if the calculated digest is identical to the last ref. A calculated digest is unchanged if the .proto, buf.md, LICENSE or other files haven't changed. This is frequently the case with large repositories where we only sync a small subset of files (googleapis/cloud-run and googleapis/googleapis). Looking at state.json for googleapis/googleapis, there are 5974 refs but only 41 unique digests across them. Syncing these commits is of low value (the label is immediately archived in the BSR) and leads to more maintenance on this repo than necessary. Update the fetch script and companion utilities to only write refs to state.json when the digest changes.
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
Member
Author
|
Ran against this branch: https://github.com/bufbuild/modules/actions/runs/31436797111/job/93612598791 It found no changes (it had previously opened #1295 but deleted it). Also verified against all the repos we sync by commits by starting over without a state.json file. It correctly created a ref for each changed digest (accounting for some historical changes to rsync.incl and other static files). |
DMarby
approved these changes
Aug 11, 2026
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.
Historically for modules set to sync by commits (instead of tags), we've synced every upstream commit even if the calculated digest is identical to the last ref. A calculated digest is unchanged if the .proto, buf.md, LICENSE or other files haven't changed.
This is frequently the case with large repositories where we only sync a small subset of files (googleapis/cloud-run and googleapis/googleapis). Looking at state.json for googleapis/googleapis, there are 5974 refs but only 41 unique digests across them.
Syncing these commits is of low value (the label is immediately archived in the BSR) and leads to more maintenance on this repo than necessary. Update the fetch script and companion utilities to only write refs to state.json when the digest changes.