Skip to content

Skip syncing refs if files are unchanged - #1296

Merged
pkwarren merged 1 commit into
mainfrom
pkw/BSR-6561-skip-commits-unchanged
Aug 11, 2026
Merged

Skip syncing refs if files are unchanged#1296
pkwarren merged 1 commit into
mainfrom
pkw/BSR-6561-skip-commits-unchanged

Conversation

@pkwarren

Copy link
Copy Markdown
Member

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.

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.
@github-actions

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 10, 2026, 10:04 PM

@pkwarren

Copy link
Copy Markdown
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).

@pkwarren
pkwarren merged commit 206c9fe into main Aug 11, 2026
7 checks passed
@pkwarren
pkwarren deleted the pkw/BSR-6561-skip-commits-unchanged branch August 11, 2026 14:38
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